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
1 answer
124 views

why is ispackageloaded named with an @? [duplicate]

I suppose there is some reason why the command \@ifpackageloaded is not just called \ifpackageloaded But with the @ one has some additional work: \makeatletter \@ifpackageloaded{geometry} { ...
user2609605's user avatar
3 votes
1 answer
31 views

Adding to package hook after it's been loaded

It was my understanding of kernel hooks that adding to a hook only affects instances that follow that addition. This seems true for in-document hooks. For example, with \begin{quote} some text \end{...
mbert's user avatar
  • 3,418
0 votes
1 answer
84 views

How to make a specific environment disappear? [duplicate]

I have got several Tikz pictures whose compilation takes up much time. More generally, I am wondering whether there is a switch that can make a specific environment foo disappear as if the code would ...
shuhalo's user avatar
  • 2,505
1 vote
1 answer
108 views

Page breaks still occur in samepage

I cannot find any documentation at all on the samepage environment (aside from a cryptic comment on p229 of the LaTeX book that "The \samepage command still works, but is now of little use", ...
richard's user avatar
  • 691
0 votes
1 answer
64 views

Get current style (rm, sf, tt)

How to print the current style (rm, sf, tt) in a give position of a document? \begin{document} \sffamily % print current style -> sf \rmfamily % print current style -> rm \ttfamily % print ...
wolfrevo's user avatar
  • 503
7 votes
1 answer
273 views

Why is grouping used in the numerator of the definition of \frac but not the denominator?

In the answers to this question: What is the difference between \over and \frac?, one finds the ams and plain latex definitions of \frac, respectively: \DeclareRobustCommand{\frac}[2]{{\begingroup#1\...
Anthony Pulido's user avatar
5 votes
1 answer
95 views

Different meanings of "footnotesep"?

What is the difference between footnotesep as option of the geometry package and as native dimension \footnotesep? It seems that \usepackage[footnotesep=1em]{geometry} sets the separation between the ...
wolfrevo's user avatar
  • 503
0 votes
1 answer
61 views

Difference between `\newcommand{..}[1]` and `\NewDocumentCommand{..}{m}` [duplicate]

In this answer, egreg uses \NewDocumentCommand{\refprefix}{m}{% \ifinproofref\else #1\fi } The command \refprefix is part of code that's written to the aux file. Defining the command with \...
Bubaya's user avatar
  • 2,237
3 votes
2 answers
421 views

why You can't use `blank space ' after \the

If I define \newcount\punkt \def\newpt{\the\punkt\space\advance\punkt by 1} everything runs fine; but if I do \newcounter{punkt} \newcommand\newpt{\the\punkt\space\stepcounter{\punkt}} I get You can'...
jarnosz's user avatar
  • 4,257
2 votes
1 answer
42 views

use \def\@plus{plus} etc to save token space

In the LaTeX kernel, we can see these definitions: \def\@plus{plus} \def\@minus{minus} \def\@height{height} \def\@depth{depth} \def\@width{width} It is said that these definitions can be used to save ...
Stephen's user avatar
  • 2,872
0 votes
1 answer
63 views

How to store Boolean values for later use

I want to define a new command for a package using xparse. My command looks like this: \NewDocumentCommand{\fancyCommand}{s o m}{ \def\@optional{#2} \def\@mandatory{#3} } This is, because I ...
Matthias's user avatar
3 votes
1 answer
94 views

`\global\NewCommandCopy` instead of `\GlobalLetLtxMacro`?

The new LATEX2ε kernel provides \NewCommandCopy (and \Renew... and \Declare... variants) which functions almost like \LetLtxMacro from the letltxmacro package. Instead of \GlobalLetLtxMacro from ...
Stephen's user avatar
  • 14.8k
8 votes
1 answer
270 views

latex/pdflatex, NewTX, and hyperref: in ⓪ and ①, the circle touches the digit

Feeding \documentclass{article} \pagestyle{empty} \usepackage{newtxtext} \usepackage{hyperref}%%% it's bizarre that adding a package for referencing (and not using this package) changes the shapes of ...
user avatar
5 votes
2 answers
116 views

Why does \newcommand on an already defined active character not yield an error?

We (or at least I) usually think of an active character as just another command whose name just happens to a character rather than a control sequence. So why does \newcommand<active character> ...
Gaussler's user avatar
  • 12.7k
2 votes
1 answer
68 views

Why does \tensor produce errors when LaTeX Info warns about number of math fonts?

In actuarial documents we use much mathematically oriented notation, for which we need many math fonts. In What is the meaning of "No math alphabet change to frozen version normal on input line ...
Markos Mitsos's user avatar
0 votes
1 answer
61 views

Iterate through the tokens of a list not known in advance (\@for + \csname)

If I want to iterate through the tokens of \myList I can simply do \def\myList{one,two,three} \makeatletter \newcommand{\iterateThroughMyList}{% \@tempswafalse \@for\next:=\myList\do{% ...
madmurphy's user avatar
  • 233
13 votes
1 answer
335 views

What's the difference between \AtBeginDocument and \AddToHook{env/document/begin}?

Here is an MWE: \documentclass{article} \usepackage{lipsum} \AtBeginDocument{\linespread{1}\fontsize{12bp}{23bp}\selectfont} % \AddToHook{env/document/begin}{\linespread{1}\fontsize{12bp}{23bp}\...
xdyy's user avatar
  • 591
4 votes
2 answers
353 views

Command \MakeUppercase does not work as expected in pdfLatex, but works fine in LuaLaTeX and XeLaTeX

As you can see from the minimal working examples below \MakeUppercase command when compiled with pdfLatex keeps accents for converted Uppercase words, although it shouldn't. When compiled with ...
miltos's user avatar
  • 2,450
4 votes
2 answers
126 views

What's the best way to avoid ignoring leading space tokens with arguments of LaTeX commands where command before argument does space-hacking?

In LaTeX there are commands that process arguments but do not produce visible output. For example, the command \label, or, if you use the package color or xcolor, the command \color. When the closing ...
Ulrich Diez's user avatar
  • 27.5k
3 votes
1 answer
215 views

How 'experimental' is \TrimSpaces today?

The documentation of xparse dated 2022-06-22 describes the argument processor TrimSpaces which can be used to remove leading and trailing spaces with example \NewDocumentCommand \foo { > { \...
Thomas F. Sturm's user avatar
5 votes
1 answer
136 views

Unused global option(s) warning with latex 2022-06-01-PL2

I was about to ask this question a few days ago, but at the time the site suggested this question to me and I thought that it is the same problem with mine. But now as PL2 releases, the problem in the ...
Jinwen's user avatar
  • 8,092
4 votes
1 answer
155 views

What causes Unused global option(s) error after updating to latex-base 2022-06-01-PL1?

After applying today's kernel updates (2022-06-01-PL1) it seems loading the doc package now causes an Unused global option(s) warning over options passed to the article document class that was not ...
LaTeXereXeTaL's user avatar
8 votes
3 answers
548 views

How to use equals sign in custom class options?

I have seen package options such as in geometry that allow the user to specify an option with a certain value. For example, \usepackage[margin=1in]{geometry} will use 1in for the left and right ...
btshepard's user avatar
  • 670
4 votes
1 answer
152 views

\IfTargetDateBefore doesn't use dates from \DeclareRelease and \DeclareCurrentRelease

I am a little confused with the rollback mechanism in LaTeX. I want to let users test the future breaking changes of my package and also I want to keep the future changes in the same package file. So ...
L.J.R.'s user avatar
  • 10.6k
3 votes
1 answer
180 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\...
Ruixi Zhang's user avatar
  • 9,483
0 votes
0 answers
144 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\@...
Peter Yang's user avatar
0 votes
0 answers
290 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 ...
apriori's user avatar
  • 943
5 votes
2 answers
297 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} \...
Zvika's user avatar
  • 426
4 votes
1 answer
202 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 ...
RajinCoding2007's user avatar
0 votes
0 answers
84 views

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

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} \...
Kyriacos Xanthos's user avatar
1 vote
0 answers
42 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 ...
schtandard's user avatar
  • 14.6k
8 votes
1 answer
973 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 ...
Puck's user avatar
  • 1,158
2 votes
0 answers
74 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. \...
Ulrich Diez's user avatar
  • 27.5k
1 vote
1 answer
107 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. \...
Ulrich Diez's user avatar
  • 27.5k
3 votes
1 answer
403 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 ...
George's user avatar
  • 31
3 votes
1 answer
310 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
814 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{...
Lele99_DD's user avatar
  • 568
5 votes
2 answers
841 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?
Yorgos's user avatar
  • 2,684
4 votes
2 answers
131 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.) \...
mhchem's user avatar
  • 3,485
3 votes
0 answers
1k 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 ...
Guru's user avatar
  • 31
1 vote
1 answer
120 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-...
scottkosty's user avatar
3 votes
1 answer
135 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 ...
campa's user avatar
  • 29.9k
4 votes
2 answers
259 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: \({\...
John Palmieri's user avatar
1 vote
0 answers
185 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 ...
Denis Bitouzé's user avatar
1 vote
2 answers
236 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 ...
Patrick's user avatar
  • 95
20 votes
3 answers
15k 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 ...
Ulrich's user avatar
  • 897
6 votes
3 answers
267 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\@...
LaTeXereXeTaL's user avatar
1 vote
1 answer
179 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 ...
Diaa's user avatar
  • 9,435
0 votes
1 answer
176 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 \...
LaTeXereXeTaL's user avatar
4 votes
1 answer
490 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: \...
user227621's user avatar

1
2 3 4 5