Questions tagged [macros]
{macros} is for questions specifically concerning TeX's macro processor. Note that, because TeX uses macros ubiquitously, most questions about code that uses macros are not looking for information about how macros work, and so are not appropriate for this tag.
8,303
questions
270
votes
3
answers
76k
views
What is the difference between \let and \def?
What is the difference between the \let and \def commands in TeX/LaTeX?
Ideally please provide a simple example that will illustrate the difference between them.
95
votes
6
answers
8k
views
Which document class is being used?
Is there a way to programmatically determine which document class is in effect?
I'd like to be able to write conditional macros that behave differently depending on which document class is currently ...
5
votes
2
answers
257
views
Need macro to ignore specific even-numbered inputs
My document consists (among other things) of blocks that look like this:
\begin{Solution}{6.7.8,1.2.3}
...
\end{Solution}
or
\begin{Solution}{,1.2.3}
...
\end{Solution}
I would like to define ...
45
votes
8
answers
4k
views
How can I specify a long list of math operators?
The preambles of my LaTeX documents often include many many lines of \DeclareMathOperator instructions, e.g.
\DeclareMathOperator{\Rep}{Rep}
\DeclareMathOperator{\Tet}{Tet}
\DeclareMathOperator{\Maps}...
9
votes
2
answers
3k
views
Automatically define macros in LyX documents
I'm using LyX all the time and over the last 2 years I've accumulated some very handy macros for my lecture notes. As it is today, every time I start a new document, I copy and paste the macros from ...
186
votes
4
answers
632k
views
\vspace vs. \vskip [duplicate]
What is the difference between \vspace{-1em} and \vskip -1em, for example? I guess the first is LaTeX, and the latter is TeX. When is the proper time to use one and not the other, and why?
5
votes
3
answers
902
views
Writing bold small caps with mathpazo package
The URW Palldio font (mathpazo package) does not provide bold small caps. To get round this issue, I'd want to make a macro to use small caps usually and normal caps in bold text.
I tried this code:
...
640
votes
12
answers
223k
views
Space after LaTeX commands
I have a definition:
\newcommand{\arnold}{Arnold Schwarzenegger}
When I refer to it by:
\arnold is a
it is rendered as:
Arnold Schwarzeneggeris a
In order to have a space in front of "is" I ...