Talk:LaTeX/Customizing LaTeX

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

It is probably a good idea if someone works in the \obeylines and \obeyspaces commands in this section, as they can be fairly important when writing your own macro. It is rather confusing to discover (La)TeX treats all whitespace as the same type of spacing glue, and that you need to wrap text you want to preserve the spacing and newlines as you wrote it for in

\begingroup
\obeylines
\obeyspaces
Relevant text here
\endgroup

which means that you will probably need to combine your own verbatim environment, and your command:

\newenvironment{\yourverbatim}{\begingroup \obeylines \obeyspaces}{\endgroup}
\newcommand{\yourcommand}[n]{do something with #1 .. #n}

and then in your tex file:

\begin{yourverbatim}
\yourcommand{
whichever text it is important you
preserve the spacing and newslines
for, like when you want to generate
a verbatim block later on.
}
\end{yourverbatim}

I don't have enough knowledge of wiki editing to do this cleanly, I'd probably just screw up a perfectly usable page somehow.

- Mike Kamermans (nihongoresources.com)