{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
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 ...
10
votes
2answers
327 views

Starting point for getting more familiar with TeX/LaTex etc

Background: I've been using what I would call LaTex for ~4 yrs to typeset assignments, reports, essays and tutorial notes. I have been using "TexShop" (for Macs) - mostly because it was simple when I ...
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 ...
61
votes
5answers
13k 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?
15
votes
3answers
1k 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
233 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 ...
54
votes
3answers
1k 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 ...
11
votes
3answers
268 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 ...
9
votes
2answers
167 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
1answer
261 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
101 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} ...
19
votes
2answers
731 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
150 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 ...
41
votes
3answers
857 views

Why/When should I pay attention to warnings?

I often see warnings in the compilation-log of my tex-files. I searched in the internet and did not find a good answer to this question. And in my opinion there must be a reason why tex warns me about ...
7
votes
3answers
135 views

Sorting to match a given list

I am looking for ideas on the following task. I want to sort the entries in \listb to those in \lista. It cannot always be assumed that only the elements of \lista are in \listb; neither can it be ...
10
votes
1answer
132 views

How to get the natural width of the last box in a paragraph?

I want to get the natural width of the last line in a paragraph. For example, the last line of the following paragraph Georg Friedrich Bernhard Riemann (September 17, 1826 – July 20, 1866) was an ...
21
votes
2answers
3k views

How do I split a string?

I need to split a string into one or more substrings. I know that I could use the xstring package, but I'd like to do it using only inbuilt TeX/LaTeX commands. So, if I say \def\MyTeXKnowledge{Not ...
25
votes
2answers
396 views

What are lccode and uccode used for?

In TeX, each of the 256 bytes has an associated \lccode and an \uccode, integers in the range [0,255] which indicate among other things how \lowercase and \uppercase act. There are of course a bunch ...
1
vote
1answer
168 views

What Linux operating system contains patgen for hyphenation?

This question follows previous one. In TexLive, patgen command prompts error of "No such file or directory". I found at About.com that Linux contains patgen. I have Linux Red Hat 9.0 in my system. Can ...
5
votes
1answer
297 views

How to use translate_file correctly in patgen of TexLive?

This question follows previous one about use of patgen. I installed TeX Live 2011 (thanks Martin) and find patgen (version 2.4) command. According to manual, command is: patgen dictionary_file ...
11
votes
1answer
373 views

Using \toks registers

I was reading this tutorial for TeX programming: http://pgfplots.sourceforge.net/TeX-programming-notes.pdf recommended in the 2-nd answer here: Where do I start LaTeX programming? It says: ...
3
votes
1answer
78 views

Suppress output for a group

I have an \item style command where I need to be able to suppress output for the following text. I can do this with \nullfont, but that seems like a poor hack. Is there a declaration that will ...
10
votes
1answer
173 views

How to install or replace fonts in old TeX files?

I got interested in a research paper from 1991, which I cannot get an electronic online version of. The author was kind enough to send me his tex sources, but is himself unable to produce a pdf file ...
9
votes
3answers
408 views

How could the macro xii.tex be simplified into a better readable form

I was reading some TeX guides from where I have found this source: \let~\catcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdefPALLF PA''FwPA;;FPAZZFLaLPA//71F71iPAHHFLPAzzFenPASSFthP;A$$FevP ...
2
votes
1answer
74 views

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

A similar question has been already asked here, but has not been answered yet for fragile commands such as eg. \@author? What would be the right way to get detect if \author has been called with a ...
33
votes
4answers
4k 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 ...
8
votes
1answer
193 views

Why doesn't \mathord work to turn an Acc atom into Ord?

Writing ${\dot X^a}^b$ produces a very cryptic "double superscript" error: this has been explained here on this forum: the reason is that {\dot X}^a generates an Acc atom and that, for a reason that ...
4
votes
1answer
150 views

representing literal characters in a \newcommand or \def

Consider this short LaTeX document: \documentclass[11pt]{article} \usepackage[T2A]{fontenc} \usepackage[utf8]{inputenc} \usepackage[russian]{babel} \def\name{...} \begin{document} Hello: \name ...
4
votes
2answers
119 views

List of tokens from TeX mouth

Is it possible to get list of tokens which comes from TeX "mouth"? If I understand correctly: in mouth all macros, conditionals and special operations (like \the and \input) are expanded and then goes ...
2
votes
1answer
123 views

How to check if token is a macro?

I am thinking about possibility to parse LaTeX document. What I really need is to track category codes of symbols. As I understand TeX expands all of macros in his mouth and tracks changes of category ...
16
votes
2answers
1k views

When is it good practice to use \unskip

One sees in source2e the command \unskip used in various places. My understanding in general terms is that the macro is the equivalent of \ignorespacesbehind. Where would it be recommended to use ...
26
votes
5answers
821 views

When does it make sense to use TeX only and skip LaTeX?

In what applications doesn't LaTeX give you much?
23
votes
1answer
287 views

What does list mean in relation to skip? (What is David on about?)

In two previous question When is it good practice to use \unskip and What is a token? the default meaning of token in LaTeX and the behaviour of \unskip were asked. However in the first question was ...
53
votes
3answers
2k 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?
15
votes
4answers
552 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 ...
11
votes
1answer
137 views

(Re)definition of commands that use delimiters other than braces (e.g. \underbrace)

How do you go about redefining a command such as \underbrace, which uses an "uncommon" delimiter, i.e. _, between its two arguments, so that the redefined command be usable in exactly the same way as ...
14
votes
1answer
188 views

Can one determine the first character of a given math list?

I'm still pursuing my quest to code a better \widebar command. I can do bars over single characters quite well already, but I have problems when it comes to letter combinations such as AW. ...
1
vote
0answers
44 views

How to break long expressions automatically in displaymode? [duplicate]

Whenever an expression is too long, it will be broken automatically in inline mode but done nothing in displaymode E.g. MWE: \documentclass[11pt]{article} \begin{document} ...
15
votes
3answers
288 views

Parsing strings containing diacritical marks (macros?)

I apologize that this question may seem very much like several other recent ones I have asked (Parsing leading hardspaces, Parsing a \$ as part of an improved \getargs command). They are all related ...
6
votes
1answer
118 views

Macros in \special

I tried to compute a bounding box in LaTeX and pass the value on to dvisvgm via DVI specials. The resulting code (which I copy-and-pasted together from all over the internet) looked as follows: ...
5
votes
2answers
165 views

Variadic arguments macro

I am trying to make macro with variadic arguments, iterating over them. The final result is supposed to be: \foreach[x]((var = \x )){foo}{bar}{baz}\null evals to var = foo var = bar var = baz My ...
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 ...
2
votes
0answers
615 views

How to edit the LaTeX path in LyX on Windows (x64) [closed]

I was using MiKTeX 2.9 (x64) on my Win 7 machine for some time with TeXnicCenter. Now I tried to install LyX on the same PC. The problem I get is Lyx does find neither latex.exe nor sees all the other ...
6
votes
3answers
277 views

Why are some characters not allowed in command sequences

From my understanding a control sequence is ended by any non-alphabetic character such that \mycsA is one token, but \mycs1 is two tokens. This means things like starred commands \mycs* are actually ...
4
votes
3answers
217 views

How are space tokens and empty lines processed by long commands (as their potential arguments)?

How are spaces and empty lines processed by long commands (i.e., those that do not accept paragraph breaks inside)? Are there different space tokens aside from " " and an empty line? It appears that ...
5
votes
3answers
136 views

Metacommand for commands that dynamically select a parameter?

Original question I would like to create a metacommand for creating new projection commands. Specifically, \newproj{\cmd}{<n>}{<m>} should create \cmd as a new command of <n> ...
23
votes
4answers
521 views

unexpected interaction between \raggedright and \parshape

While answering Random start of line, I came upon a strange interaction between \raggedright and \parshape. If a ragged-right paragraph ends in a short line, this line will be "the most ragged". ...
11
votes
2answers
238 views

How does math mode work?

When writing an a in TeX, it is typeset as an upright "a" by default. When writing an a in math mode it is typeset in italics. Furthermore, in math mode white spaces are ignored and no empty lines ...
14
votes
1answer
200 views

Am I programmatically tieing my hands behind my back by insisting on a particular engine?

I've read Differences between LuaTeX, ConTeXt and XeTeX, but still have a niggle at the back of my mind that I'd like to ask about. I'm developing a LaTeX package/class/stuff with the aim of making ...
4
votes
2answers
2k views

How to install custom sty files where the LaTeX compiler can find them?

I created a custom beamer style. For this I have several .sty files. I am able to install this custom theme on my Ubuntu 12.04 with the standard tex-live provided distribution by putting it my home as ...