Hot answers tagged

19

I would define some macros to handle the parts of the code that don't change. Here's an example of something you can do: \documentclass{article} \usepackage{amsmath,amssymb} \makeatletter %% user macro translated into internal control sequence %% to test whether short or long form. \newcommand\intU{\ae@intU} %% short form is flagged by a `*` ...


10

I will cite from my book "TeXbook naruby", page 22. The precedence of rules of token processor is important. First rule (with highest precedence) is (a) "double caret" rule. Second rule is "creating control sequences" (b) when a character with catcode 0 occurs. And this rule says: There are two ways. If the first character (after catcode 0) has catcode 11 ...


9

He means that while, with that catcode, t is ignored so TetX is printed as TeX, it is not ignored while tokenizing so \TetX does not tokenize as \TeX. (and for the same reason actually \t is a normal token as you show.


8

As noted in other answers, we have here a control sequence which is not a control word (the escape char then one or more letters) but rather a control symbol (the escape char then exactly one non-letter). Thus this case is not different from say \%. The point that ignored chars cannot appear in a control word follows from the rules as described by wipet. ...


7

The command line options are in the web2c implementation derived from unix tex, specifically /source/texk/web2c/lib/texmfmp.c which starts /* texmfmp.c: Hand-coded routines for TeX or Metafont in C. Originally written by Tim Morgan, drawing from other Unix ports of TeX. This is a collection of miscellany, everything that's easier (or only ...


6

You don't say, but \reserved@a suggests that you are using latex in which case \message{ab^^Jcde} works although it is better to use latex constructs such as \typeout or \PackageInfo In plain TeX the above \message will work if you set \newlinechar=`\^^J


5

The \message primitive expands input in the same way as \edef and needs something which produces a 'raw' new line to get the desired effect. On the other hand, \\ is a command to produce a line break in typesetting, so fails here (it is also not expandable, hence the odd error). You therefore need to insert a character equal to \newlinechar. In the LaTeX ...


4

Is it better to use \def\foo{xxx} instead of \newcommand*{\foo}{xxx}. I can perform the check for duplicate macro names outside of TeX. No, comes to the same thing For instance, does \expandafter\newcommand\csname dir1/dir1/long-file-name\endcsname{xxxx} have any issues in regards to capacity. in theory yes, the csname has to be stored somewhere ...


1

The LaTeX kernel has some non publicized programming tools, such as while loops. The more well-know \loop is not appropriate here inside the tabular for a number of reasons, one being that it makes a local definition which will get lost, the other one is that \cline also uses \loop and this would clash. Here is a one-liner to get user access to one LaTeX ...


1

As your suggested code uses \makebox it is clear this is intended for LaTeX. LaTeX box commands always use horizontal mode to avoid this and other problems. The direct analogue of \raise is \raisebox but here a tabular seems more natural. \documentclass{article} \begin{document} \newcommand\withHatTitle[2]{\begin{tabular}[b]{@{}l@{}}% #1 \hrulefill\\% ...



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