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
2 votes
1 answer
40 views

Is it advisable to always include an empty group to avoid double superscript error for math accents?

This very helpful answer https://tex.stackexchange.com/a/582444/239563 describes a way to avoid a double superscript error by including an empty group: ${{}\dot{y}^a}^\top$ My question is: is there ...
3 votes
2 answers
233 views

input: skip n lines

I am trying to insert content from another file whilst optionally skipping the first n lines. I have control over the inserted content, and my current solution is simply to wrap the first n lines in ...
0 votes
0 answers
32 views

Translate format my book to epub and mobi

I have a book that has already been written. (tex files, styles and pictures) I also have a pdf for this book. How do I quickly translate it all into epub and mobi format? I tried to translate the pdf ...
1 vote
1 answer
2k views

MikTeX sources and LaTeX language

Am I right that MikTeX sources in C++ contain the code that opens .tex file (when I run latex.exe myfile.tex), reads it, parses commands, performs them if they are correct and logs error messages ...
2 votes
1 answer
48 views

How to increase the output line length of \errmessage and \typeout [duplicate]

Is there a way to increase the output line length of \errmessage and \typeout? My problem is that some error messages in my console and log file are cut within the error content: --> Error: This is ...
0 votes
1 answer
33 views

Macro with dimension parameters

I've tried the following \newdimen\fooDimen \fooDimen=10.0pt \newdimen\barDimen \barDimen=20.0pt \newcommand{\fooCommand}{2}{% \ifdim#1 < #2 \typeout{Test} \fi } \begin{document} \fooCommand{\...
0 votes
0 answers
80 views

Different between \def and \long\def and where to use [duplicate]

Please excuse if my question is silly.... May I know what's the difference between \def and \long\def and where to use \long\def Thanks....
1 vote
2 answers
79 views

How to fix a footer minipage at the bottom of a page without using of e.g. "fancyhdr"?

I've to fix a footer minipage on one page at the bottom of that page without using of e.g. fancyhdr so that the floating text is breaking into new page when that footer is reached. How to do that? ...
1 vote
1 answer
53 views

Why do I get the error message "! File ended while scanning use of \next." when using comment package?

I have TexMaker in a desktop and I had it in a laptop where I produced several tex codes without problems. However, recently, I opened those codes in the desktop computer and I got the following error ...
4 votes
1 answer
89 views

How to define a list of dates for tikz calendars

I am trying to pass a list of dates to a calendar using a pgf key, so that I can use it in different parts of the code. Follow the PGF & TIKZ manual, I got it for mybirthday (see code below). ...
1 vote
0 answers
70 views

What is the equivalent PreTeXt equivalent of \def in Latex? [closed]

I am using Latex to write my course syllabi and I want to switch to PreTeXt does anyone know what is the equivalent of \def in PreTeXt? For example, in my syllabi I use the following: \def\officehours{...
2 votes
3 answers
196 views

Macro working over a whole word (plain TeX)

I have spend a good time searching in references and forums for a answer to the question I'm raising here. I would like to write a macro that gets a word as a parameter without needing to using braces ...
1 vote
1 answer
652 views

Latex error: File tgtermes.sty not found

I installed BasicTex.pkg in OS X to generate pdf file of a sphinx documentation. When I ran make latexpdf, it throws the error LaTeX Error: File tgtermes.sty' not found`. I tried to install it using ...
56 votes
5 answers
10k views

Confused with TeX terminology: height, depth, width

The LaTeX reference card states for example \strut box w/ ht and depth of “(”, zero width I came to see text as a two dimensional feature, but I must be missing out on something... (following was ...
16 votes
3 answers
1k views

How to set tikzmarks with \noalign at the edge of tabular rows

I'm trying to improve the lines in a tabular with colored rows (lines above a colored row can disappear in the adobe reader at some zoom levels) by redrawing the line above a row after the row itself ...
0 votes
1 answer
69 views

How to prevent script (via \immediate\write18) from running multiple times?

How to prevent the execution of script (via \immediate\write18) multiple times when running latexmk (which calls pdftex multiple times)? The problem is that during each iteration of pdftex, the script ...
87 votes
1 answer
9k views

On the basics of writing to & reading from auxiliary files (.aux, .toc, etc.)

Some actions (such as generating the Table of Contents) require two passes of the TeX compiler: during the first pass, some data get written to an auxiliary file, only to be retrieved during the ...
0 votes
1 answer
35 views

\ifinner not working in \@footnotetext

I was trying to improve an old answer and ran into a problem. \ifinner is telling me I am in outer mode inside a \parbox. It usually works, but not in this case (\@footnotetext). \documentclass{...
1 vote
2 answers
313 views

Why does \ifdim work here but \if doesn't?

I'm very new to LaTeX, and need to compare a length I've defined with a default value (and set another length accordingly). Consequently, I'm exploring the murky (to me anyway) world of LaTeX ...
5 votes
1 answer
336 views

what is the scope of \catcode?

I want to use underscore as a usual char in most cases, so I do this in global: \catcode`\_=11 Usually, I work in Chinese context, the code ~ is not so useful, so I use it to replace code 8 _: \...
2 votes
0 answers
106 views

After updating to TeXLive 2021, the environment \AtBeginDocument errors out in beamer [closed]

I used to use TexLive 2019 on my Mac which has been recently updated to Catalina. I decided to update TeXLive as well. So I downloaded and installed TexLive 2021. After this update, some of my slides ...
1 vote
2 answers
77 views

The correct and impact of italic mode on dot and comma

I'm writing a report and came across this issue which is putting dot or comma inside \textit{}. In my case, by Smith \textit{et al,},~\cite{P_Cheeseman} I have two questions: 1) is dot affected by ...
0 votes
0 answers
106 views

Can't complete texlive install

I'm trying to install tex live in Ubuntu 20.04. In a terminal: sudo apt-get install texlive-full but I didn't realize there wasn't enough space, so I get an error during install. Now, I have no clue ...
0 votes
0 answers
118 views

quick tip on \input or \include?

I'd been trying to compile a pdf from a tex file, using only miktex texworks. But it turned out that the file(gutenberg 38769) was too big to be loaded at all on some devices and so I am now ...
7 votes
2 answers
243 views

How can I implement a \futurelet that ignores spaces?

This is a question about token processing in TeX. What am I doing wrong when implementing \FutureLetNoSpace? The book TEX in Practice: Volume III: Tokens, Macros, by Stephan v. Bechtolsheim, really ...
9 votes
2 answers
2k views

\ifdim command with multiple conditions

It's my first time asking here for help so please don't roast me. I'm writing some macros to autodetect and mark peaks in a diagram (in tikz/pgfplots) using \ifdim. The problem is, I have two ...
0 votes
1 answer
123 views

remove the gap between uppercase letter in math mode

In tex equation mode,I want 3-var MNP as a product: \begin{equation*} N\equiv R_1\alpha NP+R_2\beta MP+R_3\gamma MN(\bmod\;MNP) \end{equation*} But the product MNP leaves obvoius spacing to each ...
3 votes
1 answer
963 views

How can ternary operators be utilized in LaTeX?

This is more of a theoretical question. Is it possible to use ternary operators, like it is possible in C (e.g. (a<b) ? a : b), and if yes how?
2 votes
1 answer
109 views

LuaTex get position of a “glyph” node

I'm trying to record position of glyph nodes while generating a pdf file but I always get values 0 from the call of pdf.getpos() function. How can I fix it? Here is my code and the output is recorded ...
3 votes
1 answer
229 views

What is so special about "\@tempboxa"?

When storing a box, why do so many folks use \@tempboxa? Why not \@foobar or \@MyGreatTemporaryBox or simply \@temporaryBox0? Is there anything special about this \@tempboxa? Knuth says simply \...
11 votes
3 answers
6k views

How to check if a value is not equal using TeX conditionals?

I have a value defined in a macro, e.g.: \mymacro{apple} I need to check if a value does not equal a string, e.g.: IF #1 NOT EQUAL TO "apple" THEN PRINT "It is not a apple, it is #1." FI I ...
3 votes
1 answer
205 views

How do tex (and latex) produce square root symbols?

When you type commands like $\sqrt {x}$, $\sqrt {x^2 - y^2}$, or $\sqrt {\sum_{i=0}^n i^2}$, latex produces square root symbols, that "grow" with the size of the thing of which you are ...
3 votes
2 answers
172 views

Seeking a faster implementation of \CreateTheorem

Based on this answer, I wrote a macro \CreateTheorem, which can be used in the following five ways: \CreateTheorem*{env}, which creates an unnumbered theorem-like environment env; \CreateTheorem{env},...
24 votes
5 answers
3k views

Selectively suppress generation of typeset output

Is it possible put TeX into a "mute" mode in which all typesetting is suppressed? \documentclass{article} \pagestyle{empty} \begin{document} \suppress This text will not be seen in the generated ...
2 votes
2 answers
143 views

When does TeX update \pagetotal dimension and when does TeX update \tracingpages result?

I am confused with the page builder in TeX: When does TeX update \pagetotal dimension? when does TeX update \tracingpages result? Why doesn't TeX update both of them at the same time? The followings ...
4 votes
3 answers
382 views

Backend reasoning on font size in math mode

This is more of a philosophical question. I was looking for ways to increase the font size within math mode locally (eg. in only one equation/align environment) but the solutions I come across often ...
4 votes
2 answers
108 views

Statements about \noexpand in source3.pdf and in the TeXbook

The LaTeX3 sources, released 2021-07-12, says in section "23.7 Description of all possible tokens" of "Chapter 23: The l3token package /Token manipulation": Expanding \noexpand ⟨...
5 votes
1 answer
10k views

Missing number, treated as zero. \begin{document}

I've gone through quite a number of the "Missing number, treated as zero" Q&As without any resolution. I am using a dissertation template which is required by my college but unsupported. In ...
0 votes
0 answers
73 views

Using PythonTex in Lyx on a Mac

I would like to use PythonTex in Lyx on a Mac. I don't understand the intricacy of Lyx/Tex etc. I think I managed to install PythonLex by installing MacTex 2021 which also installed Tex Live Utility ...
60 votes
3 answers
8k views

Electronic version of Knuth's "TeXbook"?

I have a printed copy of the TeXbook (from D.E. Knuth) at home. Now that I travel a lot, I don't want to take my library with me every time. Question: Is there a legal way to obtain (=purchase) a PDF ...
39 votes
2 answers
2k views

What's new in TeX, version 3.141592653?

A new version of TeX has been released by Donald Knuth earlier this year (January/February 2021), and its version number is 3.141592653 now. What has changed since the previous release, version 3....
0 votes
1 answer
69 views

How to put code into another macro to avoid duplication?

The following code has two branches: If true-branch, argument #2 is put into \colorbox by which is typeset; If false-branch, argument #2 is typeset directly. #2 has to appear in both branches. In the ...
31 votes
6 answers
4k views

What is the programming paradigm of TeX language?

From a considerable time, I am asking to myself how TeX language is classified. I have looked for some useful information in Internet a couple of times without success (even a tip!). In this list (...
1 vote
1 answer
118 views

Can I make a macro behave like \numexpr?

For example I define \fpeval in Plain LuaTeX: \begingroup \catcode`\%=12 \directlua{ function math.round_int ( x ) return x>=0 and math.floor(x+0.5) or math.ceil(x-0.5) end function ...
2 votes
3 answers
310 views

Understanding empty argument check

I have encountered the following code to check for an empty argument: \catcode`\@=11 % as in plain.tex \long\def\blank#1{\bl@nk#1@@..\bl@nk}% \long\def\bl@nk#1#2@#3#4\bl@nk{#3#4} \catcode`\@=12 \long\...
2 votes
2 answers
194 views

Loading tikz package results in color change

I guess my question is rather simple, but I am a beginner to latex. So I would appreciate to get some feedback ragarding the following: I load the following packages in my document: \documentclass[...
7 votes
0 answers
110 views

Has anyone made a modified TeX with infinity greater than 10,000?

We're all familiar with the effect of \sloppy deciding that if there has to be something bad in the paragraph, it might as well shove everything into one really bad line. Part of this is, no doubt, ...
1 vote
2 answers
684 views

text not getting justified

I have written the following tex code \documentclass[12pt]{book} \usepackage[contents={}]{background} \usepackage{fontspec} \setmainfont{Constantia} \begin{document} \LARGE \chapter{Prayer} ...
3 votes
1 answer
170 views

Why does space with catcode 12 yield a weird dash?

For fun, let’s change the category code of space to 12. Then we get the following weird dash instead of a space. Why? \documentclass{article} \begin{document} \begingroup \catcode` =12 Hello World,...
10 votes
1 answer
490 views

What tools/advice/methods should I utlize to practice "The TeXbook by Donald Knuth"?

The short question is: How do I progress with this book? What tools should I download? A step by step explanation would be deeply appreciated .. The experience I had: Am a computer science student and ...

1 2 3
4
5
37