包含多个段落的旁注

包含多个段落的旁注

我正在尝试使用旁注包,并且它似乎不支持多段旁注。

例如,下面的文档不能编译:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{sidenotes}
\begin{document}

Here is some content.\sidenote{And it has a sidenote.

This sidenote has multiple paragraphs.}

\end{document}

通过 pdflatex 运行时出现以下错误:

Runaway argument?
{\@sidenotes@placemarginal {-NoValue-}{\textsuperscript {\thesidenote \ETC.
! Paragraph ended before \IfNoValueOrEmptyTF  was complete.
<to be read again>
                   \par
l.8 This sidenote has multiple paragraphs.}

(如果将“sidenote”替换为“footnote”,则效果如预期)

我认为这是预期的行为,而不仅仅是我做错了什么,尽管如果是后者我会很高兴。

是否有任何解决方法,或者有具有类似功能的 sidenotes 包的替代品?

答案1

这看起来像是一个错误,该包+m对用户命令使用参数类型(允许段落),但仅m在某些内部命令中使用。您应该报告这一点。作为一种解决方法,您可以使用以下方法\endgraf来避免错误:

\documentclass{article}
\usepackage{sidenotes}


\begin{document}

Here is some content.\sidenote{And it has a sidenote.
\endgraf
This sidenote has multiple paragraphs.}

\end{document}

答案2

这似乎有效;如果您想要一个空白行,您可能需要一种解决方法,例如通过某种盒子机制:

在此处输入图片描述

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{sidenotes}
\begin{document}

Here is some content.\sidenote{And it has a sidenote.\\
This sidenote has multiple paragraphs.} Some more text:

Related 
Replacing footnotes with sidenotes in Classicthesis
sidenotes package not working with oneside option in book
sidenotes package : error in figure alignment
Wrong position of caption in odd page with sidenotes in figure*


\end{document}

PS:效果有些令人怀疑。因此有两个版本,一个没有新段落,一个有新段落:

没有

Here is some content.\sidenote{And it has also a  sn. This sn has multiple paragraphs.} Some more text:

和

Here is some content.\sidenote{And it has also a  sn.\\This sn has multiple paragraphs.} Some more text:

相关内容