Tag Info

18

\task takes one argument, passing it to \@task which is defined in such a way that its arguments are delimited; if the call is \@task xyz:AB:cde:u\@nil the first argument is xyz, the second is AB and the third is cde:u. Here \@nil doesn't mean anything, it's just required by the syntax of \@task and TeX throws it away. \relax is a primitive of TeX, its ...

15

The \detokenize primitive converts all of its input into category code 12 ('other') tokens, except for spaces which stay as category code 10 ('space'). It is used to convert tokens into strings. For example, if we have \detokenize{\foo} then \foo would be a control word, i.e. one token, which is converted into 5 string characters (\, f, o, o, ), all which ...

11

TeX works with tokens, and what you need to know is that a control sequence such as \foo is not tested by \if as a series of characters, but as a single 'unit'. There a a few primitives that will turn control sequences back into single tokens: \detokenize does this for a set of tokens, while \string does so for a single token. The latter is also available in ...

10


8

TeX will allow you to use implicit { and } tokens in some places: these are available as \bgroup and \egroup. The \detokenize primitive is toks-like, and so will accept an implicit begin-group token \detokenize\bgroup stuff} \bye but requires an explicit end-group token (as shown). \begingroup/\endgroup forms a 'semi-simple' group, which is not the same ...

7

Together with guidelines in Handling of special LaTeX characters in text, you can expand \myvar before \detokenize-ing it: \documentclass{article} \usepackage[T1]{fontenc}% http://ctan.org/pkg/fontenc \def\myvar{given_test} \begin{document} \textbf{filename: \detokenize\expandafter{\myvar}} \end{document}

6

\string only takes one token and prints that, so it only ever sees \permel. Try \providecommand{\symbdef}[2]{\texttt{\color{blue}\detokenize{#1}} & #1 & #2} This will insert explicit spaces after control sequences, which is not semantically wrong, but might not be aesthetically pleasing. In that case, try filtering out the spaces like this: ...

4

It shouldn't be difficult to change your pipeline to do pdflatex "\edef\myvar{\detokenize{given_test}}\input{figures.tex}" Example with figures.tex like this: \documentclass{article} \begin{document} Here's the file name: \texttt{\myvar} \input{\myvar} \end{document} and with given_test.tex containing Hello World! Compiling with the above ...

3


3

\verb and verbatim use the list stored in \dospecials. The most complicated part in their definition is how to end them which is rather tricky as \ and } no longer work. In simple cases you can use simply another char like ] as end of group: \documentclass{article} \usepackage[T1]{fontenc} \begin{document} {%a new endgroup char: \catcode`\]=2 ...

Only top voted, non community-wiki answers of a minimum length are eligible