我正在尝试使用边距并面临一些问题。
我无法用 marginpar 开始段落,我必须添加虚拟空间 \hspace{0pt}。否则,它将与上一段对齐。还有其他方法可以解决这个问题吗?
我分别定义了
\lnote
和\rnote
和 来\reversemarginpar
切换\normalmarginpar
边距的两侧。但是,它们需要用空行分隔,否则lnote
将改为\normalmarginpar
。由于有空行, 和rnote
未与段落对齐。有什么办法可以解决这个问题吗?切换
\reversemarginpar
并使\normalmarginpar
todonotes 相互重叠。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}