Package todonotes
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)
-
-
- changed status to resolved
todonotes depends on unstyled marginpar
-
reporter Thank you very much!
-
repo owner - changed status to open
Maybe we should also re-think this re-definition from our side...
-
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
-
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.
-
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.
-
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.
-
Even though it's an unofficial and testing only version, I'd recommend you try classicthesis.sty from https://bitbucket.org/amiede/classicthesis/src/e021994394ffe06a5a0033924cd63e1d3db2841f?at=MayPI. I know for sure that todonotes works with the changes introduced there.
-
Hi, thank you.
Right now it's working with
\let\marginpar\oldmarginpar
and usinggraffito
instead ofmarginpar
.I'll wait until that classicthesis.sty merges into the master branch.
Best regards
-
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>>
-
repo owner - changed status to resolved
Fixed in next release (4.4).
- Log in to comment
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.