Skip to main content

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.

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.
bryn's user avatar
  • 10.4k
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 ...
Kim Morrison's user avatar
  • 7,723
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 ...
rogerl's user avatar
  • 3,633
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}...
Kim Morrison's user avatar
  • 7,723
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 ...
Amir Rachum's user avatar
  • 4,503
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?
Geoff's user avatar
  • 3,841
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: ...
user avatar
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 ...
Kaarel's user avatar
  • 6,501

15 30 50 per page
1
550 551 552 553
554