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

2
votes
0answers
46 views

Where is screed.tex? [on hold]

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?
96
votes
3answers
17k 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.
10
votes
3answers
259 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 ...
9
votes
3answers
722 views

Detecting \global, \long, \outer, \protected

Is there a way to detect whether or not the next assignment is going to be \global, \long, \outer, or \protected? That is, is it possible to write a command \detectmodifiers such that code like ...
41
votes
2answers
1k views

Can you explain how this code works?

I found this code somewhere on the TeX archives and have been puzzling over it for some time. Can anyone describe how it works? % Date: Thu, 7 Feb 91 12:20:50 -0500 %From: ...
0
votes
0answers
60 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 ...
3
votes
1answer
60 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. ...
8
votes
1answer
64 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 ...
0
votes
0answers
26 views

Stack Exchange latex equations how [migrated]

What are the , sorry my terminology may be of, latex 'tags' used on this site? E.g. on TeXworks on my pc its \( to open and \) to close. its \begin{equation} to open and \end{equation} to have an ...
2
votes
0answers
50 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
315 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
220 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} ...
11
votes
2answers
84 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 ...
6
votes
1answer
92 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
44 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 ...
35
votes
5answers
5k 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 ...
8
votes
3answers
255 views

Questions on macro writing in TeX to modify an existing style file: fancybox.sty

I've decided that I must become more adept at TeX if I'm to become proficient with LaTeX. While this is probably obvious to most readers who pass by, my ability to muddle through has hidden this small ...
12
votes
1answer
143 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
97 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 ...
10
votes
1answer
93 views

assign penalty to one discretionary (not all paragraph)

For a quite complex problem that would be too long to describe, I need to set different penalties for different discretionaries in the same paragraphe. It doesn't seem to be possible with pdfTeX (and ...
31
votes
1answer
985 views

What do different \fontdimen<num> mean

I know that \fontdimen<num> returns some dimensions associated with the current font. What are they?
11
votes
5answers
464 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 ...
3
votes
1answer
74 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 ...
0
votes
0answers
19 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 ...
25
votes
5answers
789 views

Most efficient way to reverse a token list (tail recursion)

Goal: reverse a list of characters, going from \def\mylist{abcdefgh} to \def\mylist{hgfedcba}. This is easy using a marker which does not appear in the list, such as \relax: \def\mylist{abcdefgh} ...
8
votes
3answers
110 views

Appending active and expansion sensitive characters to a macro

This question comes up pretty often when people want to build tables with empty columns or similarly building up some active characters inside a macro hoping to expand them at the right time right ...
25
votes
4answers
1k views

Display hyphenation options for a specific word

When TeX produces Overfull box, is puts something like this in the log: Overfull \hbox (15.47195pt too wide) in paragraph at lines 7--9 []\OT1/cmr/m/n/10 I re-ally re-ally want to get dis-played the ...
3
votes
2answers
478 views

how do you put caption on figures in sweave

I have this sweave code. I need to add caption to the figures. I am doing this but it looks like I see the figure before the section{Data ANALYSIS}: \documentclass[letter,12pt]{article} ...
19
votes
2answers
409 views

\expandafter and \aftergroup: where do the 2n+1 and n^2-1 rules come from?

Both TeX primitives \expandafter and \aftergroup have "rules of thumb" stating that \expandafter should be used 2n+1 times to look n tokens ahead (is this correct?). A similar "rule of thumb" holds ...
12
votes
3answers
593 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 ...
42
votes
3answers
64k 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. ...
1
vote
0answers
73 views

Memory overload due to pgfplots / tikz

first of all, I need to mention that there are 2 related threads, that I found usefull: 1, 2. I am working with TeXstudio 2.8.8 on Win 7 64bit (i5 @3.3GHz, 8GB RAM - if this matters). My goal is to ...
88
votes
7answers
23k 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?
1
vote
1answer
54 views

Passing values from PythonTeX to LaTeX

I have read in the PythonTeX manual about how to pass LaTeX values to PythonTeX, but I cannot find any documentation (or a way) to do the reverse. For example, in the LaTeX package datenumber, one ...
3
votes
1answer
44 views

Specifying coordinates with \def in PSTricks

I'm starting with PSTricks. I use the following macro to set cartesian coordinates: \def\newPoint#1(#2,#3) { \expandafter\def\csname x#1\endcsname{#2} \expandafter\def\csname ...
149
votes
23answers
7k 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 ...
19
votes
1answer
376 views

How do I get into XeTeX development?

The support for OpenType fonts has been a great advancement in terms of usability. Unfortunately the microtype package does not offer font expansion for OpenType fonts in XeTeX. I dug a little ...
0
votes
0answers
76 views

TeX capacity exceeded, sorry [input stack size=5000]

I am trying to compile the first three chapters of my dissertation but I am getting the following error: Errors: ./EQM-TAR.tex:70: Undefined control sequence. [\paginaresumo] ./EQM-TAR.tex:70: TeX ...
13
votes
3answers
709 views

How to get the catcode of a token?

For debugging a complicated macro I would like to print out the catcode of a token. Optimally I would like to have a macro \getcatcode such that, for example, \getcatcode{a} would expand to 10. How ...
7
votes
1answer
156 views

What does mathchar do?

The package cmll defines \with (looks like '&') as $ texdef -t latex -p cmll with \with: \mathchar"2026 \the\with: 8230 When I take a look at \& it is defined as texdef -t latex \& ...
1
vote
0answers
68 views

What is the core of TeX as a programming language? [closed]

Tex (and LaTeX) mix programming elements with typesetting ones. It's often confusing to a beginner to tell them apart. Could anyone show me a list of the very core commands of TeX (and perhaps LaTeX) ...
24
votes
7answers
2k views

Are there purely expandable variants of \MakeUppercase?

\MakeUppercase and \uppercase use TeX's uccode, and they are not purely expandable. Say, \edef\temp{\MakeUppercase{abc}} will fail. Sometimes purely expandable macros are very useful. They are ...
4
votes
2answers
110 views

plain TeX error. Undefined control sequence. \pgfutil@

I'm trying to compile the fix mentioned by egreg in this thread: Strange behaviour with PGF/TikZ and Plain TeX output routine Here's the code: \input pgf \catcode`@=11 \newbox\pgfutil@@Output@Box ...
11
votes
1answer
141 views

Why this output using \string on the empty csname

How does this exactly work? \expandafter\string\csname\endcsname I don't know what I would expect to come from there, but definitely not \csname\endcsname_ where _ is a space. I thought ...
12
votes
2answers
217 views

Assertions in Latex

I am writing a long latex document and use many macros for defining mathematical symbols. I would like to ensure that there is no clash in the notation. For example, something like ...
3
votes
0answers
60 views

plain TeX and paragraphed notes

The TeXbook proposes, p. 398sq, a system to obtain paragraphed note. That is, instead to obtain Footnote. Footnote. Footnote obtain : Footnote 2. Footnote 3. Footnote. In ...
7
votes
1answer
240 views

What is this file and how to compile and tranform it?

I was given some files to update. They were produced in late 1990s and seemed to be related to LaTeX. However, I could not compile them at all. To begin with, there is no \begin{} or \end{}. In ...
2
votes
1answer
71 views

Redefine a primitive parameter

I want to redefine a primitive parameter as a macro, and make the macro behaves the same as the primitive parameter in some situations. \tracingcommands = 1 \the\tracingcommands ...
6
votes
1answer
73 views

An insert macro

Once in a while I try to understand how TeX works... Hitherto now success, but sometimes I manage to define a macro. For example, \def\appendto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}% ...
1
vote
1answer
111 views

Can openout handle a filename with spaces?

With pdflatex, can \openout handle a filename with a space in it? (We're using MiKTeX and our users seem to think it's clunky to restrict them in this way. We also have tons of legacy TeX files and ...