我有一个基于回忆录的双栏双面文档类,其中宽边距始终位于左侧。我希望\marginpar
始终位于此左侧边距中,无论它是从左栏还是右栏调用。现在它始终位于最靠近该栏的边距中。
这是一个简单的例子:
\documentclass[twoside,twocolumn,openright]{memoir}
\usepackage{kantlipsum}
\setmarginnotes{1cm}{4cm}{0mm}
\settypeblocksize{20cm}{14cm}{*}
\setlrmargins{6cm}{*}{*}
% Fix the margin to the left
\checkandfixthelayout
\setlength{\evensidemargin}{\oddsidemargin}
\begin{document}
A first line in the first column.
\marginpar{I'd like this to be on the left, and it is.}
\kant[1-3]
Another line in the second column.
\marginpar{I'd like this to be on the left as well, but it's not!}
\kant[4-7]
\end{document}
使用\marginparmargin
不会改变任何东西,对于双列文档也不应该改变。文档memoir
说明如下:
\Xmargin{⟨placement⟩}
可能的位置:左、右、外、内双栏文件如果将票据放在第一栏,则在左侧,否则在右侧,无论文件是单面还是双面,也无论用户选择如何
是否有一种解决方法可以让我把所有内容都放在\marginpar
左侧?
我需要保留twoside
模板其他元素的选项。
答案1
自 texlive 2018 版起进行了必要的更新
在memoir
课堂上,对于两列文档,\marginparmargin{placement}
对用创建的注释没有影响,\marginpar
因此我们使用包\marginnote
中的命令marginnote
。
\documentclass[twoside,twocolumn,openright]{memoir}
\usepackage{kantlipsum,xcolor}
\usepackage{marginnote} % <-------------
\setmarginnotes{1cm}{4cm}{0mm}
\settypeblocksize{20cm}{14cm}{*}
\setlrmargins{6cm}{*}{*}
% Fix the margin to the left
\checkandfixthelayout
\setlength{\evensidemargin}{\oddsidemargin}
\newcommand*{\redtext}{\textcolor{red}{margin note inserted here}}
\marginparmargin{left} % <--------------
\begin{document}
\redtext
%
\marginnote{I'd like this to be on the left, and it is.}
\kant[1-3]
\redtext
\marginnote{I'd like this to be on the left as well, but it's not!}
\kant[4-5]
\redtext
\marginnote{I'd like this to be on the left, and it is.}
\kant[6]
\redtext
\marginnote{I'd like this to be on the left as well, but it's not!}
\kant[7]
\end{document}
以下内容仅适用于 2017 版之前的 texlive
但是,对于两列双面文档,如果我们使用,\marginparmargin{left}
我们会将所有奇数页边距注释定位在左侧,而所有偶数页边距注释定位在右侧,无论从哪一列调用\marginnote
,反之亦然,如果我们使用\marginparmargin{right}
。
所以我们必须\marginparmargin{left}
对奇数页使用,\marginparmargin{right}
对偶数页使用
因此,解决方案可以是定义一个
\newcommand*{\mymarginpar}[1]{
\checkoddpage
\ifoddpage
\marginparmargin{left}
\else
\marginparmargin{right}
\fi
\marginnote{#1}}
截至 2017 年的 texlive 版本的 MWE
\documentclass[twoside,twocolumn,openright]{memoir}
\usepackage{kantlipsum,xcolor}
\usepackage{marginnote} % <-------------
\setmarginnotes{1cm}{4cm}{0mm}
\settypeblocksize{20cm}{14cm}{*}
\setlrmargins{6cm}{*}{*}
% Fix the margin to the left
\checkandfixthelayout
\setlength{\evensidemargin}{\oddsidemargin}
\newcommand*{\mymarginpar}[1]{ % <----------
\checkoddpage
\ifoddpage
\marginparmargin{left}
\else
\marginparmargin{right}
\fi
\marginnote{#1}
}
\newcommand*{\redtext}{\textcolor{red}{margin note inserted here}}
\begin{document}
\redtext
%
\mymarginpar{I'd like this to be on the left, and it is.}
\kant[1-3]
\redtext
\mymarginpar{I'd like this to be on the left as well, but it's not!}
\kant[4-5]
\redtext
\mymarginpar{I'd like this to be on the left, and it is.}
\kant[6]
\redtext
\mymarginpar{I'd like this to be on the left as well, but it's not!}
\kant[7]
\end{document}