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
251 votes
3 answers
64k views

What is the difference between \let and \def?

What is the difference between the \let and \def commands in TeX/LaTeX? Ideally please provide a simple example that will illustrate the difference between them.
user avatar
  • 9,804
244 votes
9 answers
107k views

What is the difference between TeX and LaTeX?

I know LaTeX and I've heard that LaTeX is a set of macros in TeX. But what does it exactly mean?
user avatar
  • 8,153
214 votes
5 answers
59k views

When to use \edef, \noexpand, and \expandafter?

I'm quite happy hacking TeX macros and cobbling together bits and pieces from different style files to suit my own ends, but I have a suspicion that my resulting hacks are not quite as elegant as they ...
user avatar
193 votes
23 answers
12k views

Are there any open research problems in the world of TeX?

For a year-long capstone project in computer science, I have to do some 'original research.' I'm still not entirely sure what this entails, but it just struck me that perhaps I can do research and ...
193 votes
10 answers
24k views

Why is LaTeX so complicated? [closed]

I have been using LaTeX professionally almost every day for almost 10 years, so I think I can say that, by now, I more or less know what I'm doing. I also do a lot of ordinary computer programming, in ...
user avatar
  • 10.4k
189 votes
6 answers
49k views

What exactly do \csname and \endcsname do?

What exactly do \csname and \endcsname do? What are their job? I have glanced at the Texbook and some other books, but none of them was clear enough to me. Can anyone please give a simple example to ...
user avatar
188 votes
5 answers
446k views

Escape character in LaTeX

I need to output the below text but since \ is a special character, I cannot: [RegularExpression(@"\d+")] Also sometimes I need use dollar sign $ as well but it seems to be a special char, too. ...
user avatar
  • 3,837
171 votes
4 answers
538k views

\vspace vs. \vskip [duplicate]

What is the difference between \vspace{-1em} and \vskip -1em, for example? I guess the first is LaTeX, and the latter is TeX. When is the proper time to use one and not the other, and why?
user avatar
  • 3,541
163 votes
10 answers
124k views

How to expand TeX's "main memory size"? (pgfplots memory overload)

I'm compiling one pretty simple LaTeX file with few dozen of pgfplots. Now, I can compile part by part, but am unable to compile it all at once. I really need good precision for all those plots (noise ...
user avatar
154 votes
2 answers
29k views

What are penalties and which ones are defined?

Very often you can find solutions by changing the penalty. One is widowpenalty. However what are penalties and is there a small list of every defined penalty. There is a German site which does ...
user avatar
  • 93.1k
138 votes
8 answers
34k views

Why are there no alternatives to TeX, or, why is TeX still used? [closed]

I'm fairly new to TeX and LaTeX, having been drawn in by the Big Idea — creating a document programmatically. However, my experience of TeX (and its libraries — LaTeX, ConTeXt, …) has been almost ...
user avatar
  • 2,411
135 votes
2 answers
49k views

When should one use \begingroup instead of \bgroup?

Is there ever a case when the use of \begingroup is preferred to \bgroup? Obviously, \bgroup is necessary in cases where you need to have balanced braces and thus cannot use {, but when is it ...
user avatar
  • 60k
130 votes
3 answers
12k views

What is the difference between \relax and {}?

As I understand it, the point of \relax is to stop a macro from swallowing up subsequent material (such as whitespace). But {} (\bgroup\egroup) serves the same function. Why do we need both?
user avatar
  • 15.4k
119 votes
4 answers
52k views

How to check if a macro value is empty or will not create text with plain TeX conditionals?

I have a macro which holds some text value, e.g. \macro{some text}. If it is empty, I would like for nothing to appear in the document, but it has some content of any kind which would produce text ...
user avatar
  • 12.5k
110 votes
2 answers
17k views

The differences between TeX engines

I am confused about what TeX and its offspring (LaTeX, pdfTeX/pdfLaTeX, e-TeX, ConTeXt, LuaTeX, etc.) are. Some, like LaTeX, seem like add ons to TeX (maybe a change to the eyes and mouth, but not ...
103 votes
4 answers
18k views

Are there any dangerous commands in LaTeX?

I encountered this question: What is the most dangerous command in SQL?. And a similar one came to my mind, Are there any dangerous commands in LaTeX? By dangerous we may mean any or all of these ...
user avatar
  • 16.9k
102 votes
5 answers
13k views

Is there a BNF grammar of the TeX language?

I'm looking for a BNF grammar of the TeX language, does it exist? EDIT For those of us who are not computer scientists, a BNF grammar is one kind of formal description of a CFG: Backus Naur Form. ...
user avatar
  • 1,123
92 votes
9 answers
8k views

What research papers exist about TeX and friends?

Some time ago there was a question on this site Are there any open research problems in the world of TeX? In a similar spirit, I'd like to ask, whether there are any research articles out there in ...
user avatar
89 votes
3 answers
38k views

Difference between \if and \ifx

I try to understand the subtleties of TeX programming, but it is not always easy. For example, in the following code : \def\first{abc} \def\second{abc} \ifx\first\second OK!\else false \fi I ...
user avatar
  • 3,482
88 votes
4 answers
27k views

What is the difference between 'fil' and 'fill'?

TeX provides the commands \vfil and \vfill (and their corresponding horizontal versions \hfil and \hfill). These commands are actually defined as: \vskip 0cm plus 1fil \vskip 0cm plus 1fill where '...
user avatar
  • 203k
87 votes
1 answer
9k 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 ...
user avatar
  • 56.7k
86 votes
2 answers
12k views

What's new in TeX, version 3.14159265?

The new Knuth TeX has been released in early this month, and its version number is 3.14159265 now. It can be downloaded here. What's new in this release? And a further-more question, where can one ...
user avatar
  • 1,079
83 votes
2 answers
35k views

What does \relax do? [duplicate]

Possible Duplicate: What is the difference between \relax and {}? The title suggest the question. On and off, I see macros here in TeX.SE and I see the \relax command frequently. I was ...
user avatar
  • 7,079
81 votes
3 answers
3k views

Why isn't everything expandable?

TeX's macro processor does its work in a process called expansion. For an input stream of tokens, the macro processor repeatedly expands them until non-expandable tokens remain. The resulting stream ...
user avatar
80 votes
1 answer
3k views

A LaTeX log analyzer application (visualizing TeX expansion)

This question led to a new package: unravel Consider the following MWE, test.tex: \documentclass[12pt]{article} \begin{document} \tracingassigns=1 \tracingmacros=1 \def\aaa{something} \def\bbb{...
user avatar
  • 16.5k
77 votes
4 answers
18k views

What is the difference between \let and \edef?

When you write \edef\a{\b} \let\a\b the results are often identical. What is the difference between these two commands? When do they behave the same? When do they not? (The question isn't for me; ...
user avatar
75 votes
4 answers
3k views

Advantages and disadvantages of fully expandable macros

As I currently understand them, fully-expandable macros are analogous to pure/effect-free functions in functional programming. Correspondingly, things that are not expandable, such as \def, are ...
user avatar
75 votes
4 answers
6k views

What is a token?

Please forgive such a basic question, but I did some Google searching and looked around on this site, and while there are many threads and online resources that involve tokens, I can't seem to find a ...
user avatar
  • 5,356
74 votes
9 answers
9k views

Are there any disadvantages of TeX being Turing complete?

I have read that TeX is Turing complete. I was wondering if making TeX Turing complete gave raise to unwanted effects.
user avatar
  • 4,915
72 votes
4 answers
7k views

What is "expansion"?

I'm relatively new to (La)TeX, but I have a reasonable amount of experience with computational programming languages. Until I began learning (La)TeX, I'd never heard of "expansion"... So, what is "...
user avatar
71 votes
4 answers
8k views

What are category codes?

Following on from this question, I'd like to ask a more general question: What are category codes, and what can I achieve by changing them?
user avatar
  • 70.5k
71 votes
1 answer
4k views

What are the incompatibilities of pdftex, xetex and luatex?

[Please correct me if my statements are wrong] TL;DR: pdftex, xetex and luatex exhibit different behaviour. What are these differences and why are they present. I know of three engines, which ...
user avatar
70 votes
10 answers
12k views

What is the best way to learn TeX?

As opposed to LaTeX, which is addressed in another question. Most of the references I've seen get too complex too quickly. I'm looking for something that gives me a top-down view of the language - ...
user avatar
  • 3,453
68 votes
5 answers
6k views

What are TeX and LaTeX?

I'm surprised no one else has asked this question. It's not explained very well in the FAQ or site descriptions either. I know many of you will think "LMGTFY", "RTFM", or "ask wikipedia", but I'd ...
67 votes
6 answers
27k views

How to form "if ... or ... then" conditionals in TeX?

I feel really stupid for asking this, but how do you form more complex if conditionals in TeX? I'm looking for something like: \ifnum\x=1 OR \ifnum\x=14 {do this} \else {do that} \fi I don't ...
user avatar
  • 16.4k
66 votes
5 answers
17k views

Should I read Donald Knuth's The TeXbook?

I've been using LaTeX for about a year or two as part of writing reports in university and want to gain a more in-depth understanding of how it works (I'm a computer science student). Would Donald ...
64 votes
5 answers
4k views

\let\foo\bar vs \let\foo=\bar (let with equals sign)

Both uses of the \let primitive often lead to the same result. Is this even true for every case? What was the thought process behind it. And if they are actually not equivalent, are there particular ...
user avatar
  • 13.1k
64 votes
2 answers
2k 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. ...
user avatar
  • 755
64 votes
1 answer
9k views

Is it \catcode or \catcode`?

I've noticed that \catcode is poorly documented in the TeXbook. The primitive is defined as \catcode but every time it is used, it is used as \catcode` ... the backquote is never discussed. ` itself ...
user avatar
63 votes
4 answers
9k 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?
user avatar
  • 1,502
62 votes
2 answers
9k views

What is the basic mechanism for writing something to an aux file?

I am interested in the basic mechanism behind writing stuff to the .aux file. (Or some other auxiliary file). Let's say I want to write myself a basic package for making notes on my files. (I know ...
user avatar
  • 70.5k
61 votes
5 answers
4k views

Typesetting limitations of LaTeX

What are the typesetting limitations of LaTeX? In other words what are the things that desktop publishing and word processing programs do better than LaTeX? I am not really interested in things that ...
user avatar
  • 19.9k
61 votes
5 answers
12k 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?
user avatar
60 votes
1 answer
7k views

What do different \fontdimen<num> mean

I know that \fontdimen<num> returns some dimensions associated with the current font. What are they?
user avatar
  • 49.2k
60 votes
3 answers
8k 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 ...
user avatar
  • 36.1k
59 votes
2 answers
10k views

Is there a \show for lengths?

The \show command is extremely useful for figuring out what's going on with a particular macro. Similarly, using \the can tell me the value of a counter. I'd like to know if there's something ...
user avatar
56 votes
5 answers
10k views

Confused with TeX terminology: height, depth, width

The LaTeX reference card states for example \strut box w/ ht and depth of “(”, zero width I came to see text as a two dimensional feature, but I must be missing out on something... (following was ...
user avatar
56 votes
3 answers
4k 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 ...
user avatar
56 votes
1 answer
31k 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 ...
user avatar
55 votes
2 answers
9k views

What language is TeX implemented in?

I read on Wikipedia that the first version of TeX was written in SAIL. However, does anyone know what language later versions (i.e the current one) are implemented in?
user avatar

1
2 3 4 5
37