todonotes icon indicating copy to clipboard operation
todonotes copied to clipboard

dvistyle: centering gets into the note

Open ghost opened this issue 3 years ago • 2 comments

Feeding

\documentclass{article}
\pagestyle{empty}
\usepackage{lipsum}
\usepackage[dvistyle]{todonotes}
\begin{document}
\centering
\todo[inline]{\lipsum[1]}
\end{document}

to (pdf)latex results in mwe So, the contents of the box also gets centered with its surroundings. Could we make the dvistyle option produce the same justification kind (inherited from the surroundings or justified) as without this option?

ghost avatar Mar 07 '22 19:03 ghost

Thanks for the description of the issue. The dvistyle option was added long time ago to fix a rendering issue related to the .tex -> .dvi -> .pdf processing pipeline. I would prefer not to change that much in the dvistyle option.

To get the requested behaviour, I think it would be easier to create a new command partly based on the internal commands in the todonotes package (for puttings things in the list of todos) and then define your own layout code.

henrikmidtiby avatar Mar 09 '22 09:03 henrikmidtiby

@henrikmidtiby Thank you for a quick reaction. I use the dvistyle option if my source happens to be processed with programs latex and dvips via the path .tex -> .dvi -> .ps. (The test is done as usual via \ifpdf. Without the dvistyle option, I recall having run into issues in this path some time ago; if you are interested, please say so, and then I'll try to reproduce.) I doubt that many users would be affected; I believe that an inline todo note when the surrounded text is centred is rare. I have this situation only when I need to attach a todo note to a figure with centred contents, and there, it makes sense to have the same output (centred or justified) with the dvistyle option in the Postscript output as without this option in the PDF output. The dvistyle option elsewhere seems rarely used; here is what I get on my computer with Debian TeXLive:

root@hostname:/# ugrep -r -z dvistyle /usr /lib /etc 2>>/dev/null
/usr/share/texlive/texmf-dist/tex/lualatex/luatodonotes/luatodonotes.sty:\DeclareOptionX{dvistyle}{\PackageWarningNoLine{luatodonotes}
/usr/share/texlive/texmf-dist/tex/lualatex/luatodonotes/luatodonotes.sty:    {Parameter dvistyle is not supported by luatodonotes.
/usr/share/texlive/texmf-dist/tex/latex/todonotes/todonotes.sty:\DeclareOptionX{dvistyle}{\@todonotes@dviStyletrue}

Searching for the usage of dvistyle on the Web spits out no real usage examples at all. As for creating a new command: after having looked into todonotes.sty, I doubt I'm able to do that easily myself.

ghost avatar Mar 09 '22 16:03 ghost