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

5
votes
1answer
252 views

Problem with xargs package

I am trying to do what I though was fairly simple - use an xargs defined macro in a CS. MWE: \documentclass{article} \usepackage{xargs} \usepackage{etoolbox} \makeatletter \def\abx@foo@baz@bar{test} ...
3
votes
1answer
150 views

ConTeXt: Page numbering in words for spanish

So I tried to hack the macro given in the ConTeXt wiki to write pagenumbering in words in spanish, my native language. Things were great until I had to reach the 100th page. ConTeXt claims when ...
35
votes
2answers
2k views

Will cruft from a previous compile ever change the final look of my document

Ok, this has been bugging me for a while; Will cruft left over from a previous run of LaTeX ever change how my document looks? Would the following procedures ever give me different results: I ...
8
votes
2answers
159 views

Is it possible to remove (or otherwise nullify) a whatsit node from a box?

I am aware that it is not generally possible to modify the contents of a box (as per http://tex.stackexchange.com/a/49903/17427), though I believe it is sometimes possible to "unbox" material and hack ...
7
votes
1answer
88 views

Error line inside a package

I've created my own package, but, when I use it in a new document, and pdflatex find an error using a custom command (defined in my own package), it shows me only the error line where this command was ...
19
votes
4answers
403 views

Extract all emphasized words from latex document

I need to produce a list of all words that are emphasised in my LaTeX document (=which are enclosed by \emph{...}). How can I use awk to process the .tex file and extract all patterns starting with ...
8
votes
2answers
201 views

What is wrong with this TeX macro

Still soldiering on with trying to learn these macros. Can someone tell me why this isn't working? The macro \mycline{n-n} is supposed to expand to \cmidrule{1-1} ... \cmidrule{n-n}, but in my code ...
4
votes
1answer
82 views

Error with expansions

I am getting an error while trying to compile this minimal example: min.cls: \ProvidesClass{min} \LoadClass{minimal} \NeedsTeXFormat{LaTeX2e} \newenvironment{myenv}{}{ \def\aaa{test } ...
10
votes
2answers
263 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
177 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
2k 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
253 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
659 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
270 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
191 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
230 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
773 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
284 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
115 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
584 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
181 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
293 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
233 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
513 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
134 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?
23
votes
3answers
441 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
190 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
516 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
119 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
294 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
95 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
138 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
244 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
776 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
376 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
856 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
649 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
300 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? ...
11
votes
3answers
463 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
271 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
409 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
189 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 ...
8
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
129 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), ...
42
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 ...