我想知道如何在 todonotes 中使用单倍行距(\singlespacing),考虑到 Elsarticle 类,因为我总是收到有关段落的错误消息?
以下是一个最小的例子:
%!Tex: LuaLaTeX
\documentclass[review,authoryear,3p]{elsarticle}
\usepackage{lipsum,setspace}
\usepackage[textwidth=1.7cm]{todonotes}
\journal{TUG}
\begin{document}
\begin{frontmatter}
\title{Doubt about LaTeX\tnoteref{Nota1}}
\tnotetext[Nota1]{This document was a collaborative effort.}
\author[Add1]{John Smith}
\ead{[email protected]}
\address[Add1]{TUG University}
\cortext[cor1]{Corresponding author}
\begin{abstract}
\lipsum[1]
\end{abstract}
\begin{keyword}
First word\sep Second word.
\end{keyword}
\end{frontmatter}
\section{Introduction}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus at sapien vitae sapien ultricies sodales\todo{\tiny {\singlespacing Vivamus orci dui, posuere et suscipit placerat.}}.
Curabitur quam elit, tempus ut fringilla et, luctus sit amet nisl. Suspendisse mi odio, elementum quis blandit non, efficitur nec orci. Vivamus ullamcorper id justo quis posuere\todo{\tiny {\begin{spacing}{0.5} Vivamus orci dui, posuere et suscipit placerat.\end{spacing}}}.
\end{document}
答案1
否setspace
:只需使用,但记得在末尾\linespread{1}
添加,否则段落将设置为正常基线跳过。\par
\documentclass[review,authoryear,3p]{elsarticle}
\usepackage{lipsum}
\usepackage[textwidth=1.7cm]{todonotes}
\journal{TUG}
\begin{document}
\begin{frontmatter}
\title{Doubt about LaTeX\tnoteref{Nota1}}
\tnotetext[Nota1]{This document was a collaborative effort.}
\author[Add1]{John Smith}
\ead{[email protected]}
\address[Add1]{TUG University}
\cortext[cor1]{Corresponding author}
\begin{abstract}
\lipsum[1]
\end{abstract}
\begin{keyword}
First word\sep Second word.
\end{keyword}
\end{frontmatter}
\section{Introduction}
Lorem ipsum dolor sit amet, consectetur adipiscing
elit. Phasellus at sapien vitae sapien ultricies
sodales\todo{\linespread{1}\tiny Vivamus orci dui, posuere et suscipit placerat.\par}.
Curabitur quam elit, tempus ut fringilla et, luctus sit
amet nisl. Suspendisse mi odio, elementum quis blandit
non, efficitur nec orci. Vivamus ullamcorper id justo quis
posuere\todo{\linespread{1}\tiny Vivamus orci dui, posuere et suscipit placerat.\par}.
\end{document}
你可能想要添加一个宏,比如
\newcommand{\elstodo}[1]{%
\todo{\linespread{1}\tiny #1\par}%
}
以便能够简单地书写
\elstodo{Vivamus ... placerat}
一个不那么 hack 的解决方案:
\documentclass[review,authoryear,3p]{elsarticle}
\usepackage{lipsum}
\usepackage[
textwidth=1.7cm,
textsize=singlespacetiny,
]{todonotes}
\newcommand{\singlespacetiny}{\linespread{1}\tiny}
\journal{TUG}
\begin{document}
\begin{frontmatter}
\title{Doubt about LaTeX\tnoteref{Nota1}}
\tnotetext[Nota1]{This document was a collaborative effort.}
\author[Add1]{John Smith}
\ead{[email protected]}
\address[Add1]{TUG University}
\cortext[cor1]{Corresponding author}
\begin{abstract}
\lipsum[1]
\end{abstract}
\begin{keyword}
First word\sep Second word.
\end{keyword}
\end{frontmatter}
\listoftodos
\section{Introduction}
Lorem ipsum dolor sit amet, consectetur adipiscing
elit. Phasellus at sapien vitae sapien ultricies
sodales\todo{Vivamus orci dui, posuere et suscipit placerat.}.
Curabitur quam elit, tempus ut fringilla et, luctus sit
amet nisl. Suspendisse mi odio, elementum quis blandit
non, efficitur nec orci. Vivamus ullamcorper id justo quis
posuere\todo{Vivamus orci dui, posuere et suscipit placerat.}.
\end{document}