是否可以让 todonotes 包使用 pagetrim 之外的边距来草拟笔记?

是否可以让 todonotes 包使用 pagetrim 之外的边距来草拟笔记?

手册中memoir有一个用于制作草稿笔记的片段,当在比裁切纸张更大的页面上打印草稿时,它会使用整张纸张。是否可以让软件包中更精美的笔记todonotes也使用该边距空间?我认为本例中品红色上的白色可读性要高得多,我也非常喜欢软件包提供的线条todonotes

如果该todonotes软件包无法实现这一点,还有其他方法可以实现我梦想的行为吗?:)

\documentclass[svgnames,showtrims, 10pt, draft]{memoir}

\usepackage[textsize=small, linecolor=magenta, bordercolor=magenta,
            backgroundcolor=magenta]{todonotes}
\usepackage{letltxmacro}
\usepackage{lipsum}

\LetLtxMacro{\oldtodo}{\todo}
\renewcommand{\todo}[1]{{\color{white}\oldtodo{\textsf{#1}}}}

\stockaiv
\settrims{30mm}{25mm}
\trimFrame
\settrimmedsize{242mm}{165mm}{*}
\settypeblocksize{*}{25pc}{1.618}
\setlrmargins{*}{*}{1.5}
\setulmarginsandblock{5.5pc}{6pc}{*}
\setcolsepandrule{1pc}{0pt}
\setmarginnotes{12pt}{6pc}{24pt}
\setsidecaps{2pt}{6.5pc}
\sidecapmargin{outer}
\sideparmargin{outer}
\strictpagecheck
\checkandfixthelayout

%% A new command that allows you to note down ideas or annotations in
%% the margin of the draft. If you are printing on a stock that is wider
%% than the final page width, we will go to some length to utilise the
%% paper that would otherwise be trimmed away, assuming you will not be
%% trimming the draft. These notes will not be printed when we are not
%% in draft mode.
\makeatletter
\ifdraftdoc
\newlength{\draftnotewidth}
\newlength{\draftnotesignwidth}
\newcommand{\draftnote}[1]{\@bsphack%
{%% do not interfere with settings for other marginal notes
\strictpagecheck%
\checkoddpage%
\setlength{\draftnotewidth}{\foremargin}%
\addtolength{\draftnotewidth}{\trimedge}%
\addtolength{\draftnotewidth}{-3\marginparsep}%
\ifoddpage
\setlength{\marginparwidth}{\draftnotewidth}%
\marginpar{\flushleft\textbf{\textit{\HUGE !\ }}\small #1}%
\else
\settowidth{\draftnotesignwidth}{\textbf{\textit{\HUGE\ !}}}%
\addtolength{\draftnotewidth}{-\draftnotesignwidth}%
\marginpar{\raggedleft\makebox[0pt][r]{%% hack around
\parbox[t]{\draftnotewidth}{%%%%%%%%% funny behaviour
\raggedleft\small\hspace{0pt}#1%
}}\textbf{\textit{\HUGE\ !}}%
}%
\fi
}\@esphack}
\else
\newcommand{\draftnote}[1]{\@bsphack\@esphack}
\fi
\makeatother

\begin{document}
\section*{Lorem ipsum}%
\sidepar{\textit{Lorem ipsum dolor sit amet}}
\lipsum[1]
\todo{Fix the: Nam dui ligula, fringilla}
\lipsum[2]
\draftnote{Fix the: Nulla malesuada porttitor diam}
\lipsum[3-5]
\sidepar{\textit{Lorem ipsum dolor sit amet}}
\lipsum[6]
\todo{Fix the: Nam dui ligula, fringilla}
\lipsum[7]
\draftnote{Fix the: Nulla malesuada porttitor diam}
\lipsum[8]
\end{document}

在此处输入图片描述


编辑:

  • 添加更多内容使其成为两页
  • 添加\sidepar以显示非草稿注释的边注应位于修剪页面上

答案1

您可以使用包textwidth的选项todonotes来指定边距注释的大小。通常只需在页面设置后增加 marginpars 的大小memoir,但如果您不想更改该尺寸,可以重写todo包中的一些内部内容,隐藏注释的宽度todo

示例输出

\documentclass[svgnames,showtrims, 10pt, draft]{memoir}

\usepackage[textsize=small, linecolor=magenta, bordercolor=magenta,
            backgroundcolor=magenta, textwidth=5cm]{todonotes}
\usepackage{letltxmacro}
\usepackage{lipsum}

\LetLtxMacro{\oldtodo}{\todo}
\renewcommand{\todo}[1]{{\color{white}\oldtodo{\textsf{#1}}}}

\stockaiv
\settrims{30mm}{25mm}
\trimFrame
\settrimmedsize{242mm}{165mm}{*}
\settypeblocksize{*}{25pc}{1.618}
\setlrmargins{*}{*}{1.5}
\setulmarginsandblock{5.5pc}{6pc}{*}
\setcolsepandrule{1pc}{0pt}
\setmarginnotes{12pt}{6pc}{24pt}
\setsidecaps{2pt}{6.5pc}
\sidecapmargin{outer}
\sideparmargin{outer}
\strictpagecheck
\checkandfixthelayout

\makeatletter
\renewcommand{\@todonotes@drawMarginNoteWithLine}{%
\begin{tikzpicture}[remember picture, overlay, baseline=-0.75ex]%
    \node [coordinate] (inText) {};%
\end{tikzpicture}%
\marginpar[{% Draw note in left margin
    \@todonotes@drawMarginNote{r}%
    \@todonotes@drawLineToLeftMargin%
}]{% Draw note in right margin
    \@todonotes@drawMarginNote{l}%
    \@todonotes@drawLineToRightMargin%
}%
}
\renewcommand{\@todonotes@drawMarginNote}[1]{
    \makebox[\marginparwidth][#1]{\begin{tikzpicture}[remember picture,baseline=(X.base)]%
        \node(X){\vphantom{X}};%
        \draw node[notestyle,font=\@todonotes@sizecommand,anchor=north] (inNote) at (X.north)%
            {\@todonotes@text};%
        \if@todonotes@authorgiven%
            \draw node[notestyle,font=\@todonotes@sizecommand,anchor=north] (inNote) at (X.north)%
                {\@todonotes@sizecommand\@todonotes@author};%
            \node(Y)[below=of X]{};%
            \draw node[notestyle,font=\@todonotes@sizecommand,anchor=north] (inNote) at (X.south)%
                {\@todonotes@text};%
        \else%
            \draw node[notestyle,font=\@todonotes@sizecommand,anchor=north] (inNote) at (X.north)%
                {\@todonotes@text};%
        \fi%
    \end{tikzpicture}%
}}
\makeatother

\begin{document}
\section*{Lorem ipsum}
\sidepar{\textit{Lorem ipsum dolor sit amet}}
\lipsum[1]
\todo{Fix the: Nam dui ligula, fringilla}
\lipsum[2]
\todo{Fix the: Nulla malesuada porttitor diam}
\lipsum[3-5]
\sidepar{\textit{Lorem ipsum dolor sit amet}}
\lipsum[6]
\todo{Fix the: Nam dui ligula, fringilla}
\lipsum[7]
\todo{Fix the: Nulla malesuada porttitor diam}
\lipsum[8]
\end{document}

相关内容