1

I would like to know how I can use single spacing (\singlespacing) in todonotes, considering Elsarticle Class, because I always get an error message about paragraph?

Following a minimal example:

%!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@email.com}
\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}
2

No setspace: just use \linespread{1}, but remember to add \par at the end, or the paragraph would be set with the normal baselineskip.

\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@email.com}
\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}

enter image description here

You may want to add a macro, say

\newcommand{\elstodo}[1]{%
  \todo{\linespread{1}\tiny #1\par}%
}

so as to be able to write simply

\elstodo{Vivamus ... placerat}

A less hackish solution:

\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@email.com}
\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}

enter image description here

  • What is main difference between \linespread{1} and setspacing? – VAS Mar 13 '16 at 23:28
  • @VAS That you don't need a package for it – egreg Mar 13 '16 at 23:30
  • this solution is working, but it crashes with command “\listoftodos”. Do you have any suggestion to solve this problem? – VAS Mar 20 '16 at 16:26
  • @VAS Yes, I have. ;-) – egreg Mar 20 '16 at 16:45
  • thanks. The problem was “\par” at end “\todo” command. I would hope that one day I will be able to help other people as you. – VAS Mar 20 '16 at 22:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.