{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)

5
votes
1answer
50 views

Equivalent Leaders construction

What is the equivalent construction of \leaders\hrule height 1pt depth 1 pt\hskip 20pt \relax in terms of the following construction or something similar \leaders\hbox{\vrule height 1pt depth ...
2
votes
0answers
20 views

Listings - Getting the colors right for custom language

I have lots of bookkeeping transactions that I would like to typeset in a color coded format. I am using the listings package to accomplish what I want. I tried the following code. ...
27
votes
3answers
431 views

How to define phantoms for depth and height?

In the third "dangerous bend" on page 178 of of The TeXbook there's the following description of \vphantom: Even more useful than \phantom is \vphantom, which makes an invisible box whose height ...
2
votes
0answers
22 views

Does LuaTeX change the message in “Output Routines Part IV: Horizontal Techniques”?

In the excellent article "Output routines: examples and techniques Part IV: Horizontal techniques", David Salomon explores three techniques for dealing with communication from horizontal mode to the ...
25
votes
1answer
282 views

Exercise 17.21 of Knuth’s TeXbook: a (known) error?

Exercise 17.21 of The TeXbook asks a question concerning \delcode: Appendix B defines \delcode‘< so that there is a shorthand notation for angle brackets. Why do you think Appendix B doesn’t ...
2
votes
1answer
69 views

How do LaTeX macros interact with the TeX engine? [duplicate]

From wiki on LaTeX the basic requirement is to have a TeX compiler (which is used to generate output files from source), fonts, and the LaTeX macro set. Assuming I have a TeX engine and I ...
9
votes
1answer
136 views

Rearranging blocks (poetry) in OTR (Plain TeX)

I have a problem that I think would best be solved by an output routine. It seems like an act of moderate TeX wizardry so before I get stuck in the weeds on a wrong approach I thought I would describe ...
-1
votes
0answers
38 views

Display an image on Clicking a hyperlink

Is there a way we can display an image in beamer presentation upon click of a hyperlink? The beamer slide should contain a hyperlink which upon clicking, should display an image. This can be ...
2
votes
0answers
22 views

Penalty between paragraphs

How do I modify the penalty given to a pagebreak between paragraphs? I looked everywhere and could not figure out. If I really need to I can redefine \par but I'm unsatisfied with such a hack.
23
votes
1answer
1k views

Knuth “Some Implementations of TeX”…

In Appendix D of The TeXBook, p. 387, in a discussion about automatic column sizing, Knuth tantalizes us with this: Some implementations of TeX display the output as you are running, so that you ...
5
votes
1answer
64 views

TeX: Lining up three boxes

This question is really a continuation of my previous question. Basically, I'm wondering why this does not work: \hbox{\vbox{\hbox{This is}\hbox{A line}}\hfil\vbox{\hbox{And so}\hbox{Is ...
9
votes
1answer
135 views

Somewhat versatile usage of \@gobble and \@firstofone found in several macros

I was doing search about my question (see here for more detail) and found a thread commath and \ifinner. In the thread, there is a macro named \spx , the definition and usage of which are extracted ...
0
votes
0answers
74 views

Can not update packages in Tex Live Utility after installing Tex Live 2015 [duplicate]

since Tex Live 2015 was released these days, I updated it. I´m using a Mac. Now I wanted to check for package updates in the Tex Live Utility. But that does not work, unfortunately. First strange ...
7
votes
0answers
56 views

Feed fontdimen parameters to TeX

I have decided to use \fontdimen parameters as an array of numbers (to store data about Unicode Character Properties). The question now is to fill in those \fontdimen parameters in the most efficient ...
9
votes
1answer
110 views

Question about exercise 7.5 in TeXbook

Consider this extract from TeXbook: EXERCISE 7.5 Experiment with TEX to see what \string does when it is followed by an active character like ~. (Active characters behave like control ...
7
votes
1answer
37 views

What's the most plain way to define a parametrized macro within an outer macro definition

I often want to pass some arguments into a macro definition that defines an inner macro with parameters. For example \def\outmac #1,#2.{% \def\argone{#1} \def\argtwo{#2} \def\inmac ...
28
votes
1answer
612 views

What does “expanding” mean in (La)TeX?

You can often read about expanding a macro or when a macro does expand, sometimes about expansion. But what does this mean - in English?
8
votes
0answers
117 views

What type of Chomsky hierarchy is TeX?

There are four types of chomsky hierarchy (specified for formal languages): Type-0 Recursively enumerable Type-1 Context-sensitive Type-2 Context-free Type-3 Regular I consider that, it should ...
4
votes
1answer
117 views

In LaTeX, what is the most efficient way to search for an optional token in given input?

My question is inspired by this comment by Joseph Wright. Let's say we have input strings with varying character combinations, such as: ...
1
vote
1answer
29 views

Writer2Latex table border removal

I'm using Writer2Latex to convert my .odt file, created in Google Docs and downloaded as .odt format, to .tex. It works but because there is no way to create columns of text in Google Docs other than ...
4
votes
0answers
93 views

Which algorithms does (La)TeX use? [closed]

People often talk about the many "typesetting wonders" (La)TeX can do because of the countless algorithms it uses. But exactly what are these typesetting algorithms? Concrete examples I have gathered ...
4
votes
1answer
59 views

Declaring array of integers

Is it possible to declare in TeX array of integer numbers ? What I am trying to do is to declare new tabular environment for very long tables spanning accross multiple columns and (or) pages. My ...
1
vote
1answer
35 views

Comma as letter and semicolon as operator in math formulas

Inside document source2e.pdf there are the following two lines \DeclareMathSymbol{,}{\mathpunct}{letters}{"3B} \DeclareMathSymbol{;}{\mathpunct}{operators}{"3B} which treats these two punctuation ...
3
votes
2answers
73 views

Define command to act like \ifvar

I'm trying to manipulate multiple boolean variables which are simply named one, two, three, etc. and since I'm using them with a counter, I have defined some commands to take a numerical input and ...
4
votes
2answers
26 views

How to \show the code of the command \autoref? [duplicate]

Edit: I think this is a duplicate of How can I see the "implementation" of the \LaTeX command? . I wanted to see the code for the hyperref \autoref command, so created this simple document: ...
15
votes
1answer
166 views

formal syntax rules of \dimexpr \numexpr \glueexpr

After looking at various answers on the site and by looking at the documentation of e-tex, I am still wondering what is exactly allowed in the various types of expressions, i.e. \numexpr, \dimexpr and ...
1
vote
0answers
34 views

Different font style on different OS

I use gnuplot for generating eps-figs including text labels which are organized in a separate .tex-file which in turn I include in my main document. With pdflatex TexNicCenter generates the ...
2
votes
1answer
113 views

Alignment in an enumerate environment using “\hspace” and “\hphantom” commands

I give a display of the first three problems from a multiple-choice test in algebra. The choices in the first problem are displayed using a tabbing environment, and the choices in the second and third ...
7
votes
2answers
461 views

Is there a complete modern book which explains how a TeX parser works?

Hi I am reading 'The TEXbook' by Donald E. Knuth. But in my point of view is very didactic for people who want to learn TeX. Most of the pages contain exercises. But many things of how a TeX ...
10
votes
1answer
173 views

Detecting the end of line

Minimal working example: \documentclass{article} \usepackage{color} \newcommand{\mytextcolor}[2]{\textbf{1}\textcolor{#1}{#2}\textbf{2}} \begin{document} This is \mytextcolor{red}{red color} rest of ...
1
vote
1answer
27 views

Table changes distance to preceding line depending on rows

This seems to be such a simple issue, but I still have not found an answer to this question. I am using a non-float tabular environment. Depending on how many rows my table has, the distance to the ...
18
votes
3answers
836 views

What is a “Control Sequence”?

When you get an error in LaTeX, the message "Undefined control sequence" is printed. Why is it called "control sequence" and not "command", for example? How does the sequence work? Is this a TeX or ...
5
votes
1answer
93 views

Segmenting a Bezier curve into equal lengths in tikz/pgf

I'm trying to draw two curves and then create equal sized segments/arcs using pgf/tikz but for some reason the segments are not equally sized. I want to go on and fill each segment with a different ...
12
votes
4answers
346 views

Ratio arithmetic in plain TeX

I would like to calculate the ratio between two dimensions and produce a dimensionless quantity for use in further calculation in the process. I seem to be unable to do so. Specifically, I run into ...
2
votes
0answers
51 views

Where is screed.tex? [closed]

In TeX for the Impatient, Chapter 2, Page 9, it asks to try compiling screed.tex. Where is screed.tex and why did the author not explain what it is?
11
votes
3answers
268 views

Treating the contents of a TeX-style group ({\blah …}) as macro arguments

I am trying to make adjustments to a large document that uses TeX-style macros, like this: {\defun SomeFunctionName arg1 arg2} The \defun macro is defined as \newcommand{\defun}{\tt}. Can I ...
0
votes
0answers
62 views

How to go about learning to program in Tex? [duplicate]

I have been using Tex for a few years now and enjoyed the work of others (e.g., ctan packages, templates, styles). My question sees to practical code to learn from. What would be a good primer, or ...
8
votes
1answer
73 views

Is it possible to adjust the “quantization” of allowable skip lengths?

In plain TeX and derivative formats, the concept of stretchable/shrinkable length, AKA a glue or a skip or a rubber length exists, in general defined as <dimen> plus <stretch-dimen> minus ...
3
votes
1answer
65 views

TeX expert needed: how to \setto(optimal)width?

there is a problem I have been trying to solve for a while but without success so far. As far as I know, TeX is very good at appropriately breaking text lines with respect to a fixed container width. ...
2
votes
0answers
58 views

Rendering text as image to protect e-mail address

I want to protect my e-mail address against spammers by including it as image instead of a (parsable) text. Normally I would have to create the image (with text) by myself and include this as figure. ...
8
votes
5answers
337 views

A more elegant version of the \ifnot macro

A TUGboat article of 15 years ago mentions an \ifnot macro by David Kastrup whose implementation is: \def\ifnot#1{#1\else \expandafter\expandafter\fi \iffalse\iftrue\fi} However, this macro ...
14
votes
2answers
230 views

How can own commands be aware of \global?

When I define a command that defines commands \def\makefoobar{ \def\foo{foo} \def\bar{bar} } and prefix it with \global { \global\makefoobar } it is treated like { \global\def\foo{foo} ...
7
votes
1answer
136 views

How do counts differ from numexpr

To do basic arithmetic on numbers, one can utilize TeX counts, \newcount\c \c=2 \advance\c 3 \typeout{\the\c} LaTeX counters \newcounter{c} \setcounter{c}{2} \addtocounter{c}{3} \typeout{\thec} ...
1
vote
1answer
54 views

How could I write a Latex tag in source form in section name?

I tried to use \verb|| and \lstinline[language={[LaTeX]TeX}]{} and they failed. I just want to write a name of latex tags in section names for internal purposes. For example, I couldn't compile a ...
11
votes
2answers
90 views

split off function for variable as separator

How/Possible to change this implementation of \xSplit so that the separator is a variable filled in at the time of definition (\edef somehow?) or at the actual use of the command?? %based on the ...
12
votes
1answer
146 views

Inserting tokens at end of math mode

One can use \everymath and \everydisplay to insert tokens at the beginning of math mode, but what about inserting tokens at end of math mode? Lets say I want to enclose the math mode material in a ...
3
votes
2answers
117 views

Redefining line break (double backslash) for align environment

I am trying to figure out if it is possible to (locally) redefine \\ (double backslash) within amsmath's align environment. On the one hand, I'd like to be able to dynamically insert extra columns, on ...
3
votes
1answer
81 views

How to avoid typesetting any cell if a table is empty

Following How can I define a macro that adds a row to a table that has not yet been printed?, I came up with a macro (\AddToTable) that “builds” a table, i.e. appends its argument as the last row of ...
11
votes
5answers
479 views

Basics of scanning

I'm trying to master the art of scanning text one character at a time. The following is what I've discovered so far. Is this as good as it gets? I would really prefer not to do all those \edefs as ...
0
votes
0answers
20 views

widesplit macro explanation [duplicate]

Could you please explain how this macro function ? \def\widesplit#1{% \cleardoublepage \def\row##1##2{##1}% #1% \clearpage \def\row##1##2{##2}% #1% \clearpage } OK, some things are clear to me. def ...