总结:类似于脚注,但在侧面(容易的部分)。这些笔记必须与其参考点位于同一页面上,因此每当笔记中断时“正文”也需要中断。
我正在尝试制作类似这样的东西:
我一直在使用memoir
。这是我的一个想法。我的理解是\footnote
创建一个浮动,它会尝试将自己放置在最近页面的底部。是否可以将“脚注锚点”放置在其他地方?例如,使用一些有趣的页面几何图形,如下所示:
困难的部分在于问题标题:确保分页符尊重列与列的对齐。
这是一个 MWE。
\documentclass{memoir}
% geometry stuff here
\begin{document}
Blind Text
Lorem ipsum dolor sit amet. \columnnote{This is the first ``footnote.''}
The quick brown fox jumped over the lazy dog. \columnnote{This is the second ``footnote.''}
\end{document}
答案1
这将使用整个右列从上到下书写注释。分页是使用辅助文件和完成的\everypar
。
不用说,这种方法会与任何使用\everypar
(在paracol
环境内)的包相冲突。
\documentclass{memoir}
\usepackage{xcolor}
\usepackage{paracol}
\usepackage{lipsum}
\newcommand{\darkmark}[1]% #1 = text to write white on black background
{\rlap{\rule[-.2\baselineskip]{\bibindent}{\baselineskip}}%
\makebox[\bibindent]{\color{white}#1}}
% global registers
\newcounter{abortparagraph}% incremet for every aborted paragraph
\newcounter{columnnote}[chapter]
\globalcounter{columnnote}% synchronized across columns
\newlength{\columnheight}% space used for column notes
\newlength{\columnroom}% available space for column notes
\newif\ifparagraphaborted% ignore extra everypar after abort
\newcommand{\leftcolumnpage}{}% reserve global names
\newcommand{\rightcolumnpage}{}% for page synchronization
% move current paragraph to next page
\newcommand{\newabortparagraph}[1]% #1 = \theparagraph, #2 = \thepage
{\stepcounter{abortparagraph}%
\global\expandafter\def\csname abortparagraph\arabic{abortparagraph}\endcsname{#1}}
\makeatletter
\newcommand{\abortparagraph}% \everypar
{\ifparagraphaborted% ignore extra everypar after abort
\global\paragraphabortedfalse
\else
\global\edef\leftcolumnpage{\arabic{page}}%
\stepcounter{paragraph}%
\bgroup% in case \tempa and \tempb previously used
\@ifundefined{abortparagraph\arabic{abortparagraph}}{}%
{\edef\tempa{\csname abortparagraph\arabic{abortparagraph}\endcsname}%
\edef\tempb{\theparagraph}%
\ifx\tempa\tempb% compare strings
\strut\newpage
\stepcounter{abortparagraph}%
\global\paragraphabortedtrue
\fi}%
\egroup
\fi}
% synchronize pages
\newcommand{\columnnotepage}[2]% #1 = label, #2 = \thepage
{\global\expandafter\def\csname columnnotepage#1\endcsname{#2}}
% redefine paracol environment start
\let\oldparacol=\paracol
\renewcommand{\paracol}[1]{\oldparacol{#1}%
\everypar{\abortparagraph}%
\setlength{\columnheight}{0pt}%
\setlength{\columnroom}{\@colroom}%
\global\edef\leftcolumnpage{\arabic{page}}%
\global\edef\rightcolumnpage{\arabic{page}}%
}
% write notes in right column
\newcommand{\columnnote}[1]% #1 = text for second column
{\refstepcounter{columnnote}%
\darkmark{\thecolumnnote}%
\@ifundefined{columnnotepage\thechapter.\thecolumnnote}{}%
{\def\leftcolumnpage{\csname columnnotepage\thechapter.\thecolumnnote\endcsname}}%
\ifnum\rightcolumnpage<\leftcolumnpage\relax% synchronize pages
\global\columnroom=\textheight
\global\columnheight=0pt
\switchcolumn[1]%
\loop\ifnum\c@page<\leftcolumnpage \strut\newpage\repeat
\global\edef\rightcolumnpage{\arabic{page}}%
\switchcolumn[0]%
\fi
\bgroup% compute size of note
\setbox0=\hbox{\begin{minipage}{\dimexpr \columnwidth-\bibindent}#1\end{minipage}}%
\global\advance\columnheight by \dimexpr \baselineskip + \ht0 + \dp0\relax
\egroup
\ifdim\columnheight>\columnroom\relax% time to break page
\immediate\write\@auxout{\string\newabortparagraph {\theparagraph}}%
\switchcolumn[1]%
\strut\newpage%
\global\edef\rightcolumnpage{\arabic{page}}
\switchcolumn[0]%
\global\columnroom=\textheight
\bgroup% re-compute size of note
\setbox0=\hbox{\begin{minipage}{\dimexpr \columnwidth-\bibindent}#1\end{minipage}}%
\global\columnheight=\dimexpr \baselineskip + \ht0 + \dp0\relax
\egroup
\else
\immediate\write\@auxout{\string\columnnotepage {\thechapter.\thecolumnnote}{\thepage}}%
\fi
\switchcolumn[1]%
\noindent\hspace{\bibindent}%
\begin{minipage}{\dimexpr \columnwidth-\bibindent}%
\mbox{\llap{\darkmark{\thecolumnnote}}%
\color{lightgray}\rule[-0.2\baselineskip]{\textwidth}{\baselineskip}}%
\linebreak#1\end{minipage}%
\linebreak\vspace{\marginparpush}%
\switchcolumn[0]%
\global\advance\columnheight by \marginparpush%
}
\makeatother
\begin{document}
\setcounter{abortparagraph}{1}% reuse counter after aux file read
\chapter{One}
\begin{paracol}{2}
Blind text.
Lorem ipsum dolor sit amet. \columnnote{This is the first ``footnote.''}
The quick brown fox jumped over the lazy dog. \columnnote{This is the second ``footnote.''}
Too big for the page. \columnnote{\rule{1pt}{.9\textheight}}
Next paragraph.
\end{paracol}
\end{document}
应该注意的是,它\switchcolumn
也不会同步页面。这必须单独完成。请注意,\thepage
当段落分为两页时,它是不可靠的,因此它们会保存到辅助文件中。此外,必须小心不要同步中止的段落,因为它们每次都必须无法通过测试。