All Questions
322
questions
3
votes
2
answers
59
views
Custom LaTeX Command for Consecutive Superscripts with Correct Alignment After Large Symbols
I am writing my master's thesis on Formal Concept Analysis and I want to create a custom command for the derivation operators. They are superscript arrows with some optional argument, and would look ...
1
vote
1
answer
203
views
Is LaTeX a programming framework of TeX?
My take from What is the difference between TeX and LaTeX? is that TeX is the programming language that renders the document. LaTeX is a well-known macro package for TeX with the aim to make the ...
2
votes
2
answers
112
views
Place explicit character tokens of category 1/2, whose character codes are to be specified, before/behind tokens that form arbitrary macro argument?
Assume tokens
\macro{1612512}2{1612612}2{1⟨arbitrary non-outer brace balanced tokens⟩}2;
the 1st argument of \macro holds a TeX-⟨number⟩-quantity in the range of possible codepoints of the TeX engine'...
1
vote
2
answers
68
views
How to double explicit character tokens of category 6/parameter of an arbitrary sequence of tokens? (Not the \edef..{\unexpanded{..}}-thingie)
Assume there is defined a macro \foo:
\def\foo{\bar\space A hash {in {braces: \string##}\string##}}
Expanding a control word token/macro token \foo yields:
\bar\spaceA11␣10h11a11s11h11␣10{1i11n11␣10{...
4
votes
1
answer
164
views
String-separated arguments in LaTeX
One of the features I like best in Plain TeX is the ability to write macros with arguments separated by a sensible delimiter. For example
\def\translate#1 = #2 (#3){...}
What is the LaTeX way of ...
3
votes
0
answers
68
views
Are there tricks for detecting whether a `\csname..\endcsname`-thingie went wrong and, if so, delivering additional messages explaining the issue?
For the sake of having expandable tokens expanded before stringification I sometimes combine \csname..\endcsname-expansion with \string as in
\chardef\stopromannumeral=`\^^00
\edef\gobbleToPrefix{%
\...
0
votes
1
answer
82
views
Exercise 5.7 in TeX - define control sequences with grouping
I want to solve Exercise 5.7 in the TeXBook by Donald E. Knuth.
Define control sequences **\beginthe**<block name> and **\endthe**<block name>
that provide a “named” block structure.
In ...
0
votes
0
answers
114
views
Differences between TeX/LaTeX and Script/GML
I often see people saying that SGML and LaTeX are different because SGML is made for defining markup languages, while LaTeX is using TeX macros to simulate content markups. However, SGML is based on ...
1
vote
0
answers
72
views
On TEXINPUTS, input@path, graphicspath, l_file_search_path_seq etc
There appears to be multiple methods to customize the locations where (La)TeX search for files, as well as packages like import etc.
What are they/how to use them?
Why were they introduced? Why are ...
0
votes
2
answers
104
views
Why are braces mandatory in boxes?
Both \hbox and \vbox (and similar box commands) require explicitly to enclose their content inside of curly braces, so they behave differently from macros. What's the reason of this specification?
If ...
5
votes
4
answers
415
views
How to use full-string conditionals in latex
I want some conditional paragraphs in my document. I've been following chapter 13.2 of "Tex by Topic", but I've run into limitations.
\documentClass{report}
\def\option{a}
\begin{document}...
0
votes
1
answer
81
views
Retrieve a command name from inside its code [closed]
Is there a trick (some unkown primitive ?) to getting the name of a command from inside the code that makes up that command, something like \thiscommandname or the like ?
6
votes
2
answers
245
views
Non-tail recursion and argument expansion order
I'm having a trouble understanding the expansion order of TeX macros:
\newcount\x
\def\dec#1{%
\ifnum#1=0
.%
\else
#1%
\x=#1
\advance\x by-1
\dec{\number\x}%
#1%
\fi%
}
\...
3
votes
2
answers
59
views
How can number comparison be terminated in general way for macro parameter?
I'm wondering if there's a nice, generalized way to terminate a number which is given as a macro parameter either explicitly (as a number) or implicitly (as a register value or \chardef). This would ...
4
votes
1
answer
223
views
What are the differences between primitives/registers/macros/tokens?
I started learning LaTeX and these words appear a lot in both questions and answers. Do they all mean the same thing or are they different concepts?