From b5ea6386cd4758dcbb2e9dd369b985026e9d4faf Mon Sep 17 00:00:00 2001 From: Daniel Krenn Date: Mon, 26 Mar 2018 14:54:31 +0200 Subject: [PATCH] parameter inlinepar --- todonotes.dtx | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/todonotes.dtx b/todonotes.dtx index dd307b9..fe4163e 100644 --- a/todonotes.dtx +++ b/todonotes.dtx @@ -1515,6 +1515,13 @@ \define@key{todonotes}% {inlinewidth}{\renewcommand{\@todonotes@inlinewidth}{#1}} % \end{macrocode} +% Change if inline note is written to a separate line or not. +% \begin{macrocode} +\newif\if@todonotes@inlinepar +\@todonotes@inlinepartrue +\define@key{todonotes}{inlinepar}[]{\@todonotes@inlinepartrue}% +\define@key{todonotes}{noinlinepar}[]{\@todonotes@inlineparfalse}% +% \end{macrocode} % Preset values of the options % \begin{macrocode} \presetkeys% @@ -1531,7 +1538,8 @@ figheight=\@todonotes@figheight,% figcolor=\@todonotes@figcolor,% line, list, size=\@todonotes@textsize, - inlinewidth=\linewidth}{}% + inlinewidth=\linewidth, + inlinepar}{}% % \end{macrocode} % \subsection{The main code part} % Here is the actual macros defined. @@ -1691,24 +1699,32 @@ % \begin{macrocode} \newcommand{\@todonotes@drawInlineNote}{% \if@todonotes@dviStyle% - {\par\noindent\begin{tikzpicture}[remember picture]% - \draw node[inlinenotestyle] {};\end{tikzpicture}\par}% + {\if@todonotes@inlinepar\par\noindent\fi% + \begin{tikzpicture}[remember picture]% + \draw node[inlinenotestyle] {}; + \end{tikzpicture}% + \if@todonotes@inlinepar\par\fi}% \if@todonotes@authorgiven% {\noindent \@todonotes@sizecommand \@todonotes@author:\,\@todonotes@text}% \else% {\noindent \@todonotes@sizecommand \@todonotes@text}% \fi - {\par\noindent\begin{tikzpicture}[remember picture]% - \draw node[inlinenotestyle] {};\end{tikzpicture}\par}% + {\if@todonotes@inlinepar\par\noindent\fi% + \begin{tikzpicture}[remember picture]% + \draw node[inlinenotestyle] {}; + \end{tikzpicture}% + \if@todonotes@inlinepar\par\fi}% \else% - {\par\noindent\begin{tikzpicture}[remember picture]% + {\if@todonotes@inlinepar\par\noindent\fi% + \begin{tikzpicture}[remember picture]% \draw node[inlinenotestyle,font=\@todonotes@sizecommand]{% \if@todonotes@authorgiven% {\noindent \@todonotes@sizecommand \@todonotes@author:\,\@todonotes@text}% \else% {\noindent \@todonotes@sizecommand \@todonotes@text}% \fi};% - \end{tikzpicture}\par}% + \end{tikzpicture}% + \if@todonotes@inlinepar\par\fi}% \fi}% % \end{macrocode} % \end{macro}