边注与段落顶部对齐

边注与段落顶部对齐

当我将边距置于段落开头之外时,LaTeX 会假定它位于前一段的末尾。我希望边距注释与所在段落的顶部对齐。它似乎单个注释可以实现这一点。如何才能全局实现这一点,而不必将边注放在段落文本内。遵循 MWE:

\documentclass{article}
\usepackage{lipsum}
\begin{document}

\marginpar{some note} This is what it should look like in the source code. \lipsum[1]

\marginpar{another note} Good in source code, but bad in PDF. \lipsum[2]

Cluttered\marginpar{yet another note}source code, but produces desired effect in PDF. \lipsum[3]

\leavevmode\marginpar{individual solution to be implemented globally} Would be nice, you know. \lipsum[4]

\end{document}

编辑:

我尝试过\newcommand

\newcommand*{\annot}[1]{
    \leavevmode\marginpar{#1}}
}

\annot{margintext}Text.

会产生额外的缩进,所以这不是解决方案的结束。实际上,这是需要修复的。

相关内容