# Tag Info

16

\empty is defined in the LaTeX kernel by % latex.ltx, line 122: \def\@empty{} % latex.ltx, line 441: \let\empty\@empty Actually the kernel macro is \@empty, but \empty is equivalent and is in the kernel for backward compatibility, because Plain TeX uses \empty. When you expand \empty you get nothing at all, so \empty{word} is just equivalent to typing ...

13

\llap is not a LaTeX box command and does not start a paragraph. \documentclass{article} \begin{document} \parindent=2cm \makebox[0pt][r]{x}Hello H\makebox[0pt][r]{x}ello \end{document}

13

Basically \noalign (which is a TeX primitive and not a supported LaTeX command) has to come as the first thing in a table row and its argument is evaluated as vertical mode material that is placed between rather than in the table rows. So \vspace just inserts vertical space. (If the table had vertical rules from | they would be broken by this additional ...

12

When you do \let<token-a>=<token-b>, TeX creates a pointer to the memory location where <token-b> is stored. Primitives are stored with the name they had at the beginning of the TeX run, before the format file is loaded; there would be no other way to represent them; maybe primitive \def would have been better, but Knuth chose not to and to ...

12

\newline is not defined in Plain TeX. There are also other problems in your code: you set \leftskip and \rightskip but close the group before it can act. \input plipsum % for mock text \def\thm[#1]{% \par % get in vertical mode \begingroup % open a group \leftskip 1in \rightskip 1in % set the margins \noindent {\bf Theorem.} {\it #1}\par\nobreak % ...

11

egreg's answer is of course correct but perhaps a bit terse. An illustrative example might help. \let\let\futurelet \let\def\let\xdef\futurelet\gdef\xdef\futurelet{} \immediate\write20{\string\let=\meaning\let} \immediate\write20{\string\futurelet=\meaning\futurelet} \immediate\write20{\string\def=\meaning\def} ...

10

As already mentioned in comments, the nag package does its best to pick up not only use of TeX rather than LaTeX syntax but also deprecated LaTeX stuff. That is the best you can do with LaTeX2e because of the way the kernel itself and packages are written: they use TeX constructs without 'LaTeX wrappers'. One of the aims of the LaTeX3 Project is to develop ...

9

The respective TeX code is @<Compute the hash code |h|@>= h:=buffer[j]; for k:=j+1 to j+l-1 do begin h:=h+h+buffer[k]; while h>=hash_prime do h:=h-hash_prime; end So basically each digit gets mapped to some 2^k mod p. Prefixes and postfixes don't actually make the hashing worse, but the somewhat peculiar structure of the hash table means ...

9

You are assigning the registers in the first cell of the table which is a local group. Using registers here doesn't really gain you anything over using macros, but if you want to do it you need to assign them before the table (just as you would if you used macros): \documentclass{article} \newtoks\toksA \newtoks\toksB \newtoks\toksC \newtoks\toksD ...

8

Where did you "learn" that using $as a switch to initiate and terminate inline math mode is incorrect for LaTeX users? I'd go even further than @egreg does in his comment and state that not only is using$ to start and end inline math mode not wrong, it has certain advantages over $$and$$. Consider the following MWE: \documentclass{article} ...

7

Not sure if any of these are an improvement, but three alternatives none of which grabs the environment body. The first two discard spaces. foo uses \uppercase but one at a time. fooo uses \mathcode foooo uses active characters (so you could not embed this macro in another macro argument) \documentclass{article} ...

6

The definition of \newcounter is \expandafter\@ifdefinable\csname c@#1\endcsname{\@definecounter{#1}} \@ifnextchar[{\@newctr{#1}}{} where \@definecounter is \expandafter\newcount\csname c@#1\endcsname \setcounter{#1}\z@ \global\expandafter\let\csname cl@#1\endcsname\@empty \addtoreset{#1}{@ckpt} \global\expandafter\let\csname p@#1\endcsname\@empty ...

6

You can directly use \string#1 if #1 is a control sequence: \def\printmeaning #1{{\tt\string#1} is defined as:\endgraf {\tt\meaning#1}} (with perhaps an additional \endgraf at the end. Or \par. I tend to use \endgraf for no reason outside of real typography).

4

\show uses the same internal routines that TeX employs for error messages. Judging now this may seem a design error, but one always has to keep in mind that TeX was released in 1982, when computer memory was quite scarcer than it is today. A front-end like Texmaker could, in principle, distinguish between diagnostic messages given by \show (or \showthe) and ...

4

\Char is not expanded because it is not an expandable token. Unlike \def\Char{a} which expands to a \let defines a token that essentially is a and like a it does not expand. The only way to get hold of this in classic TeX is to take \meaning\Char which will be the letter a split that up on spaces, and if the first two words are the letter take the ...

3

How's this? \documentclass[12pt]{article} \usepackage{ifthen} \newcommand{\exponent}[2] {% \ifthenelse{\equal{#1}{^}}% {a^{#2}b^{#2}c^{#2}}% {\ifthenelse{\equal{#1}{_}}% {a_{#2}b_{#2}c_{#2}}% {\message{## Warning: exponent command misused ##}#1#2}% }} \begin{document} Here is the exponent command: ...

3

One could define a macro called, say, \supsub, that takes two arguments -- the repeated material that goes in the superscripts and subscripts, resp. One or the other argument or even both arguments may be empty. \documentclass{article} % exploit the fact that \null is defined as '{}' \newcommand{\supsub}[2]{ a \if#1\null\else^{#1}\fi ...

3

Indeed, it is not possible without changing something. I don't know if the following is practical in your case: \long\def\a #1\par\a {[#1]} \def\b #1\par{(#1)} \a\b five\par\par\a \bye The preceding way allows to pin-point the \par to be dealt with by \a. But, if you are always certain that \a will be followed by two \par's, then there is \def\a ...

2

Here's an implementation with l3regex; the number is stored in \l_linuxss_code_int for later usage. One can extend the testing by acting on the search regular expression; this one catches the letter or the character. \documentclass{article} \usepackage{xparse,l3regex} \ExplSyntaxOn \NewDocumentCommand{\getlettercode}{m} { \linuxss_getlettercode:N #1 ...

2

I don't exactly know what the longtable macros do. I am guessing what you want, and here is one alternative. \startsetups table:align \setupTABLE[column][1][width=3cm, align=flushright] \setupTABLE[column][2][width=broad, align=middle] \setupTABLE[column][3][width=2cm, align=flushleft] \stopsetups \starttext \startTABLE[setups={table:align}] \NC ...

2

The problem is not in \protect\label which is not needed. The real issue is in what is written in the .aux file; the caption text is not expanded, so \padzeroes[2]\decimal{tmpa} is written as is. You have to expand the caption text, but using \padzeroes[2]{\decimal{tmpa}} would prevent it anyway, because the two commands are not fully expandable. Here's a ...

1

It should be possible with ps2pdf. After generating a PS file, I have used the following script for creating a PDF with embedded fonts: ps2pdf \ -dCompatibilityLevel=1.4 -dCompressPages=true \ -dUseFlateCompression=true -dSubsetFonts=true -dEmbedAllFonts=true \ -dProcessColorModel=/DeviceGray -dDetectBlends=true -dOptimize=true \ ...

1

Your TeX system can be configured to always embed the standard 14 PDF fonts into PDFs by issuing updmap-sys --setoption pdftexDownloadBase14 true (for pdftex) and to always embed the standard 35 PostScript fonts by issuing updmap-sys --setoption dvipsDownloadBase35 true (for dvips).

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