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
0answers
150 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....
0
votes
1answer
24 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'...
3
votes
1answer
56 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@}% ...
1
vote
1answer
57 views

How to modify \everypar safely in a package?

This is a follow-up to What does the \the\everypar do? and TikZ Overlay: Inject content at the start of the next paragraph? From a quick grep -R '\\everypar' texmf-dist/tex/latex I can see that \...
23
votes
2answers
385 views

What is “latex-dev”?

no answer needed, I'm adding the question as reference The package/update manager of my TeX-system installed in the last weeks a number of packages called latex-XX-dev, and CTAN too shows a number ...
6
votes
2answers
125 views

What's going on with an item that starts with an hbox?

I've been using LaTeX for years and never saw this before: if an item (in enumerate) starts with an \hbox, then the \hbox is placed before the label! \documentclass[12pt]{article} \def\Blank#1{\...
1
vote
0answers
21 views

Error in make htmldocs Linux kernel

I am trying to compile make htmldocs in linux kernel 5.2.2 version. Facing some issues restricted \write18 enabled. entering extended mode Latexmk: Index file 'networking.idx' was written Latexmk: ...
0
votes
0answers
21 views

Multi-page verbatim env changes catcode in footer [duplicate]

If a LaTeX2e environment verbatim spreads two pages, then in the footer of first page, catcode of symbols like $ and _ are changed to 12 (other), as if the whole footer is inside the verbatim env. \...
19
votes
2answers
2k views

Are all commands with an optional argument fragile?

Here is a discussion of fragile command in LaTeX. And it says that any commands that have an optional argument are fragile, for instance \footnote[2]{myfoottext} and \footnot{myotherfoottext}. I have ...
0
votes
1answer
57 views

What is the basic definition of \newcommand?

Awkward it is! I can not find the basic definition of \newcommand, though it is used a million times. I suspect it needs improvement.
0
votes
0answers
51 views

End mark switching fails because \@ifnextchar's behavior in an environment hook is not as naively expected

For the purpose of readability, a proof can be segmented into claims. The proofs of claims (which I will call "reasonings" in the following) are usually "executed" immediately and within the outer ...
13
votes
1answer
150 views

Understanding LaTeX 2e's \@esphack

I'm reading source2e.pdf and I have problems in understanding the sense of the definition of LaTeX 2ε's \@esphack: Commands like \label{...} , which themselves do not/shall not produce ...
1
vote
1answer
277 views

Importing entire R Script file into Latex

Is there a way to import an entire RScript (.R) file into Latex directly without manually using listings and copying the code into Latex?
16
votes
2answers
798 views

Why do people specify date as an option for \usepackage?

In LaTeX code written by other people, I sometimes see a date specified as an optional argument for \usepackage: \usepackage{iftex}[2013/04/04] Intuition tells me that this is some way to ensure ...
0
votes
1answer
671 views

I installed MiKTeX but I can't compile the file

I installed MiKTeX but I can't compile the file. This file worked perfectly on another computer This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6840 64-bit) entering extended mode (...
3
votes
1answer
240 views

how does '\maketitle' work?

I would like to know how the \maketitle command works since I am creating my own class and I want to use my own commands. For example, I already create certain commands like \a, \b and \c and I want ...
6
votes
2answers
345 views

LaTeX newcommand limitation

I want to know the possibilities and the limitation of LaTeX's \newcommand regarding the definition and the use/call of new macros. I know some of these examples are primitive but they can help to ...
1
vote
1answer
35 views

What do the labels (such as <*dircheck>) mean in `source2e.pdf`?

I am studying source2e.pdf and I have encountered something such as <*dircheck>, <*initex>, <*2ekernel>,<latexrelease>. I thought that they might be some sort of label to mark ...
6
votes
1answer
211 views

How does \verb* set the visible space?

I'm trying to understand how \verb* works under the hood, especially where the mapping for the visible space character comes into play. Let's have a look at the definitions first: \verb: macro:->\...
17
votes
3answers
577 views

What macros should be used as 'scratch space'?

The LaTeX kernel provides the 'scratch' macros \@tempa, etc., and \reserved@a, etc. These are used for a variety of purposes. Which should be used as temporary space by general users/programmers?
5
votes
1answer
260 views

Kernel deprecation warning with fnpct

I recently upgraded to TeXLive 2018 (and pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018/W32TeX)) and now I notice that package fnpct generates the following warnings: **************************...
0
votes
1answer
55 views

Circumvent missing dot in hierarchical listing numbering

I'm trying to deal with the same problem as described here. But the accepted answer does not really help in my case since the problem occurs when I try to add hierarchical numbering to listings and I ...
0
votes
1answer
194 views

Error in compiling a file with its own document class using MiKTeX 2.9.6643

I had to re-install MiKTeX version (2.9.6643) after formatting my pc, but when I compiled the file of my dissertation I received these error messages: ! Undefined control sequence. \UseTextAccent ......
0
votes
1answer
208 views

Corrupted nfss table, overfull hbox and undefined control sequence when testing fonts

I just installed texlive and I am running a series of tests recommended in section 3.5 of the official documentation. The tests are working as expected but when I get to testfont.tex I am getting !...
16
votes
1answer
140 views

L(a/ua)TeX kernel/package solution incorporating the globally optimised float placement/pagination

It was interesting to read Frank Mittelbach's articles on globally optimized pagination and float placement. https://www.latex-project.org/publications/ But, there is no mention of these proposed ...
2
votes
1answer
43 views

Comparing package version dates

Is it safe to use the LaTeX commands \@ifpackagelater, \@ifl@t@r and/or \@parse@version to compare/parse dates in the format used with \ProvidesPackage (YYYY/MM/DD)? Or is there a package providing ...
2
votes
1answer
82 views

What does svsec in \@svsec stand for?

Most of the following text you could probably skip. I just put it down there to show my effort. What does it do? Pretty sure I understand this already... In the LaTeX kernel, the generic heading ...
0
votes
2answers
168 views

gdef with @ifnextchar

I am trying to create a command with two or three arguments, that creates a new command. In my classfile I have: \def\foobar#1#2{\gdef\foo{#1, #2, \@ifnextchar\bgroup{foo}{bar}}} If I call \foobar{...
3
votes
1answer
68 views

When defining a new section command/macro, what is causing the \@startsection text to be repeated?

When I try producing a new section command \orangesection, which utilizes the LaTeX kernel command \@startsection, I end up with duplicated text. Where is it coming from? As a bonus, how could I track ...
4
votes
2answers
1k views

Dot between chapter number and figure number disapear after update

After a recent update the dot between chapter numbers and figure numbers disappeared. Here is a minimal example. \documentclass[]{memoir} \begin{document} \frontmatter Some text \mainmatter \chapter{...
8
votes
1answer
333 views

Problem with dtx file after LaTeX kernel upgrade (2018/04/01)

Today, the generation of one of my dtx files stopped with the error: ! Undefined control sequence. \UseTextAccent ...up \@firstofone \let \@curr@enc \cf@...
7
votes
2answers
2k views

What is the difference between \paperheight, \paperwidth and \pdfpageheight, \pdfpagewidth?

I couldn't find any existing answers to this question. So, what's the difference? Are there any advantages to using one duo over the other?
22
votes
1answer
6k views

! LaTeX Error: Command \counterwithout already defined

After updating MikTex up to 09.04.2018 (MikTex 2.9.6637, Win 10, 64bit) I've got the error: (F:\...\texmfs\install\tex\latex\chngcntr\chngcntr.sty ! LaTeX Error: Command \counterwithout already ...
3
votes
2answers
89 views

listings highlight 'escapeinside' causes unexpected line break of user code

I just want to highlight digits for variable initialization, to avoid colored number in equation und variable name,I have used the approach of Jubobs How to highlight all words of the form [0-9][A-Za-...
3
votes
1answer
422 views

How is “! LaTeX Error: Something's wrong--perhaps a missing \item.” produced (technically)?

Lists in LaTeX test for \item before their \end{list}. I want to know the chain of events leading to this error. From my analysis, I came to the following, but got lost at \@noitemerr. Sources ...
11
votes
1answer
288 views

Why does equation environment not give an error without the amsmath package?

As far as I understand the equation environment is defined in the amsmath package so one would expect an error while trying to compile the following document with pdflatex: \documentclass{article} \...
5
votes
1answer
643 views

Definition of \protect in \edef

Update: With the release of LaTeX2e 2018-04-01 Patch level 2, the following sentence has been added in the paragraph cited below to make the documentation clearer: More precisely, whenever the ...
15
votes
4answers
2k views

Why, in 2017, does LaTeX not use tree-like structures? [closed]

Short version Why, in 2017, does LaTeX not use a tree-like structure, and prefer to deal with ugly token rewrite rules? Long version LaTeX was created nearly 35 years ago. Maybe at that time, ...
3
votes
1answer
54 views

Definition of \@vobeyspaces

In section 53.3 of source2e, the macro \@vobeyspaces (one internal macro for verbatim environment) is defined as {\catcode`\ =\active% \gdef\@vobeyspaces{\catcode`\ \active\let \@xobeysp}} Is there ...
3
votes
2answers
119 views

Compiling file places a bunch of commas before the title

I am working on a big project with many subfiles that I wanted to incorporate into one main file. For that, I used the standalone package, to be able to check the individual files for errors, if any ...
1
vote
1answer
168 views

Getting arguments of any LaTeX command

I do not like R and LaTeX. I simply love them. In R, I can get the arguments of any function using args(function_name) on command line. I wonder if we can get the list of all possible arguments of any ...
6
votes
1answer
532 views

How does \@currentlabel work? How does it connect to sectioning commands / headings?

My understanding is that \@currentlabel holds a register value. This also applies when hyperref is used. I was having a look at kpsewhich ltxref.dtx when I read that \@currentlabel handles situations ...
4
votes
2answers
76 views

Why does \@checkend occur after running \endenvironment?

Does anyone know why in the LaTeX definition of \end, the \@checkend command occurs after running the end environment code? It seems like for error catching purposes, it would be best to let the user ...
6
votes
2answers
210 views

Where have the legacy macros gone?

As far as I understand LaTeX is a set of macros built on top of the 300 or so primitive commands of the underlying TeX core. The TeXBook talks about macros like \it and \sl, but I cannot use them in ...
13
votes
4answers
2k views

Why does it seem that font sizes are quantized in typography?

There are several points, especially when using LaTeX, that give me the feeling that the size of a font is not really a continuous quantity, but somehow quantized, i.e. can only take some specific ...
7
votes
1answer
916 views

What are the default values in LaTeX commands or variables

How can I know what is the default value for line spacing in LaTeX (for example what is the default value of \baselinestretch command before renewcommanding it?) and how I can print this value in the ...
4
votes
1answer
832 views

What do \@nil, \@cdr and \@car mean

Today I came across these three commands: \@nil \@cdr \@car Some are mentioned here and here, but I didn't get the idea of it. It seems to have to do with the macro character. I haven't seen any ...
7
votes
1answer
187 views

Double \ProvidesFile in LaTeX kernel. Why?

The LaTeX kernel defines \ProvidesFile twice: 121: \def\ProvidesFile#1{% 122: \begingroup 123: \catcode`\ 10 % 124: \ifnum \endlinechar<256 % 125: \ifnum \endlinechar>\m@ne ...
6
votes
1answer
3k views

Using BibTeX and pdfLaTeX: why are three LaTeX runs needed?

I am able to use BibTeX and pdfLaTeX if I compile with pdfLaTeX THREE TIMES. This seemed absurd, but appears to be confirmed by this previous question. That is: Compile with pdflatex to generate ....
3
votes
1answer
2k views

\contentsline with 4 parameters

I have a document whcih .toc file looks like this: \contentsline {chapter}{Prefácio}{vii}{chapter*.2} \contentsline {chapter}{\numberline {1}História}{1}{chapter.1} \contentsline {chapter}{\...