{tex-core} is for questions that are independent of formats and macro packages. Such questions usually relate to low-level TeX programming or the behaviour of TeX at an underlying level. Note that even Plain TeX is a format in itself; for questions about it, use {plain-tex}.

learn more… | top users | synonyms (1)

9
votes
2answers
359 views

Where to find official (!) and extended documentation for tex/latex's commandline options (especially -interaction modes)?

Today I tried to learn more about the several interaction modes for tex/latex/pdflatex etc. The manpages turned out to be not very helpful: $ man tex ... -interaction mode Sets the ...
8
votes
1answer
1k views

Why does \@gobble take one argument

I understand what \@gobble, \@gobbletwo etc. do, but I don't understand why \@gobble allows for an argument. I believe that the definition of the macro is \long\def\@gobble#1{}. Why is this argument ...
8
votes
2answers
268 views

Normal \relax vs. frozen \relax

With \edef\x{\ifnum0=0\else\fi} being \relax and with \def\y{\relax} we see that \ifx\x\y is false. Why? See also \ifcsname when it isn't apparent that the command is \relax'ed.
8
votes
2answers
751 views

Selecting optical size?

For some time I've seen LaTeX-produced documents that had slight differences in fonts. When you looked at them, they had the same Computer-Modern or Latin-Modern, however, they looked more stylized ...
45
votes
4answers
6k views

Shortest code causing “Emergency stop.” error

This question is purely academic. TeXing a file containing \valign{\halign#\cr! causes an ! Emergency stop. error. Is that the shortest code which produces a fatal error in TeX?
25
votes
4answers
2k views

Test success of write18

For the new version of my package and class standalone I like to call external programs: further (pdf)latex runs to optionally compile included standalone files, and to convert the resulting PDF to ...
16
votes
2answers
580 views

How does one publish/promote a new package?

I just took all the wonderful information supplied here, and wrote a small package that makes it possible to use Unicode characters for section, subsection, subsubsection, paragraph, subparagraph and ...
11
votes
7answers
2k views

Can I see a plain TeX source file please?

all the LaTeX-tutorials tell me how LaTeX is an extention simplifying the building of TeX documents. Understandably, no one uses plain TeX anymore, right? But I seem to learn better when I grasp the ...
10
votes
2answers
586 views

How to get the catcode of a token?

For debugging a complicated macro I would like to print out the catcode of a token. Optimally I would like to have a macro \getcatcode such that, for example, \getcatcode{a} would expand to 10. How ...
8
votes
3answers
228 views

Detecting which version of the LaTeX format is in use

ltxcmds provides \ltx@ifpackagelater, \ltx@ifclasslater, \ltx@iffilelater and there is \@ifpackagelater - but is there any "if TeX later" or some other way to (automatically) get the used TeX version ...
8
votes
2answers
681 views

Reading the contents of a box

Is it possible to take a box and retrieve the following information from it: A list of all "top level" internal boxes; All intervening space (kerns and glue: did I forget another type of space?)? ...
26
votes
3answers
666 views

When is it better to use \par than \endgraf?

Just yesterday I had to patch a package file (changing the description to indicate that the file had changed) to replace some \par to \endgraf because the code had bad interactions with non-\long ...
24
votes
3answers
1k views

How to know whether or not we need \expandafter?

The following is quoted from Peter Grill's answer on question LaTeX dynamic macro definition. The \expandafter is requried as the \newcommand needs to be dealt with after the \csname. As a ...
22
votes
6answers
4k views

What is \iffalse for?

So this is something I've wondered about for a while. What use is a conditional that always evaluates to false? I guess it's a neat way to "hide code from LaTeX" but apart from that, is it ever ...
22
votes
2answers
1k views

What’s behind \over?

Typically a TeX command have arguments coming after it. But the command \over, which is used to produce fractions, can access the token before it. How exactly is it implemented and can I define a ...
18
votes
2answers
307 views

Get the lion to run in loops. Tersely

Various constructions can cause TeX (aka the lion) to go into an infinite loop. The simplest example is \def~{~}~, which defines ~ to expand to itself, then expands it. Now, if we exclude macro ...
17
votes
2answers
4k views

What's the difference between \tolerance and \badness ?

I'm having some difficulty understanding this sentence on page 29, Chapter 6 of Knuth's TeXbook: Run TeX again, and begin this time by saying \hsize=2in \tolerance=1600 \input story ...
15
votes
3answers
1k views

Difference between \mskip and \mkern

What are the differences between \mskip and \mkern? The TeXbook writes the following (ch. 18): You can insert math glue into any formula just by giving the command ‘\mskip⟨muglue⟩’. [...] ...
14
votes
4answers
674 views

File copy without expansion

What is the command for file copy? I want to copy the contents of one file into another without any command expansion. The operative system would use copy source target I tried reading the contents ...
13
votes
1answer
213 views

How to find out if a math list consists of a single character?

When accents are placed, the TeX engine gives single characters a special treatment; see the TeXbook, Rule 12 on page 443. See also this question and its accepted answer for details. Thus, ...
13
votes
3answers
2k views

How to use \valign?

I just bumped into a interesting command called \valign. It seems to be the sister of \halign, but the TeXbook seems to be rather shy on explaining its use. As is the TeX by Topic. They only mention ...
12
votes
2answers
537 views

Is a TeX macro defined?

I am looking for a way in TeX to check if a macro was defined. Currently I use a rather tangled way. I exploit a sort of side effect when comparing two macros via \ifx; this command returns: true, ...
12
votes
4answers
1k views

Making efficient use of \writes

I'm currently trying to compile my thesis using LaTeX and have run up against the old ! No room for a new \write . problem. After some googling it seems the only way to actually resolve this problem ...
11
votes
5answers
1k views

Teach me how to use \loop…\repeat constructs, etc

The following code snippet is a part of the solution given here: \def\IncludeOutput#1{ \parskip=2mm \def\examplename{#1} \pdfximage{\Directory/\examplename.pdf}% ...
11
votes
1answer
605 views

How to do \scantokens inside \edef without triggering “Runaway definition”

I'm trying to find a way to use the e-TeX \scantokens command inside [the equivalent of] an \edef (well, actually an \xdef, but presumably this does not make any real difference since that's just the ...
9
votes
2answers
917 views

How to avoid underfull vbox in combination with \vsplit?

In the following example I am using the command \vsplit. I can't see the reason why \vsplit produced an overfull \vbox \documentclass{article} \parindent0pt \def\exampletext{Text Text Text Text Text ...
9
votes
6answers
1k views

Function like macro?

If you have programmed in a high level programming language, you must be familiar with the concept of functions, subroutines which return a value. For example, if you write in C, you can write a ...
5
votes
3answers
233 views

Possible CSS type features?

Hi I am doing a project for my 10th grade Graphic design class and we have to make up an inspirational type thing with the emotion words Bold, in a bigger size and capitalized and I was wondering if ...
4
votes
5answers
667 views

Continuously-sizable fonts?

Why are we stuck with a finite number of font sizes in LaTeX? Modern fonts are fully vector-based and scalable - why can't LaTeX do this? Or maybe it can, and I just don't know how. Also see the ...
23
votes
2answers
510 views

Backward definition of (La)TeX commands

Again and again I see, that TeXnicians define commands and do several things with them in the reverse order, I would do this as amateur. See this example: In his answer to scrpage2: Three ...
19
votes
3answers
3k views

What is the difference between \ifx\somecommand\undefined and \ifdefined\somecommand\else?

What is the difference between \ifx\cyrdash\undefined and \ifdefined\cyrdash\else? \cyrdash is any macro.
15
votes
4answers
614 views

Selectively suppress generation of typeset output

Is it possible put TeX into a "mute" mode in which all typesetting is suppressed? \documentclass{article} \pagestyle{empty} \begin{document} \suppress This text will not be seen in the generated ...
15
votes
2answers
1k views

How to add a hook to a macro

LaTeX uses hooks extensively, one method employed is the command g@addto@macro. It is defined in source2e as: \long\def\g@addto@macro#1#2{% \begingroup \toks@\expandafter{#1#2}% ...
10
votes
1answer
346 views

Interwoven alignment preambles are not allowed - what exactly does this mean?

I admit that this post is purely idle curiosity. But I recently stumbled upon a little factoid saying that the TeX error "Interwoven alignment preambles are not allowed" has the following explanation ...
9
votes
1answer
690 views

Trapping LaTeX error/warning

Is there a way to trap an error/warning in LaTeX during compile time? I'm thinking of something similar to the VB script On Error Goto <blah>, but this time for LaTeX in something like ...
8
votes
5answers
349 views

What sequence of documents should I read to know “all of” TeX and then LaTeX?

I know that there are a already number of questions on this site about good instructional (La)TeX materials for users at different levels. What I am interested in, though, is what set of documents ...
7
votes
2answers
114 views

Is there a way of defining a command \nullifyifmoved{arg} that will normally act like its argument but act like a no-op if the macro is “moved”?

I'm interested in a macro \nullifyifmoved that takes one argument arg and acts like arg in normal contexts, except it acts like a no-op wherever it is written to a file. Some background: Martin ...
4
votes
2answers
210 views

alternative syntax of subscripts using tex

I would like to sometimes write subscripts using different syntax, instead of $u_{xx} blahblah$ write something like $u⎵xx blah blah$, or even $u⎵xx+blah blah$ where either space following the x ...
4
votes
2answers
362 views

What is the ConTeXt or plain TeX equivalent of \nolinebreak?

The command \nolinebreak[4], if placed between two characters, should prevent a line break from appearing in that location. This command does not seem to be defined in ConTeXt. Is there an equivalent ...
3
votes
3answers
13k views

Error Latex TeX capacity exceeded, sorry [input stack size=5000]

I want to test this template http://students.engr.scu.edu/~sschaeck/latexforthesis/. when i run the makefile i get this error .Please what does it mean this error here the code : ...
12
votes
1answer
266 views

Test if a number is in a comma separated range/list of numbers

Martin Scharrer posted a very elegant answer for the question "Creating a zebra effect using listings". I want to extend that code to highlight only lines given in a comma separated list. The ...
10
votes
1answer
344 views

Macro delimiter

I'd like to have a macro to split up another macro content, with field separator being a space. So: \def\mytext{foo bar} \def\secondof#1 #2{#2} \secondof\mytext What? What do you mean: "runaway ...
9
votes
4answers
594 views

How do I get the category code of a character that is the value of a control sequence?

How can I get the category code of a character that is the value of a control sequence? If I do this The catcode for A is \the\catcode`A. I get The catcode for A is 11. If I do this \let\abc=A ...
8
votes
2answers
157 views

Commands that disable everything except the counters

what I'm looking for... I'm looking for a couple a commands, \disableAllButCounters and \enableAll that would do the following: Everything between \disableAllButCounters and \enableAll would ...
7
votes
3answers
356 views

Making mathmode obey spaces

I know this is kind of blasphemic thing to ask, but is there a way to make mathmode obey spaces? Preferably in Plain with XeTeX.
6
votes
1answer
379 views

Equation tag in twoside-mode outer

At the moment I thinking about the following think. When I use the twoside mode to write a book I want to print the number of the equation outer. I can modify it manually with these two commands: ...
6
votes
2answers
315 views

Is there a way to dissect math lists?

In the course of trying to answer this question, I now realize that I need to be able to construct a math list and then check if it consists of a single character atom. What I would like to be able ...
5
votes
1answer
330 views

What is the proper way to prevent text from splitting across columns and pages?

I have some description environments which I do not wish to have split across columns or pages. Is there some command which can be placed around an item to ensure that it will never be split across ...
5
votes
1answer
191 views

How can I reverse the order of letters/tokens?

I want a simple way to have: \reverseit{abc defg \mycommand} yield \mycommand gfed cba ? (Yes, the original motivation is related to Hebrew and RTL languages, but that can sort of be solved ...
4
votes
1answer
242 views

Luatex os.execute not working

I've hooked luatex's stop_run callback so I can do some processing on the output pdf after it is generated. To process the pdf I need to call os.execute. When doing so I an error saying "All command ...