我有一个半行距的文档,我想在其中添加边注,这些边注也应该是单行距。请参见以下示例:
\documentclass[a4paper,oneside,11pt]{article}
\usepackage[onehalfspacing]{setspace}
\usepackage{marginnote}
\newcommand{\sspmarginnote}[1]{\marginnote{\singlespacing #1}}
\begin{document}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
At vero eos et accusam et justo duo dolores et ea rebum.
\sspmarginnote{Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat}
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
At vero eos et accusam et justo duo dolores et ea rebum.
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{document}
如您所见,纸条从发行点下方开始。我通过插入一些任意负空间来解决这个问题:
\newcommand{\sspmarginnote}[1]{%
\marginnote{\vspace{-2\baselineskip}\singlespacing #1}
}
但我可以想象,不希望的垂直偏移因情况而异。所以这个修复不是一个真正的选择。你会如何正确地做到这一点?
答案1
我觉得这个方法很稳定。试一试:
% arara: pdflatex
\documentclass[a4paper,oneside,11pt]{article}
\usepackage[onehalfspacing]{setspace}
\usepackage{ragged2e}
\usepackage{microtype}
\usepackage{marginnote}
\newcommand{\sspmarginnote}[1]{\marginnote{\begin{spacing}{1}\vspace{-\baselineskip}\RaggedRight #1\end{spacing}}}
\begin{document}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
\sspmarginnote{Duis au-tem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat}
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{document}