todonotes 文本重叠和垂直间距问题

todonotes 文本重叠和垂直间距问题

我正在尝试使用边距并面临一些问题。

  1. 我无法用 marginpar 开始段落,我必须添加虚拟空间 \hspace{0pt}。否则,它将与上一段对齐。还有其他方法可以解决这个问题吗?

  2. 我分别定义了\lnote\rnote和 来\reversemarginpar切换\normalmarginpar边距的两侧。但是,它们需要用空行分隔,否则lnote将改为\normalmarginpar。由于有空行, 和rnote未与段落对齐。有什么办法可以解决这个问题吗?

  3. 切换\reversemarginpar并使\normalmarginpartodonotes 相互重叠。todonotes 中没有允许 v-offset 的选项。您知道如何解决这个问题吗?在此处输入图片描述

\documentclass{article}
\usepackage{hyperref}
\usepackage{xcolor}
\usepackage[backgroundcolor=white]{todonotes}

\newcommand{\lnote}[1]{\hspace{0pt}\reversemarginpar\marginpar{\raggedleft #1}\ignorespaces}
\newcommand{\rnote}[2][noline]{\normalmarginpar\todo[#1]{#2}}

\begin{document}
\lnote{\textbf{Photosynthesis}} Photosynthesis is a process used by plants and other organisms to convert light energy into chemical energy. 

\rnote{For more information, see \href{https://en.wikipedia.org/wiki/Photosynthesis}{\textcolor{blue}{here}}}

\lnote{\textbf{Glycolysis}} Glycolysis is the metabolic pathway that converts glucose into energy.

\rnote{For more information, see \href{https://en.wikipedia.org/wiki/Glycolysis}{\textcolor{blue}{here}}}

\end{document}

谢谢你!

答案1

通过定制description环境,您可以实现以下目标:

在此处输入图片描述

\documentclass{article}
\usepackage{hyperref}
\usepackage{xcolor}
\usepackage{enumitem}
\usepackage[backgroundcolor=white]{todonotes}

\newcommand{\lnote}[1]{\hspace{0pt}\reversemarginpar\marginpar{\raggedleft #1}\ignorespaces}
\newcommand{\rnote}[2][noline]{\normalmarginpar\todo[#1]{#2}}

\begin{document}

\begin{description}[itemindent=0mm, labelsep=3mm, align=right,parsep=\baselineskip]
    \item[Photosynthesis]\rnote{For more information, see \href{https://en.wikipedia.org/wiki/Photosynthesis}{\textcolor{blue}{here}}} Photosynthesis is a process used by plants and other organisms to convert light energy into chemical energy.
    \item[Glycolysis]\rnote{For more information, see \href{https://en.wikipedia.org/wiki/Glycolysis}{\textcolor{blue}{here}}} Glycolysis is the metabolic pathway that converts glucose into energy. 
\end{description}

\end{document}

相关内容