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

3
votes
1answer
219 views

Tex Custom Arrow with oplus symbol

I'd like to create the kind of arrow that shows inner classes in UML, that is, an arrow that starts with an \oplus symbol as it can be seen here: ...
6
votes
0answers
124 views

Replace paragraphs with boxes [closed]

I would like to replace the paragraphs of a compiled document with framed boxes. Although I read the /tex/latex/base documentations I have no idea how to tackle this problem. In detail I want to ...
22
votes
2answers
411 views

Will LaTeX work on any TeX?

As I understand it, latex is simply a macro package for tex, as in tex the program, not the format. (Again, weird, but I understand LaTeX to be a format of TeX.) Does this imply that LaTeX the ...
10
votes
1answer
208 views

How can latex and pdflatex be both symbolic links to same executable (pdftex) and not behave the same?

When I run $ latex my_doc.tex and $ pdflatex my_doc.tex it works, and when I run $ pdftex my_doc.tex it doesn't work. The thing is I noticed that both LaTeX and pdflatex commands are ...
2
votes
0answers
114 views

How to generate an AFP document by using LaTeX compiler? [closed]

I'm working on a new program who have to generate an AFP file. I would like to generate this kind of file by using a powerful language like LaTeX. Because I hate Dialog (HP solution), is there a ...
13
votes
1answer
193 views

What practices are there regarding the use or avoidance of “internal” TeX or LaTeX commands?

What practices are there regarding the use or avoidance of "internal" TeX or LaTeX commands? (About "command" vs "macro", there is some discussion in this TeX.SX answer, though I don't know whether ...
11
votes
1answer
240 views

TeX capacity exceeded, sorry [semantic nest size=500]

Reading through tex.web, I note that there is a difference between grouping levels and semantic nesting (i.e., the nesting of math, horizontal, and vertical modes). I can think of commands which ...
29
votes
1answer
1k views

How to generate “You can't use \unskip in vertical mode”?

We all know (or believe so) that \unskip is not possible in main vertical mode and this statement can be found in various answers on the site. And yes LaTeX does a lot of gymnastics in \addvspace or ...
4
votes
1answer
193 views

How to make a rich png image from a Latex Math Equation [duplicate]

I have a LaTeX math equation that I have been trying to convert it into a rich .png image by compiling the .tex file into .dvi and then from .dvi to .png. But I noticed that the Image is small and the ...
3
votes
1answer
98 views

Hook tex macro without altering tokens stream

Is is possible to hook a macro with function which writes some info to file or log without altering stream which creates dvi file. For example if i have macro definition \def\foo{\mathop{A}} and i ...
9
votes
1answer
110 views

Interactively look up macro definitions

In a TeX document, the primitive command \show will print out the current definition of a macro one level deep (it won't (and can't?) reduce to primitives). This comes with the restriction of actually ...
2
votes
1answer
465 views

How to convert an A5 document (PS or PDF) to an A4 document (PDF)?

I have a document with A5 pages (created from a TeX file) and want to combine pairs of A5 pages to A4 pages. That is, without scaling, page 1 and 2 of the A5 document should become page 1 of the A4 ...
16
votes
2answers
295 views

Use of \everyeof and \endlinechar with \scantokens

The e-TeX \scantokens primitive allows retokenization of input. However, it is almost always used in a group where \everyeof and \endlinechar are set (see for example Can I convert a string to catcode ...
16
votes
3answers
268 views

Can I convert a string to catcode 11?

In the TeX FAQ there's a way to test if the jobname is equal to something (comparing the jobname). The difficulty of the naïve test is that the contents of the \jobname primitive are catcode 12 so to ...
18
votes
1answer
306 views

Drawbacks of redefining math accents with extra leading {}?

As I discovered through the non-bug latex/4253, TeX has a (mis)feature whereby it ignores braces around a \mathaccent construction: ${a_b}_c$ works, but ${\tilde a_b}_c$ fails with a "Double ...
7
votes
1answer
431 views

Is there likely to be an xpsTeX?

The 2007 TUG April Fools' announcement was pretty funny, but does this idea have any traction whatsoever? From a design point of view, XPS may be the starting point for future document formats beyond ...
12
votes
2answers
157 views

What would be a suitable replacement for ifcsname in a non-etex situation?

From the pgfkeys.code.tex file: % This is useful: \def\pgfkeys@ifcsname#1\endcsname#2\else#3\fi{\expandafter\ifx\csname#1\endcsnam e\relax#3\else#2\fi}% \ifx\eTeXrevision\undefined% \else% ...
13
votes
2answers
554 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, ...
32
votes
3answers
773 views

Why doesn't TikZ's \foreach iterate over the last element of the list?

This code \documentclass{report} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[dashed] (1,-1) -- (1,2) node[above] {$1$}; \draw[dashed] (2,-1) -- (2,2) node[above] {$2$}; \foreach ...
54
votes
3answers
3k views

2013, year of the TeX bugs report. Will pdfTeX, XeTeX, etc. be changed accordingly?

Barbara Beeton said (TUGboat vol. 34, pag. 4): As noted on Don Knuth's TeX web pages, www-cs-faculty.stanford.edu/~knuth/abcde.html, he "intend[s] to check on purported bugs again in the ...
11
votes
4answers
191 views

Partially expanding a command

My \john command is defined like so: \def\john{\DontExpandMe} I would now like to repeatedly change its definition, to keep adding some extra stuff on the front. \foreach\i in {ape,bat,cow,dog} { ...
54
votes
2answers
1k views

If LaTeX is only a macro package, why does it have its own executable?

From other answers on this site and the FAQ of the TeX User Group my understanding is that: TeX is the original typesetting program, written by Knuth Omega, eTeX, pdfTeX, XeTeX, LuaTeX are engines. ...
17
votes
1answer
135 views

What primitives can expandably tell us about the current horizontal list?

I've been writing some code that expands macros and catches characters and non-expandable primitives as they reach TeX's stomach, and I encountered an issue: since I gather letters one by one, with ...
8
votes
2answers
724 views

Highlighting haskell listings in large *.tex document [duplicate]

Suppose, there is a large *.tex document, which has many nested \input directives with many Haskell listings surrounded by \begin{code} \end{code} commands. How can all this code listings be ...
7
votes
1answer
605 views

TeX ignores \vskip at the beginning of document

Here is a simple Plain TeX snippet for demonstration \vskip 3in Aaaaa \vskip 3in Bbbbb \end When I compile this with pdftex, I expect to see a 3-inch-high blank space, then Aaaaa, followed by ...
6
votes
2answers
247 views

Learning how to use TeX for automatic layout of non-technical documents

Whenever I try to learn more about TeX or LaTeX, I am stymied by the general bias of the books and online resources I have seen, and possibly by the bias of LaTeX itself. I am not interested in using ...
7
votes
0answers
86 views

What is the difference between \def and \newcommand (Part II)? [duplicate]

A previous question What is the difference between \def and \newcommand? has discussed the difference between \def and \newcommand at some length. However, I cannot find in that discussion an ...
41
votes
1answer
916 views

On the basics of writing to & reading from auxiliary files (.aux, .toc, etc.)

Some actions (such as generating the Table of Contents) require two passes of the TeX compiler: during the first pass, some data get written to an auxiliary file, only to be retrieved during the ...
13
votes
5answers
284 views

Checking if a string contains # with its original catcode

At comp.text.tex the following scheme was suggested for testing if a string contains the parameter character with catcode 6. \def\endcheck{\endcheck} \def\second#1#2{#2} ...
8
votes
2answers
128 views

\setbox containing maths interferes with surrounding math mode in XeTeX

I encountered what might be a bug in XeTeX (but I would be glad to be proven wrong) while chasing a strange interaction between bytefield, unicode-math, and mathtools. In general, I do not expect a ...
44
votes
3answers
1k views

Why no vertical-mode Knuth-Plass?

I have only basic knowledge of the TeX internals, so I hope what I am saying here is not complete nonsense. If I understand correctly, in TeX, horizontal positioning / line breaking is done using a ...
7
votes
2answers
195 views

Stupid error caused by doing stupid things

When I was writing my thesis I wrote the following two commands which I found useful (and still do). They are both ways of defining other commands. \usepackage{ifthen} \makeatletter \def\optional ...
7
votes
2answers
137 views

Why does TeX attempt to insert 'missing' tokens?

"Missing \cr inserted", but it looks to me like it's already there! Missing $ inserted ... Why does TeX attempt to insert missing tokens? Why doesn't it simply throw up and die? ...
3
votes
0answers
252 views

What is a working python code snippet for escaping a string, so that it can be included in a tex file? [closed]

I'm using python to populate a tex template with arbitrary strings - and I would like to escape the strings so they're interpreted and displayed properly inside the tex file (rather than having them ...
5
votes
1answer
41 views

How to use tangle to merge to get a single merged file from original source and change files

I'm trying to read and understand the TeX source, but it is difficult to keep track of when I should be reading code from the original file and when I should be reading code from the change file. I ...
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⟩’. [...] ...
7
votes
3answers
826 views

How do I get the width of \hfill?

In my LaTeX document, I have a first line with a given spacing obtained using \hfill, then a paragraph, and then a third line in which I would like to use the same spacing as in the first line. The ...
3
votes
1answer
69 views

TeX document allowing any byte sequence being inserted

Out of a hacker's interest, I looked for a TeX document into which an arbitrary byte sequence can be inserted without causing the TeX process to fail, but had a similar issue; I basically set all ...
19
votes
2answers
444 views

Outright impossible TeX byte sequence

Out of a hacker's interest, I am wondering if there is any byte sequence that can never occur in any valid TeX document before \end is processed. I thought of things like {\catcode`}=9\catcode`\=9 ...
1
vote
0answers
47 views

Errors after TeX Live 2012 update on Ubuntu 12.04 [duplicate]

I wanted to use mdframed package but I was getting the error package not found. I followed the advice here to update to Text Live 2011. However, I figured out there is Tex Live 2012 and therefore ...
3
votes
3answers
201 views

How exactly are TeX and LaTeX related? [duplicate]

I know that plain TeX is the low-level typographical language that describes nearly every aspect of presentation, taking care of things like paragraph breaks, new pages, and the like. I know (well, ...
17
votes
3answers
2k views

How to compile the source code of TeX

I am more and more interested in the system TeX (and LaTeX) and I want to study it more deeply. I am not telling that I want to learn how to use it, but I want to understand its mechanism now. The ...
7
votes
1answer
314 views

\pdfstrcmp or \strcmp in pure TeX

I'm trying to get LaTeX3 working with an old e-TeX kernel, and it fails due to the lack of \pdfstrcmp (or XeTeX's \strcmp equivalent). Is there a pure TeX definition of \pdfstrcmp that I could insert ...
45
votes
2answers
2k views

Electronic version of Knuth's “TeXbook”?

I have a printed copy of the TeXbook (from D.E. Knuth) at home. Now that I travel a lot, I don't want to take my library with me every time. Question: Is there a legal way to obtain (=purchase) a PDF ...
11
votes
3answers
317 views

Understanding etoolbox \ifdefempty and \ifdefvoid

I am trying to understand the etoolbox \ifdefempty and \ifdefvoid macros. The documentation says that \ifdefempty Expands to true if the control sequence is defined and is a parameterless macro ...
10
votes
2answers
213 views

Determining the math class of a non-keyboard symbol

What is the "right" way of determining the math class (e.g. ordinary/0, relation/3, closing/5, etc.) of a non-keyboard symbol? Something like \oplus is easy enough to guess, but I wasn't immediately ...
6
votes
2answers
325 views

How to not have widows and orphans without using raggedbottom

I know I can set \clubpenalty and \widowpenalty to 10 000 to make them “really bad”, but then TeX sees it equally bad to cut the page short when there is no vertical stretch (i.e. \parskip=0pt), and ...
4
votes
2answers
130 views

Change display style in xlop package

I recently discovered the package xlop to typeset automatically elementary school calculations. Using this for division for example like this, gives the output below. \documentclass{article} ...
20
votes
2answers
903 views

TeX's algorithms for “breaking paragraph into lines” and “setting the glue”

I want to learn more about the implementation of TeX's text-justification algorithm (setting the glue). After scanning through ch.12 of Knuth's TeXbook, I'm guessing that setting the glue must ...
7
votes
2answers
157 views

Deleting an element from a comma separated list

In this answer we learnt how to remove the n-th element from a comma-separated list. How can I remove an element from a list by its value, rather than its position? For example: if my global variable ...