Questions tagged [latex-base]

{latex-base} is about the inner workings of the LaTeX kernel. Do not use this tag for general questions about LaTeX or {macros}.

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

The function and meaning of variable \@afterindenttrue

I do not know the function and meaning of variable \@afterindenttrue (see figure below). What will change if I change it to \@afterindentfalse, how can I see its changes? Thank you very much. \def\@...
user avatar
0 votes
0 answers
80 views

LaTeX naming conventions

I have been reading a lot of LaTeX source files recently and I noticed certain naming conventions like \label{fig:...} and \label{tab:...}. It this used as some kind of scoping to avoid namespace ...
user avatar
  • 581
5 votes
2 answers
99 views

Didn't get warning for empty citation

My document has an empty citation \cite{}. I'd expected to get some warning about it. Is it a bug? (if not - why?) Is it possible to enable checking for such cases? MWE: \documentclass{article} \...
user avatar
  • 426
4 votes
1 answer
168 views

When is textwidth 4.5in in latex?

In latex documentation, I found this: Then I searched that what does bk mean, and I found this: After seeing this I thought that bk means book. And textwidth equals to 4.5in in book class (font size ...
user avatar
0 votes
0 answers
33 views

\include tex file does not allow me to add anything else afterwards

I am trying to include two tex files at the end of my report. The first file is included as usual but anything I write after that does not appear. This is my code: \section{Code for Question 1} \...
user avatar
1 vote
0 answers
41 views

How to make code conditional on LaTeX kernel version [duplicate]

I want to make use of some kernel features introduced in the latest release (2021-11-15) in a package. In order to maintain some backwards compatibility, I want to issue a warning and use a workaround ...
user avatar
  • 12.4k
6 votes
1 answer
192 views

Differences between \newcommand, \NewDocumentCommand and \DeclareRobustCommand

What are the main differences between \newcommand, \NewDocumentCommand and \DeclareRobustCommand? Could you answer me giving exhaustive examples, please? I already read this, this and this, but I'd ...
user avatar
  • 793
2 votes
0 answers
62 views

History - LaTeX2e - \newcommand - Why does the mechanism for detecting an optional argument not crank out the case of an implicit [?

[Please take this question for a moot point/an "academical" issue.] The LaTeX-kernel-command \newcommand was invented decades before expl3, xparse and \NewDocumentCommand were available. \...
user avatar
  • 22.9k
1 vote
1 answer
70 views

History - LaTeX2e - \newcommand - Why optional arguments as (]-)delimited arguments?

[Please take this question for a moot point/an "academical" issue.] The LaTeX-kernel-command \newcommand was invented decades before expl3, xparse and \NewDocumentCommand were available. \...
user avatar
  • 22.9k
3 votes
1 answer
210 views

Defining environments calling other environments (bug in 3.14159265-2.6-1.40.21)

A strange error has suddenly appeared after I upgraded Debian, resulting in an update of texlive. Does anyone know the source of this error? How to fix it? I have used similar constructs for more ...
user avatar
  • 31
3 votes
1 answer
223 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 \...
user avatar
2 votes
2 answers
223 views

Avoid line stretching automatically

I would like to avoid at all cost line stretching, without forcing it manually. I will provide you with an example to clarify what I mean. Here it is the code: \documentclass{article} \begin{...
user avatar
  • 568
5 votes
2 answers
783 views

Major changes in LaTeX2e/LaTeX3 kernel

Just out of curiosity. If it would be possible to summarize the major changes/improvements in LaTeX2e/LaTeX3 kernel during the last decade, which they would be?
user avatar
  • 2,604
4 votes
2 answers
86 views

\NewDocumentCommand without xparse

I noticed that I can use \NewDocumentCommand without loading xparse. Why is that? How universal is that? And where can I read more about this? (My search terms always pointed to xparse.) \...
user avatar
  • 3,335
0 votes
0 answers
38 views

latex.fmt error in Linuxmint 17

I am trying to install base latex on Linuxmint RELEASE=17.2, CODENAME=rafaela, EDITION="Cinnamon 64-bit" DESCRIPTION="Linux Mint 17.2 Rafaela". I tried to run latex on this ...
user avatar
2 votes
0 answers
242 views

How do I solve the Output routine didn't use all of \box255. \newpage ...prevdepth \fi \fi \vfil \penalty -\@M error?

I am currently writing my thesis and am using MikTex to do so. I have not updated MikTex in a whole year of time and it was running fine till I did today. Today I updated the MikTex to the latest ...
user avatar
  • 21
1 vote
1 answer
76 views

How to build the binaries pdflatex-dev and friends

pdflatex-dev and variants are helpful for catching issues before new releases, as detailed at What is "latex-dev"?. There appear to be several bugs reported and fixed since the latest pre-...
user avatar
  • 12.4k
3 votes
1 answer
73 views

Missing (?) \begingroup in the definition of \enddocument

Disclaimer While re-reading the question before posting it, it occurred to me that I'm referring to the LaTeX kernel of my computer (TeXLive 2017, \fmtversion=2017-04-15). The question is in some ...
user avatar
  • 25.4k
4 votes
2 answers
228 views

MacTeX 2020: error with report + hyperref + mathbf in chapter

I am getting an error with the following: \documentclass{report} \usepackage{hyperref} \begin{document} \chapter{This raises an error: \(\mathbf{x}=y\)} test \chapter{Using this instead works: \({\...
user avatar
1 vote
0 answers
129 views

How to require a LaTeX version that provides the new hooks management system?

A class of mine is loading the biblatex package if the user uses a given option. For this, the class used to rely on \AtEndPreamble{\RequirePackage{biblatex}} and I guess it used to work nicely. It ...
user avatar
0 votes
2 answers
55 views

Custom class (*.sty) with different document class (e.g. beamer)

I am writing my own class/preamble for LaTeX and need to differ inside if a package is required and therefore loaded based on the document class. Example: I want to load \RequirePackage{hyperref} for ...
user avatar
  • 75
10 votes
3 answers
4k views

Mismatched LaTeX support files detected

I just updated my TeXLive installation on my iMac and got the following error message: /usr/local/texlive/2020/texmf-dist/tex/latex/l3kernel/expl3.sty:77: LaTeX3 Error: Mismatched LaTeX ...
user avatar
  • 585
6 votes
3 answers
231 views

Why is \@secondoftwo used in this example?

I have been studying the code from this TUGboat article by Joseph Wright and Christian Feurersänger (Volume 30, 2009, No. 1) explaining key-value techniques. I understand the use of \expandafter\@...
user avatar
1 vote
1 answer
95 views

Conditional naming of the output PDF file

My target is to have an output Solved Exam.pdf when \ifSolution is true, and The Exam.pdf when \ifSolution is false. However, I don't know if this answer is relevant here to change the \jobname and ...
user avatar
  • 8,759
0 votes
1 answer
73 views

Is there a way to get \filedate and \fileversion from \ProvidesPackage{} inside the package source file?

I like to \typeout a message showing my package's version and date. I know about \GetFileInfo but that apparently only works within a .dtx file. Is there a way to automatically extract \filedate and \...
user avatar
4 votes
1 answer
215 views

latexrelease: Cannot emulate newer kernel

I am trying to emulate LaTeX 2020-10-01 on a system still using LaTeX 2020-02-02 PL 5. I have downloaded the latest version of latexrelease.sty from GitHub. However, the following MWE fails: \...
user avatar
2 votes
1 answer
126 views

List of all characters belonging to each TeX category code?

Where can one find a listing of all characters per TeX category code? I need to construct a symbol table for parsing purposes and I have been unable to locate a complete listing. I don't mind if I ...
user avatar
  • 633
2 votes
0 answers
85 views

Why does \frac not produce \mathinner atoms?

LaTeX defines \frac as \DeclareRobustCommand\frac[2]{{\begingroup#1\endgroup\over#2}} i.e. the fraction is created using \over surrounded by a brace group to contain its effect. The TeXbook states on ...
user avatar
  • 12.4k
9 votes
1 answer
362 views

\renewenvironment and environment hooks

This question refers to the hook system of LaTeX 2e introduced in October 2020 (lthooks). How does \renewenvironment interact with its hooks? Are the hooks cleared or does the code already added to ...
user avatar
  • 44.4k
3 votes
1 answer
339 views

Removing the content of a LaTeX hook (using lthooks)

In a special case (new version of the document class leaflet) I use the new LaTeX hook shipout/before to save the finished pages in box registers without output. In the next step they are combined and ...
user avatar
  • 847
2 votes
1 answer
378 views

bug in skeyval, possible solution with firstaid

Since today (or yesterday) one of my packages [paresse.sty] is giving an error. I've tracked down the origin to skeyval which says ~/texlive/2020/texmf-dist/tex/latex/skeyval/skeyval-core.tex:8460: ...
user avatar
9 votes
2 answers
419 views

What is the fifth possible value of \protect?

Section "11.4 Robust Commands and \protect" of source2e.pdf (File d: ltdefns.dtx Date: 2020/02/27 Version v1.5g) says that \protect can have one of five possible "values" but lists ...
user avatar
0 votes
0 answers
40 views

Possible to add a new line with spacing? Without using optional arg

Right now every time I make a new line, I am adding \\[8pt]. Is there a way to automatically have text in a new line with spacing, without needing to specify the [8pt]?
user avatar
  • 111
3 votes
1 answer
82 views

\SetMathAlphabet messes with \rm

Please consider the following minimal example: \documentclass{article} \SetMathAlphabet{\mathrm}{normal}{\encodingdefault}{\rmdefault}{m}{n}% \begin{document} \parindent0pt X$\rm -1$\\ X$\rm -1$\\ X$\...
user avatar
  • 2,315
0 votes
0 answers
64 views

classification of basic latex commands

Related to but not duplicating Standard pre-defined macros in LaTeX: where to find them all, based on how and where they are defined, what is a top-level classification of all commands, separate from ...
user avatar
  • 261
2 votes
1 answer
104 views

How does \let effect when combined with \@gobble?

I read everywhere (e.g. https://en.wikibooks.org/wiki/TeX/let) that \let copies the content of a command into a new command. My question is, why do we expect \let\comdwithtwoargs\@gobble makes \...
user avatar
  • 171
0 votes
0 answers
28 views

Is is possible to convert an image to a tex formula? (Free vs paid) [duplicate]

Is it possible to convert an image to a tex formula? I would like to know free and paid solutions (which of them free and which of them paid). Thank you!
user avatar
  • 625
1 vote
1 answer
166 views

Variable argument minimum with \@ifnextchar

I attempted to make a generic variable argument macro based off of what I saw here that can prepends text before each argument, append text after each argument, and adds text after all arguments have ...
user avatar
2 votes
0 answers
247 views

Why is \DeclareRobustCommand[*] still used by LaTeX?

As LaTeX requires eTeX now it would be much easier to replace all the definitions of robust commands with \DeclareRobustCommand[*]... by \protected[\long]\def..., wouldn't it? Which advatages come ...
user avatar
0 votes
1 answer
103 views

What is the current preferred method for enabling Unicode characters in mathematical formulas in LaTeX that runs on the unmodified TeX engine?

I am trying to make LaTeX recognize Unicode characters in mathematical formulas. The symbols used are already present in the original Computer Modern fonts and are completely standard (e.g., \alpha, \...
user avatar
0 votes
2 answers
86 views

When using amsmath, can the spacing between the letters "l " and "n" resulting from calling \ln be widened?

The ln resulting from using \ln is too tightly spaced.
user avatar
2 votes
1 answer
57 views

When do curly braces disappear in macro definitions? (e.g. \documentclass expansion)

I've been looking into how \documentclass and friends are actually defined, and I noticed something peculiar which I'd like to understand. Let's say I have \documentclass[11pt, titlepage]{article}. ...
user avatar
2 votes
1 answer
228 views

Common numbering for figures and tables

How can I make a common numbering for my figures and tables? For instance, I want to obtain in Section 1 something like: Table 1.1, Figure 1.2, Table 1.3, Table 1.4, Figure 1.5
user avatar
  • 123
4 votes
1 answer
183 views

Math accent at line start in align causes error

The following code no longer works after the LaTeX2e 2019-10-01 kernel update (error occurs using XeLaTeX). \documentclass{article} \usepackage{fontspec,ulem,amsmath} \begin{document} \begin{align} \...
user avatar
  • 9,268
1 vote
1 answer
54 views

Both, header and footer are missing in the first page when I use longtables or landscape environment in multiple pages

I have a problem when I use longtables and landscape environment in my text, the header and footer is missing in the first page that begin longtable (or landscape environment). Is the first time that ...
user avatar
1 vote
1 answer
158 views

How do I read the LaTeX kernel code source? [duplicate]

I'm embarrassed to ask this. At one time I knew the answer and even had a printed copy of the code. I have tried texdoc with various options but was unable to come up with the one I needed. At the ...
user avatar
  • 25.2k
6 votes
1 answer
119 views

LaTeX2e 2019/10/01 update changes \lbrace vs \lcbrace test result

Prior to the LaTeX2e 2019/10/01 update, the following test with mtpro2 gives % Intended output: True False True Now it gives % After LaTeX2e 2019/10/01 update: False False False Code: \...
user avatar
  • 9,268
1 vote
1 answer
380 views

MikTeX: Cannot fix the \includegraphics error by rebuilding formats (format still says LaTeX2e <2018-12-01>)

I was hit by the recent problems with \includegraphics and followed https://tex.stackexchange.com/a/512049/130867 in order to fix it. However, rebuilding my formats in the MikTeX console does not help....
user avatar
0 votes
1 answer
71 views

Old answers don't work - XeLaTex fontspec crash on Texmaker [LaTeX error: “kernel/invalid-variant”]

I'm reviving an old issue which I have come across. There are many similar questions but dated from a few years. Basically using Miktek 2.9.7100 with everything up to date and Texmaker 5.0.3. I can'...
user avatar
3 votes
1 answer
159 views

Where's the mandatory argument of sectioning commands?

I was looking in the file book.cls and I noted there is no mandatory argument in the definition of \section, \subsection, and \paragraph commands \newcommand\section{\@startsection {section}{1}{\z@}% ...
user avatar
  • 1,237