Creating macros in OpTeX

Petr Oľsák
{"title":"Creating macros in OpTeX","authors":"Petr Oľsák","doi":"10.47397/tb/44-1/tb136olsak-optexmac","DOIUrl":null,"url":null,"abstract":"OpTEX [1] is an extended plain TEX. We can create macros as in plain TEX. In particular, this means that we use TEX primitives like \\def, \\edef, \\ifx, \\expandafter, \\csname, \\hbox, \\vbox, \\hrule, and so on. Likewise, we use basic plain TEX macros like \\newcount, \\llap and many others. I wrote a summary of these TEX and plain TEX tools in [2]. OpTEX keeps the plain TEX philosophy: it does not create any new syntactic, semantic, or thought layers over TEX, so the commands mentioned above are principal ones, basic for creating macros. For example, OpTEX doesn’t try to provide anything similar to \\newcommand, nor anything similar to expl3. The main message is: if you know TEX, you can make your macros. On the other hand, OpTEX provides many elementary macros which can make macro programming easier. And there are a few conceptual recommendations especially to separate different namespaces when your macros will be used for public purposes. This article summarizes these tools and principles. More detailed information can be found in the OpTEX manual [3].","PeriodicalId":93390,"journal":{"name":"TUGboat (Providence, R.I.)","volume":"1 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2023-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"TUGboat (Providence, R.I.)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.47397/tb/44-1/tb136olsak-optexmac","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

OpTEX [1] is an extended plain TEX. We can create macros as in plain TEX. In particular, this means that we use TEX primitives like \def, \edef, \ifx, \expandafter, \csname, \hbox, \vbox, \hrule, and so on. Likewise, we use basic plain TEX macros like \newcount, \llap and many others. I wrote a summary of these TEX and plain TEX tools in [2]. OpTEX keeps the plain TEX philosophy: it does not create any new syntactic, semantic, or thought layers over TEX, so the commands mentioned above are principal ones, basic for creating macros. For example, OpTEX doesn’t try to provide anything similar to \newcommand, nor anything similar to expl3. The main message is: if you know TEX, you can make your macros. On the other hand, OpTEX provides many elementary macros which can make macro programming easier. And there are a few conceptual recommendations especially to separate different namespaces when your macros will be used for public purposes. This article summarizes these tools and principles. More detailed information can be found in the OpTEX manual [3].
OpTeX中创建宏
OpTEX[1]是一个扩展的普通TEX。我们可以像在普通TEX中那样创建宏。特别地,这意味着我们使用诸如\def、\edef、\ifx、\expandafter、\csname、\hbox、\vbox、\hrule等TEX原语。同样,我们使用基本的普通TEX宏,如\newcount、\llap和许多其他宏。我在b[2]中对这些TEX和普通TEX工具进行了总结。OpTEX保持了普通的TEX哲学:它不会在TEX之上创建任何新的语法、语义或思想层,因此上面提到的命令是主要的,是创建宏的基础。例如,OpTEX没有尝试提供任何类似于\newcommand的东西,也没有任何类似于expl3的东西。主要的信息是:如果你知道TEX,你就可以创建你的宏。另一方面,OpTEX提供了许多基本的宏,可以使宏编程更容易。还有一些概念性的建议,特别是在将宏用于公共目的时分隔不同的名称空间。本文总结了这些工具和原则。更详细的信息可以在OpTEX手册[3]中找到。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信