Linked Questions

77
votes
1answer
41k views

What is the purpose of \protect? [duplicate]

Possible Duplicate: What is the difference between Fragile and Robust commands? I've never understood the purpose of the command \protect? When and why should it be used?
0
votes
1answer
40 views

How can I use \dbox in a caption? [duplicate]

I’m trying to use a \dbox from the dashbox package in the caption of a figure, like this: \documentclass{article} \usepackage{dashbox} \begin{document} \begin{figure} \centering Imagine ...
80
votes
16answers
3k views

What needs to be introduced in a short introduction to LaTeX?

One of the things listed at the How you can help in the TeX community page of the TUG website is: We'd like to have an ‘introduction to LaTeX’ document that falls somewhere between the brevity of ...
45
votes
1answer
7k views

Using TikZ inside a figure caption

I have a PNG plot with a couple of black patches in it, and I'd like to refer to it in the \caption of the figure. According to the TikZ manual, I'd have to \tikz \fill[black] (1ex,1ex) circle (1ex); ...
33
votes
1answer
1k views

What does “expanding” mean in (La)TeX?

You can often read about expanding a macro or when a macro does expand, sometimes about expansion. But what does this mean - in English?
24
votes
2answers
2k views

Minimal \protected@edef example

I recently came across \protected@edef in the/a LaTeX2e source. Can anyone give me a minimal or simple example, where I need this? I know this has to do with fragile commands/robustness, but I am ...
13
votes
5answers
3k views

Reference to the Table of Contents page

I thought that someone must have asked this, but my searches didn't find it. I am looking to refer back to the table of contents from places in my document. How can I do this?
24
votes
1answer
10k views

LaTeX - Different section names in TOC from body

Sorry if this question already appears elsewhere, I couldn't find it. Is there a way to label a section in the text but give it a different name in the table of contents? I have very long section ...
26
votes
1answer
13k views

Argument of \caption@ydblarg has an extra }

A misleading error message from the following code: \documentclass{article} \usepackage{graphicx} \usepackage{subfig} \begin{document} \begin{figure}[!ht] \centering% \subfloat[]{ \label{...
21
votes
2answers
292 views

\( \) don't work with TOC?

If I write this line of code \subsection{Ranger \( n \) boules distinguables dans \( M \) boîtes} I obtain an error over the second \) (./Probabilité.toc ./Probabilité.toc:8: LaTeX Error: Bad math ...
8
votes
2answers
2k views

\thesection (and related) must be fragile?

I think the answer to my question lies somewhere in this thread, but I can't quite find it, and it seems to me that I'm asking the reverse of the question first posed in that thread. In any case... I'...
8
votes
2answers
3k views

Error with \newcommand and \section

I'm trying to typeset an article. In the preamble, I defined these two things: \newcommand{\leftexp}[2]{{\vphantom{#2}}^{#1}{#2}} \newcommand{\hr}{\leftexp{*}{\mathbb{R}}} However, when I try to ...
5
votes
4answers
679 views

Non-italic (roman) subscripts in math mode

Is there a way to set indices (subscripts) to non-italic globally? I'm aware of the case by case X_{\text{text goes here}} But I'm having to change that across a whole document is becoming a pain.
27
votes
1answer
2k views

Why use \DeclareTextFontCommand vs. just \newcommand?

Why should I use \DeclareTextFontCommand vs. just \newcommand? In the answer to my previous question, @egreg said: With \DeclareTextFontCommand you get a robust command that will remain ...
6
votes
3answers
1k views

Using \total of totcount package in section title

I am keeping track of all the journal papers I review, and of course I'm using LaTeX. There are different journals I review for and I have different tables and counters keeping track of papers. Each ...

15 30 50 per page