{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
3answers
619 views

Check for empty macro argument

There is a description on how to check whether the argument of a macro is empty in What does \ifx\\#1\\ stand for? Unfortunately, I can't get any of the examples there to work. Among others, I have ...
7
votes
1answer
196 views

xcolor and everycr-Problem

I'm trying to insert some \noalign-code in every row of a tabular by using colortbl and \everycr or \CT@everycr. In most cases it works fine, but not if there is a \rowcolors-command (from xcolor) ...
27
votes
1answer
677 views

What does different \fontdimen<num> mean

I know that \fontdimen<num> returns some dimensions associated with the current font. What are they?
5
votes
0answers
57 views

Spurious whitespace in caption [duplicate]

Possible Duplicate: Why the end-of-line % in macro definitions? I am not sure what is happening with this MWE. First the problem: You can clearly see the whitespace between the label and ...
3
votes
1answer
309 views

how to use \loop … \repeat to generate an arbitrary number of rows in a table [duplicate]

Possible Duplicate: Copy table row n times The code below is intended to produce a table with 3 columns and 3 rows (one heading and two empty rows) but it can be seen that it doesn't work. ...
25
votes
3answers
821 views

@tempdima, reserved@a, @tempcnta, what else?

I'm aware that some "temporary" LaTeX dimensions etc. exist. I would, however, like to know all of them. I know \reserved@a (macro), \@tempdima (dimension) and \@tempcnta (counter).
28
votes
2answers
507 views

What is truecm?

In examples found around the web, some people specify lengths such as width=5truecm with \includegraphics or the geometry package. How is this different from regular 5cm?
14
votes
1answer
195 views

How to read a stream of tokens up to one of two different delimiters

The core question How can I process text delimited by one of two terminators? For instance, if I want to process text up to the next \A, I can just write \def\CmdA#1\A{...} But suppose that \A ...
4
votes
0answers
78 views

How to search for the commands in TeX [duplicate]

Possible Duplicate: Where do I find out how a command/environment is defined? Macro find tool When I am reading the other's LaTeX codes, I always find new commands I have never read ...
14
votes
2answers
190 views

Use TeX macros to store multiple data

I'm trying to use TeX macros to store multiple data such as website url/name. Here is an example : \documentclass{article} \def\Google{{http://www.google.com}{Google Search}} \makeatletter ...
60
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?
8
votes
1answer
1k views

Why does \@gobble take one argument

I understand what \@gobble, \@gobbletwo etc. do, but I don't understand why \@gobble allows for an argument. I believe that the definition of the macro is \long\def\@gobble#1{}. Why is this argument ...
13
votes
4answers
650 views

Dividing dimensions to get a count

Is there a way to divide two dimens and get a count? For example, if I have a box that doesn't fit on a single page, and I want to know the number of pages I'd need for the box (i.e., \heightofbox / ...
10
votes
2answers
847 views

How to include eps files in Plain TeX? [duplicate]

The title stands for itself. If it is not possible, how does LaTeX import an EPS file using \includegraphics?
5
votes
1answer
267 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
151 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
162 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
410 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
202 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
83 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
275 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 ...
12
votes
1answer
182 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
254 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
687 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
284 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
194 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
233 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
87 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
822 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
295 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
118 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
634 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
188 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
300 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
264 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
537 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
136 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
447 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
191 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
546 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
123 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
302 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
99 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
213 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
139 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 ...