Questions tagged [tex-core]

{tex-core} is for questions for syntax, semantics and expected behavior of TeX primitive control sequences, regardless of extensions (eTeX, etc.) formats (Plain or LaTeX) and macro packages (tikz). 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}.

Filter by
Sorted by
Tagged with
0 votes
0 answers
9 views

Newest version of luatexja interferes with vertical alignment of text

Today when I was compiling a document, I found that the header was mis-aligned. After a bit debugging, it seems to be the package luatexja (version 20220807) that is causing the problem. Below is a ...
user avatar
  • 6,542
1 vote
0 answers
21 views

Compilation never ends with modified \pmod after recent update

In this answer, @egreg provided a modified \pmod with a starred variant. However, after some recent update to the TeX distribution this modification no longer works (the last time I used this command ...
user avatar
  • 6,542
0 votes
1 answer
43 views

Recovering discarded items in the output routine

A problem I had with TeX years ago was that discardable items (glue items, kerns, and penalties) are not recoverable in the output routine. This would be quite useful for complex multi-column pages ...
user avatar
0 votes
1 answer
32 views

\skip_vertical:n and \vspace between two tcolorbox environments

What is the difference between \skip_vertical:n and \vspace? In the following example, the \skip_vertical:n has no effect, but if one changes it to \vspace then it works. Why is this? I'm using an up-...
user avatar
  • 6,542
0 votes
0 answers
28 views

Convert 1 column to 2 column item

How can I make number 1 single column like number 2 double column? 1 and 2 both of numbers are in the attached image. I have tried to find this solution but did not get any solution.
user avatar
  • 11
0 votes
0 answers
30 views

How to check if different file path refer to the same file

A file may be accessed by different paths. For example, - subpath/myfile.tex - ./subpath/myfile.tex - ../current path/subpath/myfile.tex, - /d/.../current path/subpath/myfile.tex They refer to ...
user avatar
  • 2,423
0 votes
0 answers
25 views

Variable distance between header and table

I'm using a great calendar generator latex-calgen by Simon Gerber. It combines python and LaTeX to generate a pdf file with a calendar. Each month is on a separate page and every page has a header on ...
user avatar
0 votes
1 answer
84 views

How to obtain absolute path of a file

Many languages provide functions to obtain the absolute path of a file. I wonder if Tex/LaTex has also such macros. In the following example, given a file name, test if this file really exists. Then, ...
user avatar
  • 2,423
1 vote
1 answer
18 views

help with latex syntax parsing errors

Could anyone help to fix the syntax parsing error ? \documentclass{article} \usepackage[utf8]{inputenc} \begin{document} \begin{aligned} \rho &= \begin{pmatrix} ae^{i\...
user avatar
  • 111
1 vote
1 answer
42 views

How does \special know which output driver it's addressing?

The TeXbook says that \special{…}is a special instruction to the output driver. But how do you know when you write the instruction which output driver will be reading it?
user avatar
0 votes
0 answers
46 views

How to make always visible the tooltip content on SumatraPDF?

i am created a package for tooltip using Tooltip that works with all pdf readers. Here my TeX code below \documentclass{book} \usepackage[intlimits,tbtags]{amsmath} \usepackage[utf8]{inputenc} \...
user avatar
0 votes
1 answer
30 views

code fails to be wrapped with condition

In the following example, I want the content in minipage is highlighted by \colorbox if the condition is true. If the condition is false, the content in minipage typeset directly. The typeset of true-...
user avatar
  • 2,423
1 vote
1 answer
26 views

Expansion rule for a character redefined with `\newunicodechar`

Consider the following code. With xelatex or lualatex, it produces three identical results. However, with pdflatex one shall get an error. The main "macro" is a Unicode character ᵢ, defined ...
user avatar
  • 6,542
3 votes
1 answer
118 views

\let equivalent in LaTeX2e

I have read in the official LaTeX2e for class and package writers guide (section 2.7.2 "Make it robust") that one should aim to use as many LaTeX commands as possible. As an example, they ...
user avatar
  • 77
3 votes
3 answers
176 views

How to extract text from argument

The following code tries to extract plain text from formatted argument(here is \bfseries) and fails. \x is used to store the expansion result of \pgfkeysvalueof. \edef is for fully expansion of \...
user avatar
  • 2,423
3 votes
0 answers
112 views

Could TeX run Doom?

I know this question sounds silly, but Doom has been made to run in all sorts of completely ridiculous environments, including text-based terminals. So how about TeX? Could it somehow run Doom? I know ...
user avatar
  • 11.2k
0 votes
0 answers
38 views

Can LaTeX-TeX be described with EBNF grammar? [duplicate]

This question is related to the question I asked here How does a TeX engine process the informations within a .tex file?. I want to write a program to parse TeX-LaTeX files. I found libraries to write ...
user avatar
  • 197
0 votes
0 answers
91 views

How does a TeX engine process the informations within a .tex file?

I want to write a LaTeX-TeX parser to manipulate .tex files for a program. I found this question here How does a TeX engine read and render the input stream? which explains how everything works under ...
user avatar
  • 197
1 vote
0 answers
71 views

Get page edges coordinates in Metapost and ConTeXt

I have written several macros for my projects using TikZ. Several of them need to be aware of the page edges and margins. For example, this is a small macros I have written to draw rectangles from the ...
user avatar
10 votes
1 answer
385 views

New primitives that weren't part of TeX

This answer contains the statement: It requires a current tex system (texlive 2021 or a current miktex) as it needs some new primitives. Do newer tex systems add primitives that weren't already part ...
user avatar
1 vote
0 answers
124 views

What are the boundaries of TeX?

Does TeX have a limit at all? I've seen in forums that besides rendering objects with pgfplots and tikz, to animating with animate, to interactive PDFs by embedding Javascript in TeX, actually nothing ...
user avatar
  • 11
1 vote
0 answers
26 views

Auto Escaped Reserved by Latex Chars in Custom Env

I want to create a custom environment designed to handle chunks of text. (Not code, text.) Within this environment, how to make LaTeX to automatically escape all reserved chars (# $ % & { } _ ~ ^ \...
user avatar
2 votes
1 answer
35 views

Help with xpatch-ing a command from xkeyval: \setkeys

I'm trying to patch \setkeys from xkeyval, so that it includes a mask of keys to ignore completely when \setkeys is called. Note that \setkeys in called in various macros, and there is a lots of them, ...
user avatar
  • 131
1 vote
2 answers
66 views

Limit interword shrinking without affecting the normal interword spacing

There are many questions about interword spacing in Latex, but this question is different. I'm generally OK with the default spacing and do not want to change it. However, sometimes Latex shortens the ...
user avatar
  • 135
1 vote
1 answer
47 views

Text along a curve in Metapost

Does anyone have any suggestions on how I might get text along a curve in Metapost?
user avatar
0 votes
0 answers
27 views

Font size changes in tex document after referencing a label

I am trying to reference a label, but when I do so the font size changes as shown below over the unknown measurable on $\R$ vector functions $f(x) = \left( f_1(x), ..., f_n(x) \right)^T$ and $\varphi(...
user avatar
2 votes
1 answer
39 views

After tokenizing, has a letter token already carried typeface info and font size info?

TeX is not very well understood for me, and there are so many details that I have to make some notes so that I can quickly understand what I have learned now when I go over it in the future. The ...
user avatar
  • 2,629
6 votes
3 answers
378 views

The idea behind the \outer primitive

It seems that this primitive was designed for the purpose that in case programmers forgot to put } in the end of the definition of a macro (in this case, TeX thought all characters until the end of ...
user avatar
  • 2,629
5 votes
2 answers
193 views

After changing the catcode of the escape character `\`, why can this code still be compiled successfully?

I read some macros of manmac.tex, when I read this code snippet % (now Appendix E resumes again) % macros for verbatim scanning \chardef\other=12 \def\ttverbatim{\begingroup \catcode`\\=\other \...
user avatar
  • 2,629
5 votes
2 answers
339 views

Why isn't every space between words a feasible breakpoint?

p98 of the TeXbook gives a paragraph trace beginning: []\tenrm Mr. Drofnats---or ‘‘R. J.,’’ as he pre- @\discretionary via @@0 b=0 p=50 d=2600 @@1: line 1.2- t=2600 -> @@0 ferred to be called---was ...
user avatar
7 votes
2 answers
175 views

When does tex do macro expansion?

Having read some chapters of the texbook, I know tex eats input lines from command line or files, then converts them into tokens. When these tokens go into its gastro-intestinal tract, tex prepares to ...
user avatar
  • 2,629
5 votes
1 answer
205 views

the discretionary of the word `difficult'

Is the discretionary of the word difficult di\discretionary{f-}{fi}{ffi}cult equivalent to dif\-ficult (or dif\discretionary{-}{}{})?
user avatar
  • 2,629
3 votes
1 answer
118 views

Why are \showboxbreadth and \showboxdepth set to 2^{30}-1 in \loggingall?

The plain TeX format defines \def\loggingall{\tracingcommands\tw@\tracingstats\tw@ \tracingpages\@ne\tracingoutput\@ne\tracinglostchars\@ne \tracingmacros\tw@\tracingparagraphs\@ne\tracingrestores\...
user avatar
  • 9,278
1 vote
0 answers
50 views

Where is the reference point of a VBOX?

From the TeXbook, Therefore, the actual rules for the depth of a constructed vbox a somewhat TeXnical. Here they are: Given a vertical list that is being wrapped up via \vbox, the problem is to ...
user avatar
  • 2,629
2 votes
1 answer
120 views

Detect delimiter

Is it possible to check whether a token is a delimiter, i.e (, ), |, \vert, \langle, \rangle, etc without directly checking each of them in a condition? The structure of delimiter is well described ...
user avatar
  • 2,763
1 vote
1 answer
44 views

\@abspage@last fails to typeset number in header

I tried to typeset the total pages number in right header by \@abspage@last under pagestyle fancy. Instead of number, the text abspage@last is printed. Why? And how to deal with it? MWE: \...
user avatar
  • 2,423
0 votes
1 answer
40 views

Under what circumstances does TeX produce a series of tokens with space after a control sequence?

On page 39 of The TeXbook, Knuth said, Furthermore, spaces are not ignored after control sequences inside a token list; the ignore-space rule applies only in an input file, during the time that ...
user avatar
  • 2,629
0 votes
2 answers
66 views

calculate length in \newlength with \dimexpr

\documentclass[a4paper]{article} \usepackage{geometry} \geometry{showframe} \geometry{left=1cm,right=1cm,top=1cm,bottom=1cm} \begin{document} (1) \newlength{\ccc}{\dimexpr\textwidth-100pt} % ...
user avatar
  • 2,423
3 votes
1 answer
155 views

How to get length from glue

The objective of the following code is to occupy the rest of a line with a parbox. I know this is a wrong way. So, how to get length from glue? \documentclass{article} \usepackage{geometry} \geometry{...
user avatar
  • 2,423
3 votes
1 answer
136 views

\if compares text literal?

Knuth's tex book introduced \if<token1><token2>. I wrote the following to test it \def\tOne{abc} \def\tTwo{abc} \ifx\tOne\tTwo True \else False \fi \if\tOne{abc} True \else False \fi \...
user avatar
  • 449
0 votes
1 answer
33 views

How to append something to a page style defined by \fancypagestyle

Some other codes can be appended to a macro by tools from etoolbox, for example, \apptocmd. I wonder if there are similar ways to append something to a page style defined by \fancypagestyle from the ...
user avatar
  • 2,423
0 votes
0 answers
26 views

How to display latex math in html output of texinfo document

https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Inserting-Math.html The above link provides an explanation to how to display math in the html output of a texinfo document. It says: ...
user avatar
0 votes
0 answers
42 views

How to remove the repeating header

The "list of figures" appear every two page. How can I remove it? %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[b5paper, 11pt, openany, titlepage]{book} %%%%%%%%%%%%%%%%%%...
user avatar
-2 votes
1 answer
57 views

I don't know how to use 'fill=?' [closed]

It's the first time I write tex profiles,I want to know how to use the style{ fill=}.
user avatar
  • 1
2 votes
1 answer
37 views

Why does the \newhelp toks uses a \csname construct in its definition?

In LaTeX2e there are still remnants of Plain TeX macros. One such macro is \newhelp, which is defined as: \def\newhelp#1#2{\newtoks#1#1\expandafter{\csname#2\endcsname}} This is not used anywhere in &...
user avatar
0 votes
1 answer
53 views

keywords detection in pdf from latex

I recently wrote my first LaTeX cv. once I started to apply for jobs i notice that the tool them using to scan my CV doing some wrong classification like give me wrong name, or missing some skills I ...
user avatar
  • 1
3 votes
1 answer
164 views

LuaTeX treats ^^M in \wlog differently

I am confused by the output of the following code: \documentclass{article} \begin{document} \begingroup \obeylines \typeout{abc^^Muvw} \wlog{ijk^^Mxyz} \endgroup \end{document} With PDFLaTeX or ...
user avatar
  • 8,728
3 votes
0 answers
118 views

How to make a "Computer Modern Medium" font?

In [La]TeX documents printed in the early 1980s, fonts look noticeably thicker than they do today. Something about the advent of modern laser printers and the disappearance of older printing ...
user avatar
1 vote
1 answer
43 views

Table column spacing in Plain TeX with \settabs

In Plain TeX I need to reduce the space between 2 columns in a 2 column table. How to do this? I am simply using \settabs 2 \columns, but one column is at the left of the page, but the second is on ...
user avatar
2 votes
1 answer
39 views

How to expandably obtain pendant of different (to be specified) category of arbitrary explicit character token?

This question is about categories of explicit character tokens. If you apply \string to an explicit character token, you get the category 12 pendant of that explicit character token. (Exception: If ...
user avatar

1
2 3 4 5
37