我使用,它在内部使用,在页边空白处排版“脚注” memoir
。我对与 结合使用时的结果非常满意,但有一件事我不知道如何实现。虽然我不介意将脚注在页面上上下移动以便为其他脚注腾出空间,但有一种特殊的脚注我不希望移动:在特殊章节的开头,我在页边空白处有相关的引文,我希望它们保持在调用的位置。我不介意脚注在页边空白处在这些引文的上方或下方移动,但我不希望引文移动。\footnotesinmargin
\marginpar
marginfix
\marginpar
\marginpar
例如,在以下代码的情况下,我希望脚注 1 在两个引号之间移动,这样它就不会推动第二个引号。
\documentclass{memoir}
\footnotesinmargin
\usepackage{marginfix}
\setlength{\marginposadjustment}{2pt}
\newcommand{\specialquote}{\marginpar}
\usepackage{lipsum}
\begin{document}
\chapter{Capitulum primum}
\lipsum[1][1-3]
\section{A very important section}
\leavevmode\specialquote{Here is a quote that looks just fine.\par\raggedleft– A. Einstein}%
\lipsum[2]
\section{Another very important section}
\leavevmode\specialquote{Alas! This quote is too high.\par\raggedleft– M. Twain}%
\lipsum[3][1-6]%
\footnote{\lipsum[4][1-3]}
\lipsum[5][1-6]%
\footnote{\lipsum[6][1-10]}
\lipsum[7]
\end{document}
我猜这可以通过使用\marginphantom
和定义\specialquote
为来完成\marginnote
,但随后必须计算文本的高度,我相信有一个更简单,更优雅的解决方案。
谢谢!
答案1
memoir
's在调用宏的地方放上margin,并且不动\sidepar{<text>}
。<text>
我尝试过,但只能得出部分答案。以下 MWE 中展示了各种尝试,其中确实将引文和脚注分开。
% sidenotesprob.tex SE 604614
\documentclass{memoir}
\footnotesinmargin
\sidefootmargin{right}
\sidefootmargin{left} % seems to have no effect
%% get a reasonable result without marginfix (except that side footnotes can extend below the type area)
%\usepackage{marginfix} \setlength{\marginposadjustment}{2pt}
\newcommand{\specialquote}{\marginpar}
\renewcommand{\specialquote}{\sidepar} %% use \sidepar instead of \marginpar
\sideparmargin{right}
%\sideparmargin{left} % puts text in left margin
\usepackage{lipsum}
\begin{document}
\chapter{Capitulum primum}
\lipsum[1][1-3]
\section{A very important section}
\leavevmode\specialquote{Here is a quote that looks just fine.\par\raggedleft– A. Einstein}%
\lipsum[2]
\section{Another very important section}
\leavevmode\specialquote{Alas! This quote is too high.\par\raggedleft– M. Twain}%
\lipsum[3][1-6]%
\footnote{\lipsum[4][1-3]}
\lipsum[5][1-6]%
\footnote{\lipsum[6][1-10]}
\lipsum[7]
\end{document}
您可以尝试将引文和脚注放在不同的页边距中。我怀疑,要完全满足您的期望,需要彻底重新编码页边距注释,我不会尝试这样做;也许其他人会这样做。
编辑
正如我上面所说的,如果不对 LaTeX 的边注代码进行重大修改,我根本不确定您的问题是否可以得到解决。
不过,我认为也许您可以使用\epigraph
宏来将您的引文放在主文本块中,这样就不会干扰任何边注。memoir
有关详细信息,请参阅手册。
% sidenotesprob2.tex SE 604614
\documentclass{memoir}
\footnotesinmargin
%\sidefootmargin{right}
%\sidefootmargin{left} % seems to have no effect
%% get a reasonable result without marginfix (except that side footnotes can extend below the type area)
\usepackage{marginfix} \setlength{\marginposadjustment}{2pt}
\newcommand{\specialquote}{\marginpar}
%\renewcommand{\specialquote}{\sidepar} %% use \sidepar instead of \marginpar
%\sideparmargin{right}
%\sideparmargin{left} % puts text in left margin
\usepackage{lipsum}
\begin{document}
\chapter{Capitulum primum}
\lipsum[1][1-3]
\section{A very important section}
%%%% use \epigraph instead of
%\leavevmode\specialquote{Here is a quote that looks just fine.\par\raggedleft– A. Einstein}%
\epigraph{Here is a quote that looks just fine.}{A. Einstein}%
\lipsum[2]
\section{Another very important section}
%\leavevmode\specialquote{Alas! This quote is too high.\par\raggedleft– M. Twain}%
\epigraph{Alas! This quote is too high.}{M. Twain}%
\lipsum[3][1-6]%
\footnote{\lipsum[4][1-3]}
\lipsum[5][1-6]%
\footnote{\lipsum[6][1-10]}
\lipsum[7]
\end{document}
答案2
经过一番尝试,我发现我上面提出的解决方案实施起来并不麻烦。如果你们有更好的解决方案或改进方法,我很乐意听听
答案3
在需要时它会\tikzmark
自动使用\extendmargin
。需要运行两次才能通过辅助文件传递位置信息。
注意:添加\tikz[overlay]
将自动离开 vmode(如\hbox{}
)。
\documentclass{memoir}
\footnotesinmargin
\usepackage{marginfix}
\setlength{\marginposadjustment}{2pt}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\newcounter{specialquote}
\renewcommand{\thespecialquote}{\roman{specialquote}}
\makeatletter
\newcommand{\specialquote}[1]{\stepcounter{specialquote}%
\tikz[overlay,remember picture]{\path (pic cs:SQ\thespecialquote);
\pgfgetlastxy{\xloc}{\yloc}%
\global\let\SQoffset=\yloc}%
\marginpar{\tikzmark{SQ\thespecialquote}#1}%
\@ifundefined{SQ\thespecialquote}{}{\ifdim\SQoffset>2pt\relax% margin of error
\pgfmathsetlengthmacro{\SQoffset}{\SQoffset+\csname SQ\thespecialquote\endcsname}%
\else
\expandafter\let\expandafter\SQoffset\csname SQ\thespecialquote\endcsname
\fi}%
\ifdim\SQoffset>0pt\relax
\extendmargin{\SQoffset}%
\immediate\write\@auxout{\string\xdef\expandafter\string\csname SQ\thespecialquote\endcsname{\SQoffset}}%
\fi}
\makeatother
\usepackage{lipsum}
\begin{document}
\chapter{Capitulum primum}
\lipsum[1][1-3]
\section{A very important section}
\specialquote{Here is a quote that looks just fine.\par\raggedleft– A. Einstein}%
\lipsum[2]
\section{Another very important section}
\specialquote{Alas! This quote is too high.\par\raggedleft– M. Twain}%
\lipsum[3][1-6]%
\footnote{\lipsum[4][1-3]}
\lipsum[5][1-6]%
\footnote{\lipsum[6][1-10]}
\lipsum[7]
\end{document}