答案1
\todo
软件包中的默认功能todonotes
与您要求的功能类似,因此如果您尚未使用todonotes
,以下内容可能会有用。
\todo
确实在边注周围画了一个彩色框,但按照如下所示更改bordercolor
和backgroundcolor
会将其删除。
\documentclass{article}
\usepackage[
bordercolor=none,
backgroundcolor=none,
linecolor=gray
]{todonotes}
\begin{document}
Bla bla etc., uzw., osb., Lorem ipsum dolor \todo{Foo bar}{} and so on and so forth.
\end{document}
可以重新定义一些宏来获得更像图像的输出。
\documentclass{article}
\usepackage[
bordercolor=none,
backgroundcolor=none,
linecolor=gray
]{todonotes}
\usetikzlibrary{arrows.meta}
\tikzset{
smallcirc/.tip={Circle[width=2pt,length=2pt]},
% connectstyle is used for the line drawing to the marginnote,
% add the arrow tip on each end, and make it thin
connectstyle/.append style={smallcirc-smallcirc,thin}
}
\makeatletter
\renewcommand{\@todonotes@drawLineToRightMargin}{%
\begin{tikzpicture}[remember picture, overlay]%
\draw[connectstyle]%
(inText) -- ([yshift=-0.2cm] inText)% %% <--- added "(intext) --"
-| (inNote.west);% %% <--- removed "-| ([xshift=-0.2cm] inNote.west)"
\end{tikzpicture}%
}%
\renewcommand{\@todonotes@drawLineToLeftMargin}{%
\begin{tikzpicture}[remember picture, overlay]%
\draw[connectstyle]%
(inText) -- ([yshift=-0.2cm] inText)% %% <--- added "(intext) --"
-| (inNote.west);% %% <--- removed "-| ([xshift=-0.2cm] inNote.west)"
\end{tikzpicture}%
}%
\makeatother
\begin{document}
Bla bla etc., uzw., osb., Lorem ipsum dolor \todo{Foo bar}{} and so on and so forth.
\end{document}