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

10
votes
2answers
238 views

Catcode of \endlinechar when its charcode is less than 1

When \endlinechar is less than 1, how do we access its catcode? The following gives the error shown below: ! Bad character code (-1). l.34 ...ndlinechar\string=\the\catcode\endlinechar ...
11
votes
1answer
170 views

Array functionality in TeX?

I've been using LaTeX for a while, but only recently I made myself a mission to create a class. I needed to learn the details of TeX, and I couldn't find answers to some of my questions. One of them ...
6
votes
2answers
1k views

Resize all images in Latex to a percentage width

I am auto-generating multiple tex files using pandoc (one tex file for each of my chapters). Pandoc generates this tex code for each image. \begin{figure}[htbp] \centering ...
3
votes
0answers
246 views

What makes TeX so easy to write? [closed]

I have tried various different markup/markdown languages and have found myself coming back to TeX for the ease of typing. I have always wondered what are the features which make TeX such an ...
17
votes
1answer
620 views

How does TeX actually work?

Lots of useful information for human beings, especially in academia. But, what is actually underlying the TeX engine? How does it really work? Does it parse everything and just put the stuff together? ...
7
votes
1answer
255 views

Storing unexpanded macro definitions (including #1, #2, …) for later use (now includes full usecase)

Preliminary Info I'm working on a new LaTeX package to make scoping more flexible. To do this I'll be capturing and reintroducing user defined commands behind the scenes. (For a comprehensive ...
5
votes
0answers
182 views

How would (La)TeX be different if it had been created recently? [closed]

If Knuth/Lamport/anyone else had created a typesetting system with the flexibility and power of TeX, using everything we have learned about computation and programming languages in the last 35 years, ...
2
votes
1answer
2k views

0: file ended while scanning use of \@genfrac [closed]

The code is here \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} \begin{array}{ll} \hat{\mu_1}&=\dfrac{\sum_{i=1}^nX_{i,1}}{n}\\ ...
5
votes
3answers
224 views

Possible CSS type features?

Hi I am doing a project for my 10th grade Graphic design class and we have to make up an inspirational type thing with the emotion words Bold, in a bigger size and capitalized and I was wondering if ...
3
votes
1answer
86 views

cut an \insert too long and leave the next parts

My problem is in Plain TeX. I have made a minimal example to explain it: \newinsert\example \count\example=1000 \dimen\example=1ex \insert\example{ "Lorem ipsum dolor sit amet, consectetur ...
5
votes
2answers
696 views

Most useful LaTex -macros? Help me to understand a statement with `\[p][s][frac|mat]`

I want to understand the below, source here. I am studying material related to real-time-Texing like here. As for fractions and matrices, I prefer using LaTeX macros instead of snippets. The most ...
3
votes
1answer
249 views

Error message and newline

In the following, why is the exclamation mark (!) repeated in the error message? \def\error#1#2{% \begingroup \errhelp{#2}% \errmessage{^^J! package Error: #1^^J}% \endgroup } \error{Stop ...
5
votes
1answer
111 views

Macro which creates another macro with custom name

I want to create a macro \foo which creates another macro which a custom name set just before the execution of \foo via a macro \defcommand{myCustomName} and saves/adds something to it just as the ...
13
votes
1answer
506 views

uppercase and \spacefactor

Apparently, \uppercase forgets about the \spacefactor at the end. For example, {What is the spacefactor?} \the\spacefactor. returns What is the spacefactor? 3000. while \uppercase{What is ...
6
votes
1answer
163 views

Arbitrary text parsing from a separate file

I'm still very new to the world of TeX, so please bear with me if this question is unclear or has been asked before. I'm starting to figure my way through TeX and the millions of plugins and ...
5
votes
2answers
274 views

Boolean based environments

I know that this question is basically identical to that of Hide custom environment content based on boolean Except I want to avoid using the environ package, which, otherwise, would be the best ...
4
votes
1answer
214 views

Math font change for subscript only

Goal: I want a macro that changes the math font of only subscript and superscript. In TeX terms, I think this means I want to change only S, S' styles, which are typeset using scriptfont. ...
11
votes
1answer
476 views

Consume/absorb a token

How does consume/absorb/remove a token from then token stream in TeX? I'm using @ifnextchar and would like to remove the character it matches.
11
votes
1answer
128 views

Begin/end a logical block?

Can I create a logical block (like HTML div element), so I can apply features like \centering locally, but not affect the outside environment?
22
votes
3answers
428 views

Making a zip macro

In functional languages, there often is a function called zip, which can be handy in many situations; for example in ruby, one can say: %w(a b c).zip(%w(d e f)) to get an array of arrays [["a", ...
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. ...
25
votes
1answer
485 views

What exactly is a “single character” or “symbol” in math mode?

There are at least three instances where single symbols in math mode receive a special treatment by the TeX engine: 1. when accents are placed, 2. when a math operator is created with ...
5
votes
1answer
115 views

Gobble every occurrence of \mypath../

Is there a neat way to remove all instances of the text \mypath../ from the input, using TeX's text processing capabilities? The ifthen approach below works, but seems to be a bit heavyweight. Also, ...
43
votes
5answers
2k 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 ...
6
votes
2answers
278 views

\read: trailing spaces are removed

I'm trying to copy a (binary) file with LaTeX (mostly for the sake of it), but when I read a line, the trailing spaces are removed. The MWE, based on this TeX.SX answer: \edef\infile{infile} ...
2
votes
1answer
91 views

How to get \marks with longtable?

I'm using longtable and trying to use \marks. So far I've got no luck. MWE: \documentclass[a5paper,pagesize]{scrartcl} \usepackage{longtable} \usepackage{scrpage2} ...
13
votes
1answer
211 views

How to find out if a math list consists of a single character?

When accents are placed, the TeX engine gives single characters a special treatment; see the TeXbook, Rule 12 on page 443. See also this question and its accepted answer for details. Thus, ...
11
votes
1answer
135 views

How many different concepts of “token equivalence” are there in TeX?

I was living in the delusion that the "token equality" tested by \ifx was the only thing you need to remember about this subject, but this week I learned otherwise (thanks to David Carlisle). Now ...
6
votes
2answers
239 views

\dimexpr gives 0pt

Why on earth does the following expression give me 0.0pt? \edef\x{\the\dimexpr 3ex-1ex\relax} I assume ex is a LaTeX unit, as it isn't in the TeXbook. Please where is it defined in the kernel? ...
14
votes
1answer
669 views

How to transpose a table in expl3

I've been very impressed with xparse and expl3, and have written a wonderful document command using \ProcessList that takes a comma separated list and turns it into a (basically) 1 column table. ...
21
votes
7answers
370 views

Fully robust way to access the first item in a token list (expandably)

Given a token list such as \a\b\c or {ab}c, I define the first item to be what \@gobble would get as its argument (recall the definition \long\def\@gobble#1{}). It is not hard to devise a macro which ...
3
votes
1answer
750 views

TeX capacity exceeded, sorry [save size=50000]

I am on Mac OS X Lion latest, and get the error trying to compile my large multi-page project. This happens after adding one more code listing (shown below). The full error is: TeX capacity ...
17
votes
1answer
558 views

How does TeX handle \else and \fi in conditionals?

I have seen packages using \def\afterelse#1\else#2\fi{\fi#1} which TeX seems happy to accept. But on taking the first branch, isn't TeX expecting \else instead of \fi? That is, isn't the following ...
21
votes
2answers
296 views

Lifespan lines in TeX

I'm writing a document (written in plainTeX) about the lives of important mathematicians and physicists in human history. Now I have a problem I'd like to tackle. I need to be able to visualize their ...
7
votes
2answers
1k views

Passing argument to \ifnum

\ifnum works fine it it's got two straight numbers. However, when calculation is involved, I get bunch of ! Missing = inserted for \ifnum. errors. Is there any way to solve that problem? ...
10
votes
3answers
448 views

Does the \relax side-effect of \csname…\endcsname still have a use?

I find it annoying that using \csname...\endcsname will define ... to be \relax if ... is undefined, and there is no improved primitive that does not have this side-effect, though there are partial ...
13
votes
3answers
269 views

What other macros like \pdffilesize exist?

So I just learned about \pdffilesize from this answer. Are there other similar things like this? I learned about \the\inputlineno a while ago which prints the line number of the input file. In ...
5
votes
1answer
367 views

pdftex and interaction=batchmode and xwatermark

I try to compile this file: \documentclass[10pt,openany,titlepage]{book}% \usepackage{lipsum}% \usepackage{xcolor}% \usepackage[printwatermark,default-first-page=10]{xwatermark}% ...
13
votes
2answers
186 views

Which TeX procedure removes trailing tabs?

From reading the TeX source, it seems that the input_ln procedure is responsible for removing trailing spaces from lines upon input (before category codes are considered). A very short excerpt from ...
7
votes
3answers
1k views

What TeX software to write technical papers with?

I am a noob when it comes to TeX, however, I do use LaTeX for typing mathematical and engineering formulas, etc. Recently I have taken it upon myself to try and write some technical papers to try ...
1
vote
0answers
122 views

how to open old 'tex metric font' file in ubuntu/windows? [closed]

I've been given a ''tex metric font'' file which was apparently used, by the person who gave it to me, to make a spreadsheet on Windows in the late 80s. I know nothing about LaTeX (neither does he), ...
41
votes
3answers
1k 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 ...
3
votes
1answer
838 views

Including a PDF for dvi output

I want to include a multipage-pdf in latex and get .dvi output. I know \include{pdfpages} only works with pdfLaTeX. I can't convert PDF to .eps since it is multi-page. I want to have .dvi output with ...
9
votes
1answer
145 views

Can TeX detect a newline at the end of the file?

Is TeX able to distinguish beween a file containing, say, the single character a/ byte 97; and a file containing this same character followed by a newline marker (which is system-dependent)? I had a ...
13
votes
1answer
111 views

Difference between “hbox group” and “adjusted hbox group”?

eTeX's \currentgrouptype distinguishes two types of \hbox group types \hbox{\showthe\currentgrouptype} % 3 "adjusted hbox group" \noindent \hbox{\showthe\currentgrouptype} % 2 "hbox group" Looking ...
6
votes
1answer
127 views

Trailing space to end \input| argument

Why do \message{\input|"texlua ..."} and \message{\input|"texlua ..." } give very different results? Notice the extra space before } in the second case. Minimal example to be compiled with pdftex ...
5
votes
1answer
422 views

XeLaTeX, Modern Latin and cyrilic

\documentclass{article} \usepackage{fontspec} \usepackage{polyglossia} \usepackage{unicode-math} \setmainfont{Latin Modern Roman} \setsansfont{Latin Modern Sans} \setmonofont{Latin Modern Mono} ...
3
votes
1answer
828 views

Missing font on compile

I have been given a latex template to use for my school thesis, however when I try to compile the demo to pdf: pdflatex thesis.tex I get the following error: kpathsea: Running mktexpk --mfmode / ...
5
votes
1answer
110 views

Print a speacial character read by \readline in the same way in the document

I want to read a underscore character from a file with \readline and print it as an underscore in the resulting pdf. But the result is a high point. I've read quite a lot about category/character ...
2
votes
2answers
10k views

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

I want to test this template http://students.engr.scu.edu/~sschaeck/latexforthesis/. when i run the makefile i get this error .Please what does it mean this error here the code : ...