I learnt from resizebox doesn't respect linebreaks? that \resizebox contents had to be wrapped in a minipage to get newlines; indeed, it works:
\resizebox{20em}{!}
{\begin{minipage}{10em}
lorem\\
ipsum\\
tex.stackexchange
\end{minipage}}
And it works with \par, as well:
\resizebox{20em}{!}
{\begin{minipage}{10em}
lorem\par
ipsum\par
tex.stackexchange
\end{minipage}}
But not with \obeylines? What gives?
\resizebox{20em}{!}
{\begin{minipage}{10em}
\obeylines{}
lorem
ipsum
tex.stackexchange
\end{minipage}}
How can I use \obeylines in a \resizebox?
\obeylinesis similar to\verband doesn't work in any command argument. Just put it before the\resizebox– David Carlisle Aug 10 '16 at 08:11\obeylinesjust a catcode change? Why doesn't that work in a command with arguments? I ran into this problem because an environment that I use calls\obeylines, and I can't really move that outside of the environment :/ In any case, please make this an answer, and I'll be happy to accept it :) – Clément Aug 10 '16 at 08:41listings,fancyvrb, and the like do it, then. Don't they use catcode changes to preserve spaces, lines, etc? – Clément Aug 10 '16 at 09:02