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

learn more… | top users | synonyms (1)

19
votes
1answer
272 views

Where can I find the definitions of TeX environments?

As can be seen by my comments here, here and here, I'm currently trying to find out how to see the definitions of environments, but I felt that a new question would be responded to quicker. I want to ...
0
votes
0answers
31 views

BasicTeX 4mac unfindable

From tug.org, I've installed twice the BasicTeX program but I don't find it any more on my computer, even after switching it off. I have the last MacBook and I work on Yosemite. Are there some codes ...
12
votes
0answers
164 views

Should \minipage restore the default definition of \@par?

I came across the issue hinted at in the title while I was reflecting on this question (“Irregular spacing around a user-defined environment”) and its answer. The \@endparenv command is called by ...
1
vote
0answers
23 views

How to add co-chair by using \thesissupervisor

I would like to have the name of chairs in my dissertation thesis in following way. Professor A, Chair Professor B, Co-Chair If I use \renewcommand{\thesissupervisor}{Professor A, Chair \\ ...
13
votes
1answer
123 views

\@clubpenalty leaks out

In the following example the value of \clubpenalty has been reset to the one of \@clubpenalty on the second page: \documentclass[]{book} \usepackage{lipsum} \begin{document} \subsection{abc} blblb ...
1
vote
1answer
89 views

Encode into an `enumerate` environment

I am convinced that I need to encode lists that I have in various files in enumerate environments. I have taken a sample of them and put them into one file, which I include in this post. It looks ...
5
votes
1answer
220 views

Automatically run code at end of file

In typical LaTeX documents, the document content is typed inside the document environment, which is usually the last thing in the file: \documentclass{article} \begin{document} Content goes here....
23
votes
1answer
670 views

What packages are no longer necessary after TeX Live 2015 kernel update?

I see from this question that fixltx2e is no longer needed. This means the LaTeX kernel now finally has a \textsubscript command. Formerly that was provided by fixltx2e and also by the subscript ...
2
votes
1answer
250 views

Latex \newcommand usage

I would like to simplify the way to type indicator functions. So I used package bbm and defined \newcommand{\1}{\mathbbm{1}} But I actually want something like \mathbbm{1}_{XXX}=\newcommand{1}{XXX}. ...
9
votes
2answers
1k views

What is a macro, really?

From the list of catcodes, \ starts a new control sequence, { starts a group, and } ends a group. In LaTeX, a macro appears as \foo[opt-arg]{arg1}{arg2} However, TeX does not seem to have the ...
33
votes
3answers
808 views

Do fontsize environments exist?

Without any doubt there are fontsize switches in the form of control sequences (described here for instance.) But, from time to time I ran into code examples where environment versions of those were ...
4
votes
0answers
47 views

What does `\escapechar` do? [duplicate]

In latex.ltx you can find several situations where \escapechar is set to -1 -- from what it's clear that it has to be a count register. But, what does it actually "count" or control? A small ...
7
votes
2answers
148 views

Where is \@makefntext defined?

I was studying how footnotes come about in LaTeX and what processes exactly run behind the curtain, and noticed \@makefntext. But in fact, in latex.ltx there are only two occurences of this macro ...
11
votes
1answer
291 views

Why the new changes to LaTeX kernel breaks zref-perpage package?

Consider the following minimal example: \documentclass{book} \usepackage{zref-perpage} \zmakeperpage{footnote} \begin{document} \chapter{Test} \footnote{A footnote} \footnote{A footnote} \newpage \...
11
votes
1answer
265 views

Can one safely redefine \jobname?

I want to access labels from an external document -- in general this is not a problem with the xr package. But in this case both documents are compiled on sharelatex, and there \jobname is always set ...
11
votes
1answer
388 views

what is the equivalent of \reserveinserts in latex 2015

The release 2015 of LaTeX has included features of the etex.sty package. However, it does not have included the \reserveinserts command. My questions is very simple: what is the mechanism to use to ...
23
votes
3answers
2k views

Where is the LaTeX manual?

Helpful members of the community just solved my problem with \newcommand: What's wrong with my newcommand? But in trying to solve it, I got an error message referring to p. 192 of "the manual". ...
17
votes
2answers
500 views

! Corrupted NFSS tables

Update The LaTeX-bug described in this question has been resolved. With the new LaTeX in TeXlive 2015 (tested on 2015-05-14) there is no longer an error. Original Question The following code gives ...
1
vote
1answer
152 views

How to write totally expanded macro to file (with LaTeX kernel)

I want to write value of the macro \@authortofile to a file. Inside the macro it is another macro which is defined as separator between some words: \def\@separator{\def\@separator{, }} When I try ...
3
votes
0answers
69 views

Undefine a command in LaTeX [duplicate]

LaTeX, of course, has a protective mechanism that prevents you from doing some stupid things: \newcommand\a{a} \newcommand\a{b} %% LaTeX Error: Command \a already defined. Of course, if you know ...
5
votes
1answer
844 views

What do \@mkboth and \markboth do?

What do the toc related commands \@mkboth and \markboth do?
1
vote
1answer
214 views

What is LaTeX's \if@nobreak mechanism for and how does it work?

many LaTeX sectioning-related commands have a block in manipulating the \@nobreak flag. Taking the following example for the sake of example: \begingroup \parindent \z@ \rightskip \@pnumwidth \...
24
votes
1answer
586 views

Why is the .toc file created at end document?

To create a Table of Contents (for example), LaTeX2e follows the process: Run 1 .aux file is created from scratch after \begin{document}. When processing section headers, write \addtocontents to ...
9
votes
1answer
268 views

Is there a generic dummy command?

I would like to add in the title field of some bib entries a dummy command which I can redefine to force e.g. a linebreak in certain cases. I need a command which normally doesn't do anything, doesn't ...
30
votes
1answer
576 views

What is .tex file in TeX Live for?

If I run kpsewhich .tex I get /usr/local/texlive/2013/texmf-dist/tex/latex/tools/.tex This file belongs to LaTeX core files and is nearly empty: %% %% This is file `.tex', %% generated with the ...
28
votes
1answer
293 views

Which primitives does LaTeX2e rename/move?

TeX's primitives can be renamed by macro formats/packages: this allows new/altered features or behaviours. Usually this is done such that the originals are still available ('renamed'): certainly ...
16
votes
1answer
337 views

Why is there a \null in \verb?

In source2e.pdf, the definition of \verb is \def\verb{\relax\ifmmode\hbox\else\leavevmode\null\fi \bgroup \verb@eol@error \let\do\@makeother \dospecials \verbatim@font\@noligs \@ifstar\@...
5
votes
2answers
101 views

Does the LaTeX kernel define font-shape macros that expand to `it', `sc', etc.?

I need to perform a test on the current font shape. More specifically, I need to detect whether the current font shape is italic or slanted. Joseph Wright already provided a solution in his answer to ...
1
vote
0answers
206 views

Reference of Latex/Plain Tex control sequences [closed]

I'm looking for a reference of the control sequences defined in Latex and plain Tex similar to this one for the build-in primitives. The Texbook states that there are about 600 macros in plain Tex. ...
16
votes
2answers
867 views

What's the meaning of the macro `\m@th`?

I found this macro from Voss' Math mode v2.47, page 21: \makeatletter \newif\if@borderstar \def\bordermatrix{\@ifnextchar*{% \@borderstartrue\@bordermatrix@i}{\@borderstarfalse\@bordermatrix@i*}% ...
17
votes
2answers
260 views

\@ifnextchar's twin in the kernel

In latex.ltx you can find \let\kernel@ifnextchar\@ifnextchar What was this needed for?
0
votes
1answer
79 views

Vertically centering page with @texttop and @textbottom

I am trying to use \@texttop and \@textbottom to vertically center a page in a manner similar to Use of \@texttop and \@textbottom for vertical positioning. Everything works fine if I do \...
4
votes
1answer
359 views

Documentation of LaTeX2e source

Where are the best places to look if one would like to understand the LaTeX2e source code? Related: Comprehensive online manual for LaTeX2e user macros and environments Are there guidelines on how ...
3
votes
1answer
161 views

Setting initial value of a storage macro

When I create a "storage macro" I often initialize it to be empty with \newcommand{\@mymacro}{} \newcommand{\mymacro}[1]{\renewcommand{\@mymacro}{#1}} Instead of initializing it to empty I could do ...
3
votes
0answers
117 views

Value from LaTeX package to plain TeX [closed]

If I say \usepackage{lastpage} I got \xdef\lastpage@lastpage{53} at the end of .aux-file. I tested and \xdef\sometest@sometest{53} \newcount\tmp \advance\tmp \sometest@sometest \relax \advance\tmp -...
9
votes
2answers
1k views

What the first argument for `\l@subsection` actually is?

Consider for example the code \makeatletter \renewcommand{\l@subsection}[2]{\@dottedtocline{2}{1.6em}{1.6em}{\S#1}{#2}} \makeatother It allows me to obtain in my table of contents records ...
8
votes
1answer
153 views

What's the differences between the kernel commands \trivlist and \list?

LaTeX defines the two environments \trivlist and \list. Both can be used creating own environments. What exactly is the differences between \trivlist and \list?
23
votes
2answers
648 views

Redefining \include

A puzzling choice made by Leslie Lamport was to define \include in such a way as to issue a \clearpage before reading the file. This has been puzzling me for sometime as it is not a very good choice ...
9
votes
1answer
185 views

LaTeX2e \makebox !=\hbox?

The source2e documentation (pg. 233) when describing \makebox states: ... If wid  is missing, then pos is also missing and obj  is put in an \hbox of its natural width... This, ...
9
votes
1answer
456 views

Strange behaviour with \AtEndDocument

I'm creating a document class that has draft and final versions. The final version has a front page generated by \maketitle, but in draft mode \maketitle is \let to \relax. I decided to insert a test ...
13
votes
2answers
378 views

Why is \thepage set to \relax in a \protected@write?

In the kernel the definition of protected@write includes the setting of the \thepage to \relax. Why is this and are there other means to ensure that thepage is not expanded? \long\def \protected@...
8
votes
1answer
1k views

Why does LaTeX make \DeclareMathSymbol and \DeclareSymbolFont preamble-only?

Is there any good and convincing reason to explain why LaTeX restricts usage of \DeclareSymbolFont and \DeclareMathSymbol to the preamble? and I could also ask the question for many other macros. ...
28
votes
3answers
2k views

@tempdima, reserved@a, @tempcnta, what else?

I'm aware that some "temporary" LaTeX dimensions etc. exist. I would, however, like to know all of them. I know \reserved@a (macro), \@tempdima (dimension) and \@tempcnta (counter).
9
votes
1answer
114 views

\@ifnextchar inside pmatrix?

I created a function which handles a superscript followed after the function. I do that by using \@ifnextchar^. Everything works well, except in any pmatrix environment. Why? As a quick-and-dirty ...
12
votes
1answer
310 views

Counters and their “partners”

A counter created via \newcounter{<counter>} is stored internally as \c@<counter>, just like a reference made using \label{<label>} is stored internally using \r@<label>. What'...
6
votes
1answer
269 views

Some assignments in the definition of \parbox

Why are these assignments necessary in the LaTeX's definition of \parbox? \let\hss\vss\let\unhbox\unvbox EDIT I should have added that I wondered if the assignments will affect any in-parbox calls ...
9
votes
4answers
161 views

Restore the original array code

The arraypackage redefines array in various ways. I was woundering if anyone had made a package containing a localized (prefixed) version of the kernel array? I have a document were we have a simple ...
10
votes
3answers
1k views

Are commands defined by \newcommand[.][.]{.} robust?

This question is from the comments at the foot of Abbreviations for AM, PM (small caps) for use within \textbf. Readers will get the remaining gist from there. With \newcommand\cmd[2][0]{\def\y{#1}...
23
votes
6answers
1k views

\@ifnextchar and friends documentation

While reading this question and its answers I tried to find where, for instance, \@ifnextchar is documented. I'm afraid I couldn't... I looked in TeX: The Program and TeX for the Impatient which can ...
44
votes
2answers
4k views

Understanding \@ifnextchar

I understand the definitions of the \makeatletter and \makeatother commands and also \def and \newcommand somewhat. But, explained in a simple way, what is happening in the following line? \@...