{"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].