Closing square bracket in math mode in marginpar

Issue #143 resolved
Philipp Schaber created an issue

Hello,

with the latest version of classicthesis (4.4, as of 2017-10-13), I noticed a bug (presumably) with the marginpar command. If a closing squared bracket in placed in a marginpar in math mode, LaTeX complains about an extra '}' or a forgotten '$'. With the previous version of classicthesis, this error does not occur.

Here is a MWE to reproduce the problem:

\documentclass{article}

\usepackage[american]{babel}
\usepackage{classicthesis} 

\begin{document}
\marginpar{Closing square bracket in math mode $]$}%
Closing square bracket in math mode $]$
\end{document}

I am using texlive 2017 on a Windows machine.

Thanks for looking into this, and especially for your time and dedication to classicthesis. The postcard will be sent as soon as I hand in my thesis :)

Philipp

Comments (5)

  1. Ivo Pletikosić

    Thanks Philipp, it's a nice find. We did change the redefinition of \marginpar in v4.4. Your ']' is making the optional argument close before it's supposed to. We'll need to change classicthesis.sty and use

    \oldmarginpar[\graffito@setup\raggedleft\hspace{0pt}{#2}]{\graffito@setup\raggedright\hspace{0pt}#2}
    

    instead of

    \oldmarginpar[\graffito@setup\raggedleft\hspace{0pt}#2]{\graffito@setup\raggedright\hspace{0pt}#2}
    

    Looks like this is the best we can do: https://tex.stackexchange.com/questions/398366/

    Feel free to fix your own copy before our next bugfix release. I hope this won't affect too many people.

  2. Log in to comment