Linked Questions

45 votes
1 answer
4k views

] inside an optional argument

I accidentally discovered (here) that a closing square bracket within an optional argument delimited by [ ] can cause problems. Here is example code illustrating the issue: \documentclass{article} \...
Lover of Structure's user avatar
15 votes
2 answers
8k views

LaTeX: optional arguments with square brackets [duplicate]

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{...
Kyle's user avatar
  • 381
7 votes
1 answer
2k views

natbib citep[]{} error if used in theorem options [duplicate]

I am using natbib and amsthm. If I use \citep[Thm. 4.5]{key} in the options of my theorem environment I get the error: Argument of \NAT@@citetp has an extra }. \begin{thm}[\citep[Thm] Why can't I ...
DerJFK's user avatar
  • 463
3 votes
2 answers
185 views

Syntax issue with optional argument inside optional argument [duplicate]

The following source gives the expected results, as shown: \documentclass[12pt]{article} \usepackage{amsmath} \usepackage{xstring} \usepackage[refpage,nocfg]{nomencl} \renewcommand*{\...
murray's user avatar
  • 7,904
4 votes
1 answer
106 views

Russian matryoshka doll of optional arguments [duplicate]

Why this not work. I suspect an expansion problem ... \documentclass{standalone} \newcommand{\foo}[1][foo]{#1} \newcommand{\Fbox}[1][bla]{\fbox{#1}} \begin{document} \Fbox[\foo[bla]] \end{...
Tarass's user avatar
  • 16.9k
1 vote
0 answers
466 views

Square brackets as label in tikzcd [duplicate]

I found that I could not use square brackets as label of arrow when using tikz-cd package to draw commutative diagram. A MWE: \documentclass{article} \usepackage{tikz-cd} \begin{document} \...
Doug Liu's user avatar
  • 155
0 votes
0 answers
437 views

Scaling a graphics leads to an error [duplicate]

I have the following problem: I want to attach a photo in my resume on the right top. If I not use a scale argument, the file compiles but the photo is to large. However using a scale argument leads ...
m. th's user avatar
  • 777
0 votes
0 answers
242 views

Using math expression in short caption for listoffigures [duplicate]

\documentclass[12pt,a4paper]{article} \usepackage{amsmath} \begin{document} \listoffigures \[ \{[\phi(t+h),p(t+h)]_2\} \] \begin{figure}[htb] \centering something here \caption[math $x+...
Chen Stats Yu's user avatar
1 vote
1 answer
149 views

Why does “displayquote” break when citing with an optional argument and how to fix it? [duplicate]

If you use the optional argument of “displayquote” from “csquotes” it breaks the “displayquote” environment's optional argument, where you are supposed to put in a cite text. This is really not a ...
rugk's user avatar
  • 1,090
0 votes
0 answers
93 views

Indexing and \footcite prenotes [duplicate]

I am indexing a big latex project (with xindy). I use biblatex for the bibliography and the command \footcite for the references. Sometimes, I write long prenotes which contain some words to be ...
Texxet's user avatar
  • 145
2 votes
0 answers
84 views

lipsum as a caption for subfloat [duplicate]

Consider this script: \documentclass{report} \usepackage{subfig} \usepackage{graphicx} \usepackage{lipsum} \begin{document} \begin{figure}[htp] \subfloat[\lipsum[1]]{ \includegraphics{example-...
Viesturs's user avatar
  • 7,795
7 votes
1 answer
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 ...
please delete me's user avatar
9 votes
2 answers
414 views

How do I nest a command with an optional argument? [duplicate]

I'm having problems making a normalizer command that can nest. Here is my code so far: \documentclass{article} \newcommand{\nrml}[2][]{N_{#1}(#2)} \begin{document} $\nrml[\nrml{H}]{J}$ \end{document}...
Abe Schulte's user avatar
1 vote
1 answer
3k views

Trouble with displayquote and page numbers for citations

I have a problem trying to get a citekey to work properly in a blockcitation. I have a nested file setup via the subfiles package and using csquotes to generate the block quote as follows: In the ...
Bartuc's user avatar
  • 287
3 votes
1 answer
1k views

Flexible \IfStrEqCase statement

I am trying to use xstring's \IfStrEqCase to switch between cases. It seems to work fine except for the case where the parameter for the switch is a macro with an optional parameter: \MySwitch{$\...
Peter Grill's user avatar

15 30 50 per page