# Single-spaced comments in changes package with double-spaced document

I'm using the changes package for comments. Is it possible to get the comments to be single-spaced, even if the document itself is double-spaced?

MWE:

\documentclass{article}
\usepackage{changes}
\usepackage{lipsum}

\begin{document}

\lipsum[1-1][1-3]\comment{I would like this comment to be single-spaced.} \lipsum[1-1][4-6]

\end{document}


Output:

• BTW, \comment is also used by other packages (defined differently). – John Kormylo May 13 '19 at 3:58

Quite likely you want all of your margin notes to be single spaced.

\documentclass{article}
\usepackage{changes,etoolbox}

\usepackage{lipsum}

\makeatletter
\makeatother

\begin{document}

\lipsum[1-1][1-3]\comment{I would like this comment to be single-spaced.}
\lipsum[1-1][4-6]

\end{document}


Explanation: \@marginparreset is the hook that the LaTeX kernel provides for doing initializations before starting to typeset a margin paragraph (internally used by the changes package).

\documentclass{article}
\usepackage{changes}
\usepackage{lipsum}

\begin{document}
\lipsum[1-1][1-3]\renewcommand*{\baselinestretch}{1}\comment{\selectfont
I would like this comment to be single-spaced.}
\lipsum[1-1][4-6]

\end{document}


which seems to work. If you decide this is the way to go, then obviously one may make it more automatic and safer by patching this into \comment. You could just look up its definition from changes.sty and redefine it as follows:

\documentclass{article}
\usepackage{changes}
\usepackage{lipsum}
\makeatletter
\renewcommand*{\comment}[2][\@empty]{%
\edef\oldbaselinestretch{\baselinestretch}%
\typeout{\oldbaselinestretch}%
\renewcommand*{\baselinestretch}{1}%
\setkeys{Changes@comment}{#1}%
\Changes@output%
{comment}%
{\Changes@comment@id}%
{}%
{}%
{\selectfont #2}%
{\changescommentname}%
{\selectfont #2}%
\renewcommand*{\baselinestretch}{\oldbaselinestretch}%
}
\makeatother
\begin{document}
\lipsum[1-1][1-3]\comment{I would like this comment to be single-spaced.}
\lipsum[1-1][4-6]

\selectfont
\lipsum[1-1]

\end{document}

• Clever! I was trying to fix \baselineskip, which has to be done before the paragraph starts. I found only one \marginpar in the changes source, but patching it didn't do anything. – John Kormylo May 13 '19 at 4:00
• @JohnKormylo Thanks! All I did was to look up Ulrike's answer and use the information there. – user121799 May 13 '19 at 4:01