Questions tagged [tex-core]

{tex-core} is for questions for syntax, semantics and expected behavior of TeX primitive control sequences, regardless of extensions (eTeX, etc.) formats (Plain or LaTeX) and macro packages (tikz). 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}.

Filter by
Sorted by
Tagged with
4
votes
1answer
192 views

When should I use a \box register rather than \def? [duplicate]

\def is sometimes used as an abbreviation of a box construction, then its output is sometimes the same as the output with a \box register instead of \def. Here is the question. When should I use a \...
4
votes
2answers
201 views

Why isn't there any command to start a paragraph with \vbox?

\vbox does not switch modes and \hbox does not switch modes, as demonstrated by the following two groups of examples. The following two examples produce identical output: \hbox{A} \end \noindent A \...
5
votes
1answer
182 views

Question about exercise 21.10 in The TeXbook

This exercise asks how to store expansion of \chapno at the moment when \write is processed, but \the\count0 must be expanded at the moment of \shipout. Here is a full example: \def\chapno{5} \...
61
votes
4answers
7k views

When is TeX better than LaTeX? [duplicate]

Is there any situation where it is preferable to use TeX (or perhaps plain TeX) rather than LaTeX to write a document?
0
votes
0answers
36 views

How to display the index-number of the current box

In LaTeX (or maybe in TeX), how one can get notified about the "index" to the current LaTeX or TeX-box? For example, say an empty page is created in LaTeX; we firstly add a paragraph and then a ...
0
votes
0answers
10 views

White edge around text when underlining using \contour{white} inside a shaded environment

When using the simple code for adding nice underlines under your text: \usepackage{ulem} \usepackage{contour} \newcommand{\ul}[1]{% \uline{\phantom{#1}}% \llap{\contour{white}{#1}} … a problem ...
1
vote
1answer
59 views

How to add a \addtoreset mechanism to pure TeX \newcount?

I'm using subfig package for sub-figures, thus I'm trying to create a scheme to add a enumeration inside the label to make it easier to describe the sub-pictures. Using \begin{enumerate*} and \begin{...
1
vote
0answers
116 views

Badness: why 100.|z|^3 instead of 100 z^2?

As written here on page 158, the badness penalty is 100|z|^3 instead of 100z^2. Why is "3" in the exponent when we take the absolute value of z? Here z=(L-w)/w^+, where L is the required width and w ...
0
votes
0answers
25 views

Does rulewidth depend on the pdf viewer?

I set rule width like so. \newcolumntype{?}{!{\vrule width 0.001pt}} It renders just fine in my texStudio viewer, as very very faint lines. But when I open the pdf in an external viewer... I get ...
8
votes
1answer
330 views

How come the catcode of ' is 12 while ' is let to be a macro?

' is defined in latex.ltx as follows \def\active@math@prime{^\bgroup\prim@s} {\catcode`\'=\active \global\let'\active@math@prime} \def\prim@s{% \prime\futurelet\@let@token\pr@m@s} \def\pr@m@s{% \...
5
votes
1answer
138 views

Special \relax definition in the unravel package

The unravel package defines an \__unravel_special_relax: command, for which we find in the documentation the following: A special marker slightly different from \relax (its \meaning is \relax but ...
2
votes
2answers
110 views

\vrule and \hrule in \leaders

Those questions were came up when I was looking through The TeXbook around page 225 and solving the exercise 21.6 in there: In \leaders, are \vrule and \hrule essentially the same ? On the other ...
0
votes
1answer
40 views

What is the effect of {} in \eqalign?

$$\eqalign{&{}+7=b\cr}$$ and $$\eqalign{&+7=b\cr}$$ are the same; but $$\eqalign{{}+7=b\cr}$$ and $$\eqalign{+7=b\cr}$$ differ from each other (the first has more space between + and 7)....
2
votes
1answer
26 views

How to pass custom commands to LetLtxMacro?

I think it's fairly common to redefine macros. And I'm creating two functions to help storing and restoring these redefined macros. And so I tried using the following: \documentclass{article} \...
1
vote
1answer
67 views

Writing expanded macro with space to file

I'm trying to write an expanded macro to a file without the expansion eating the space after it. I could replace the {} empty group with an explicit \space, but I want this to be fairly robust. Is ...
9
votes
1answer
145 views

\lowercase trick vs. \gdef

In this MWE I define an environment where a particular letter is active with some meaning once with the \lowercase trick and once with \gdef: \documentclass{article} \begingroup \catcode`\A=\active \...
1
vote
2answers
43 views

Valid values for `\newfont`

I'm using a template for a thesis and want to change the font of the chapter number. The template ("classicthesis") uses: \newfont{\chapterNumber}{eurb10 scaled 7000} with using Eulerfont. I'd like ...
3
votes
1answer
174 views

Knuth's 5 volume TeXbook A,B,C,D and E

Can I freely download the Knuth's 5 volume set books COMPUTERS and TYPESETTING in pdf and the source of TeX and {\sf METAFONT} that these book contain and a compiler for the sources that would ...
6
votes
3answers
815 views

\indent and \noindent: details from Knuth's The TeXbook

On page 286 in Knuth's book he writes: \noindent has no effect in horizontal mode. On the contrary on the page 283 he writes : This is exactly like \indent except that TeX starts out in ...
6
votes
0answers
120 views

Historical imperfections of (La)TeX [closed]

Assume for a moment that all TeX literature, TeX software, TeX files etc. got destroyed in some global cataclysm. All information about TeX survives only in the mind of a few TeX gurus, or something ...
0
votes
0answers
26 views

ERROR Undefined control sequence `\includegraphics` [duplicate]

My question has been asked severals times on the forum but nothing works for me. I would like to insert a picture. Here's a simple example that should work but which doesn't. \documentclass{article} ...
2
votes
1answer
45 views

What does the name “muglue” mean?

I'm wondering what muglue means in LaTeX and what it is an abbreviation/acronym of: m/u/glue. I have some idea though what glue in LaTeX means.
11
votes
2answers
484 views

\the vs. \value: what is the difference

I would like to understand the difference between \the and \value{} when using counters in LaTeX.
1
vote
2answers
43 views

Redefining the length-related commands to have a decimal coefficient

The macro of \! is defined as: \def\!{\mskip-\thinmuskip} and the command of \thinmuskip is initialized as being \thinmuskip = 3mu (Appendix B: p.349, The TeXBook). I couldn't have found the ...
3
votes
1answer
40 views

What is the use of putting the grave accent after \catcode?

Can someone kindly explain why is there and what is the use of the ` in \catcode`@=11? I came across that while I'm learning TeX from The TeXbook. Thank you very much.
4
votes
1answer
84 views

The mechanism that expands a double hyphen into an en-rule

What is the mechanism that transforms -- into –? How do I use the same mechanism to transform an arbitrary sequence of tokens into an arbitrary sequence of symbols?
7
votes
2answers
95 views

Is there a `for each` loop in primitive (La)TeX? [duplicate]

I am trying to iterate over the list of all basic colours: \def\thecolors{black, blue, brown, cyan, darkgray, gray, green, lightgray, lime, magenta, olive, orange, pink, purple, red, teal, violet, ...
1
vote
1answer
55 views

Print out command line used

Is there a way to print out the command line used to compile the latex document? The document is compiled using an editor and I'd like to get what it is specifically using.
7
votes
2answers
228 views

How to have hashes doubled _and_ things expanded?

I'd like to learn some TeX programming technique which I can always apply for handling the same type of situation: The code \newtoks\mytokenregister \def\five{\four5} \def\four{\three4} \def\three{\...
10
votes
2answers
947 views

How to compare integers in TeX?

I do not understand how I can compare integers in TeX. \documentclass[]{article} \begin{document} \if 1<>0 1 is not equal 0. \else 1 equals 0. \fi \end{document} According to this code ...
2
votes
1answer
65 views

How to modify \everypar safely in a package?

This is a follow-up to What does the \the\everypar do? and TikZ Overlay: Inject content at the start of the next paragraph? From a quick grep -R '\\everypar' texmf-dist/tex/latex I can see that \...
0
votes
0answers
108 views

Tex for IT professionals [duplicate]

I'm working as a programmer for about 20 years and invested a lot of time into understanding programming and computers before earning money with it. I've learned to program Java, use Windows, then ...
5
votes
1answer
76 views

Write to screen/console but not to .log file

I use LaTeX without Lua extensions. Is there a platform-independent possibility built into (La)TeX for writing a message to screen only but not to the .log file?
1
vote
1answer
101 views

How to use Optima font in Overleaf with any compiler?

I'm a new LaTeX user with my first use case being math proofs. I want to use Optima font (which came installed on my Mac) for my proof, and as far as I can tell I have to use the XeLaTeX compiler to ...
5
votes
1answer
54 views

TeX truncating output of \showbox command

I am studying Knuth's "The TeXbook". In Chapter 12, he demonstrates the glue that TeX puts between words by looking at the contents of hboxes in internal diagnostic format. I am trying to use \showbox ...
0
votes
1answer
76 views

Is there a command, macro or tool that can get the string result (as in other languages) of any macro in an easy to use way? [closed]

I don't want to go down into the depths of expandable and not expandable. I doubt that I will be able to understand my self-developed designs a few weeks later. Therefore I am looking for a universal ...
12
votes
1answer
549 views

Are there any non-WEB re-implementation of TeX Core in recent years?

I am looking for re-implementations, in recent years, of the TeX core algorithm (which Knuth wrote in ca. 1982). It would seem to me that LaTeX, XeTeX, LuaTeX all call the TeX core, which is written ...
0
votes
1answer
66 views

Plain TeX bold math in section titles

I apologize if this question is very similar to others, but the other solutions have not worked for me. I am using plain TeX, and trying to make the math in my section titles bold. Any help would be ...
5
votes
1answer
113 views

two sets of hyphenation patterns without a newlanguage

While reading hymaster.tex, part of hyacc-cm, we find the following statement: It is important to use version 3.xx of TeX, and a version 3.xx of plain.tex. The critical date is autumn 1989, and ...
3
votes
1answer
58 views

Change in everypage package behavior (which hasn't been revised since 2007)

The everypage package was last changed in June 2007 (https://www.ctan.org/pkg/everypage). And yet, in the last few months, since I upgraded my LaTeX installation, it behaves differently. The only ...
3
votes
1answer
77 views

Help migrating book from TeXTures

I am helping a friend who has to update a book that was originally written in plain TeX using TeXTures quite some time ago. TeXTures was a very nice TeX implementation for Macs by a company called ...
4
votes
1answer
82 views

What would be the drawbacks of adding #0 for denoting the name of the macro that currently is expanded?

Assume a scenario where some macro triggers error-messages. The error-messages shall also reveal the name of the macro which did trigger the error-message. One could do something like this: \...
2
votes
1answer
107 views

Relationship between TeX and Metafont with parametric variations

In "The Concept of a Metafont" Donald E. Knuth explores in a visual way the possibilities of parametric variations. But I have some questions: Did he used TeX to typeset the article? Does TeX allows ...
0
votes
0answers
88 views

How to get the actual width of the vbox in TeX

I'm trying to obtain in TeX the actual size of the box after inserting material which is overflowing the size of the box. I can easily get the hight by reading \ht0 and \dp0, but when I read \wd0 I'...
2
votes
0answers
52 views

In *nix based systems, how does LaTeX recursively look for classes / styles? [duplicate]

Broadly speaking, how does LaTeX look for class and styles in a *nix based system? More specifically, export TEXMFHOME='~/.config/texmf' followed by texhash ~/.config/texmf is not referenced when I ...
5
votes
1answer
102 views

Macro inserted via \everypar in \obeylines context doesn't see some commands

I have the following code which works as expected except, as noted in the code, when a macro begins a line of the xltabular being built: \documentclass{article} \usepackage[papersize={5.5in,8.5in},...
19
votes
2answers
2k views

How many lines of code does the original TeX contain?

I am currently implementing a non-trivial software component (not related to typesetting), and would like to compare it to other components both from the same field and from other fields, including ...
0
votes
0answers
42 views

Text fitted around the middle image or note

Please see this article In my own case, I have a text middle of which I wish to insert a square containing a note. How we can do that!!!
9
votes
1answer
106 views

Semantic differences of global definitions in local group relating to save-stack entries

This is a follow-up question on \global variant of \csname…\endcsname, which asks for a solutions to the problem explained there, but doesn't ask for an explanation. The gist of the problem is that {...
17
votes
2answers
481 views

\global variant of \csname…\endcsname

Please consider the following minimal example: \documentclass{article} \tracingrestores=1 \def\foo{\bar\foobar} \def\bar{\gdef\testA{blabb}} \def\foobar{\expandafter\gdef\csname testB\endcsname{...