I need to collect data (a sequence of input strings) in the preamble of a document, but the strings are to be typeset later in the document and must obey the line breaks set when typing the strings at the keyboard. Here is an MWE:
\documentclass[12pt]{memoir}
\newcommand{\makeAddress}[1]{
\def\address{%
{\obeylines #1}
}
}
\makeAddress{First line
Second line}
\begin{document}
Some text here just to fill before typesetting the line-break obeying lines.
\address
And now more text, not obeying line breaks verbatim.
\end{document}
What I find is that I write the argument to the command \makeAddress
as shown, namely, with a single stroke of my keyboard's RETURN
key, I get a single output line for \address
, whereas if I use two strokes, leaving a blank line in the argument between the strings "First line" and "Second line", I get the expected behavior: two output lines. What am I doing wrong?
Ian Thompson's answer set the line breaking issue straight. That was my original question in this post, hence his reply qualifies as answer. But my point is now, how can I do that and at the same time not have the text typeset until the point where it is supposed to?
\\
to mark the end of lines.\\
you can even type the address on one line and not rely on editor's features.