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

9
votes
4answers
199 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 / ...
0
votes
0answers
66 views

Newline or cell wrap in Karnaugh Map of KVMacro [closed]

I am using Karnaugh Map macro from CTAN; my issue is that I want to write inequality in a kmap cell (W1+W2+W3 \le T). When I do so, the text of the cell take two cells. Is there away to either put a ...
4
votes
1answer
284 views

Faking small caps in XeLaTeX

In the post Fake small caps with XeTeX/fontspec? I have found the following definitions to fake small caps \def\mycommand{\bgroup\obeyspaces\mycommandaux} \def\mycommandaux#1{\mycommandauxii ...
10
votes
2answers
281 views

How to include eps files in Plain TeX?

The title stands for itself. If it is not possible, how does LaTeX import an EPS file using \includegraphics?
25
votes
1answer
381 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 ...
13
votes
1answer
195 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, ...
12
votes
3answers
252 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
121 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} ...
37
votes
3answers
814 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 ...
8
votes
2answers
116 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 ...
14
votes
4answers
289 views

LaTeX, package documentation look-up

I am on OS X (10.6 Snow Leopard) using TeXLive-2011 to typeset a simple .tex file I am editing in Vim and trying to learn. My problem is: how do I... gradually learn about what TeX can do for me get ...
21
votes
4answers
1k views

Test success of write18

For the new version of my package and class standalone I like to call external programs: further (pdf)latex runs to optionally compile included standalone files, and to convert the resulting PDF to ...
19
votes
4answers
342 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 ...
7
votes
1answer
82 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 ...
8
votes
2answers
192 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 ...
6
votes
2answers
358 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 ...
10
votes
2answers
161 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 ...
4
votes
1answer
71 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 } ...
7
votes
1answer
100 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 ...
3
votes
0answers
225 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 ...
6
votes
1answer
202 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 ...
16
votes
1answer
510 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? ...
3
votes
1answer
137 views

Showing expanded `\let` command with `\typeout`

I have already seen the related page macros - What is the difference between \let and \edef?, but I'm afraid it still doesn't expain to me the following MWE: \documentclass{minimal} ...
1
vote
1answer
159 views

Unexpected scoping issue using \XeTeXinterchartoks

Minimal example (compile with xetex): \XeTeXinterchartokenstate = 1 \newXeTeXintercharclass \classa \XeTeXcharclass `\a \classa \XeTeXinterchartoks 255 \classa = {\begingroup} \XeTeXinterchartoks ...
5
votes
0answers
162 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, ...
1
vote
1answer
462 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
202 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 ...
2
votes
1answer
70 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 ...
17
votes
5answers
1k 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 ...
5
votes
2answers
373 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
97 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
2answers
198 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 ...
5
votes
1answer
88 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 ...
50
votes
9answers
2k views

Are there any disadvantages of TeX being Turing complete?

I have read that TeX is Turing complete. I was wondering if making TeX Turing complete gave raise to unwanted effects.
0
votes
0answers
69 views

mathTeX and LaTeX occasional problems [closed]

I'm using mathTeX to render my math formulas. But on mobile site from time to time happen errors on same formula. In other words one time (or even more) formula is rendered correctly and another with ...
12
votes
1answer
254 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
108 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 ...
22
votes
3answers
383 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", ...
12
votes
2answers
171 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 ...
4
votes
1answer
121 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
296 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.
0
votes
0answers
47 views

Why some macros like \circ must be used in math mode? [duplicate]

Possible Duplicate: Why are so many symbols restricted to math mode? I think \circ is a frequently used symbol. For example, it can be used as item bullets. But it's undefined outside $ ... ...
11
votes
1answer
105 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?
5
votes
1answer
88 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, ...
6
votes
2answers
199 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? ...
29
votes
2answers
593 views

No \makeatletter required?

In typing up some small examples that might create errors in LaTeX (for Documents with typical LaTeX errors), I tried the following: \documentclass{article} \def\my@macro#1{-#1-}% This is magic ...
6
votes
2answers
192 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} ...
35
votes
2answers
1k views

Is there a \show for lengths?

The \show command is extremely useful for figuring out what's going on with a particular macro. Similarly, using \the can tell me the value of a counter. I'd like to know if there's something ...
2
votes
1answer
76 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} ...
10
votes
1answer
109 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 ...

1 2 3 4 5 11