Package todonotes

Issue #121 resolved
Peter B. created an issue

Hello, when using the package todonotes the result is not as desired:

Steps: - Use freshly downloaded Classic Thesis Template (version 4.2) - \usepackage{todonotes} - in the document use \todo{I a an example todo}

Expected: - a orange box which is put into the margins on the left/right side of the page

Seen instead: - two orange boxes (each with the content) + displayed inline, not in the free space on the sides

Version: - Classic Thesis: 4.2 - OS: OS X

If there are any further uncertainties I will be happy to resolve them

Comments (12)

  1. Ivo Pletikosić

    From their manual, section 1.6.10: The problem is caused by the redefinition of \marginpar in classicthesis.sty. \marginpar is used by todonotes. It can be fixed by restoring the original meaning, if you don’t need the classicthesis marginpar style. Just add this to your document preamble: \let\marginpar\oldmarginpar (after loading classicthesis!)

    If you want to use classicthesis-styled margin notes in parallel, use the old command \graffito.

  2. Peter B. reporter

    If it is not redefined it would be great to add to the default pdf that you need to do the above mentioned to make it work

  3. Ivo Pletikosić

    It's our fault, we impolitely redefined \marginpar as if it was a one-parameter macro. \marginpar is a LaTeX primitive command with zero parameters instead, and only takes parameters by swallowing them through internal macros. We switched from \graffito to \marginpar on my request because that was the easiest way to enable classicthesis-styled margin notes in LyX. Here's more on this issue: http://tex.stackexchange.com/questions/58263/text-style-for-marginpar What we could do is:

    \usepackage{xparse}
    \let\oldmarginpar\marginpar
    \RenewDocumentCommand{\marginpar}{om}{%
      \IfNoValueTF{#1}
        {\oldmarginpar[\graffito@setup\raggedleft\hspace{0pt}#2]{\graffito@setup\raggedright\hspace{0pt}#2}}
        {\oldmarginpar[#1]{#2}}}
    

    by egreg's suggestion. Going back to \graffito shouldn't be impossible either, even though it might be somewhat confusing.

  4. Ivo Pletikosić

    A less fancy solution, using no LaTeX3 features, that we should probably switch to is:

    \let\originalmarginpar=\marginpar
    \renewcommand{\marginpar}[2][]{%always add optional parameter, make it empty by default
    \if\relax\detokenize{#1}\relax %optional parameter empty, normal document call
    \originalmarginpar[\graffito@setup\raggedleft\hspace{0pt}#2]{\graffito@setup\raggedright\hspace{0pt}#2}
    \else %two parameters, let them use their styling
    \originalmarginpar[#1]{#2}
    \fi
    }
    

    This way, \marginpar{beautiful} will produce a classicthesis-styled margin note, while \marginpar[]{}, used by other packages, will not include classicthesis formatting.

  5. Alejandro Alcalde

    Hi, I am facing the same problem. What would you recommend at the moment? Add \let\marginpar\oldmarginpar and then replacing marginpar with graffito?

    Best regards and congratulations for such a beautiful template.

  6. Alejandro Alcalde

    Hi, thank you.

    Right now it's working with \let\marginpar\oldmarginpar and using graffito instead of marginpar.

    I'll wait until that classicthesis.sty merges into the master branch.

    Best regards

  7. André Miede repo owner

    marginpar can take two arguments, it was wrongly redefined and we are correcting it; when called with two, no classicthesis formatting is applied. see issue 121

    → <<cset a199f2c0c382>>

  8. Log in to comment