Linked Questions

7
votes
1answer
1k views

Using square bracket inside square bracket [duplicate]

I have a two-column layout, and I want to put a specific section with images to span the whole page width. So I use: \twocolumn[ ... ] So far, so good. However, when I want to include anything in ...
3
votes
1answer
2k views

Square brackets in in the `description' of the theorem environment [duplicate]

The following code works fine \begin{theorem}[Euler] Blah \end{theorem} But whenever I try to use square brackets in the description I get an error. \begin{theorem}[The set $[0, 1]$ is compact] ...
3
votes
1answer
728 views

How to temporarily disable a comment delimiter when using listings [duplicate]

In the preamble of my document, I put the following command to allow strings wrapped with < and > printed as italic-styled comment: \lstset{morecomment=[s]{<}{>},commentstyle=\rmfamily\...
1
vote
1answer
169 views

Issue Passing an Optional Argument through Theorem Name with thmtools [duplicate]

I am using thmtools to create theorems, and I sometimes want the theorem name to include math symbols. In this particular project, I have used xargs to create a command that uses an optional argument, ...
0
votes
1answer
96 views

Error when using ] in item title with math mode [duplicate]

I am getting the error ! Extra }, or forgotten $. \sbox ...hbox {\color@setgroup #2\color@endgroup } l.6 \item[$] $] ! LaTeX Error: Something's wrong--perhaps a missing \item. With the MWB ...
2
votes
0answers
116 views

Biblatex citations inside KOMA-script's dictum [duplicate]

I would like to use biblatex (specifically, biblatex-chicago) to cite an author inside the \dictum command of scrbook. Here's my MWE, which produces some errors. \documentclass{scrbook} \usepackage{...
0
votes
0answers
34 views

How to use equation containing "]" in optional argument? [duplicate]

When I try to use a command like \begin{theorem}[Something $x[y]$ something], I get an "extra } or forgotten $ error message". It seems like the ] in the equation is closing the optional argument even ...
1
vote
0answers
28 views

Why do I get an "extra }" error when using a default argument in a theorem name? [duplicate]

Consider the following latex code: \documentclass{article} \usepackage{amssymb} \usepackage{amsthm} \newtheorem{thm}{Theorem} \newcommand{\Zn}[1][n]{\mathbb{Z}_{#1}} \begin{document} $\Zn[p]$ \...
1
vote
0answers
26 views

Problem with IfStrEqCase? [duplicate]

I am using \IfStrEqCase to choose between various options within an environment. In the MWE below, if the line with the actions to be performed for any non-recognised option (\ifqsbreak{}.....\fi) is ...
1
vote
0answers
16 views

Alternative section title using multicol [duplicate]

Compiling the following documents throws an error: "! Paragraph ended before \@sect was complete." I just want to add an alternative name to the table of contents and have no idea why this should be a ...
1
vote
0answers
10 views

Error when citing definitions [duplicate]

I'm looking to cite the source of a definition, but there seems to be a bug. An example of something I'm looking to type: \begin{definition}[\cite[Definition 1.4.2]{Hilbert10}] content \end{...
-26
votes
2answers
2k views

Stringified commands to macros sequence [closed]

First, what is the proper terminology for a "string" in TeX/LaTeX that is an argument for a macro? e.g., \macro{somestring} Obviously somestring is a token, set of tokens, string, argument, etc. I ...
12
votes
2answers
6k views

LaTeX: optional arguments with square brackets

LaTeX is trying to add a missing $ that I don't want to the following code. Minimal working example: \documentclass[letter,12pt]{article} \newcommand{\monkeyBeans}[2][]{ \parbox{4in}{#1} } \begin{...
19
votes
1answer
1k views

Bug? LaTeX misparses nested optional arguments

LaTeX seems to be having problems handling nested optional arguments. I've included a minimal code example that generates the error: \documentclass[12pt,oneside]{book} \begin{document} \newcommand{\...
4
votes
3answers
205 views

Macro to be used in a \section command that has no effect in the table of contents

I need a macro that is executed only in the main document (within a section title) and then disappears (for the table of contents). A minimal example where this occurs is this: \documentclass[12pt]{...

15 30 50 per page