28.03.2013 Views

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

198 Chapter 8. User Cus<strong>to</strong>mizations<br />

\renewenvironment{comment}<br />

{\begin{sloppypar}\noindent\slshape Comment:<br />

\begin{quote}\small\itshape}<br />

{\stepcounter{com}\hspace*{\fill}(\arabic{com})\end{quote}<br />

\end{sloppypar}}<br />

With the \begin{sloppypar} comm<strong>and</strong>, the call <strong>to</strong> the environment<br />

always starts a new paragraph in which no overfull line can occur upon<br />

line breaking. If the comment number does not fit on the last line of<br />

text, a new line begins with the number right justified because of the<br />

comm<strong>and</strong> \hspace*{\fill}. Again the user should examine carefully<br />

just what is inserted in<strong>to</strong> the processing between the \begin{comment}<br />

<strong>and</strong> the \end{comment}.<br />

8.4.2 Environments with arguments<br />

Passing arguments over <strong>to</strong> an environment is carried out exactly as for<br />

comm<strong>and</strong>s. As an example, the comment environment will be modified so<br />

that the name of the person making the comment is added after the word<br />

Comment:, <strong>and</strong> this name will be an argument when the environment is<br />

invoked.<br />

\renewenvironment{comment}[1]<br />

{\begin{sloppypar}\noindent\slshape Comment: #1<br />

\begin{quote}\small\itshape}<br />

{\stepcounter{com}\hspace*{\fill}(\arabic{com})%<br />

\end{quote}\end{sloppypar}}<br />

The text<br />

\begin{comment}{Helmut Kopka} This is a modified ...<br />

... environment argument \end{comment}<br />

now produces<br />

Comment: Helmut Kopka<br />

This is a modified comment. Comments should be preceded by the<br />

word Comment:, followed by the name of the commenter, with the text<br />

of the comment being in a small, italic typeface, indented on both sides<br />

from the main margins. Each comment receives a running comment<br />

number at the lower right in round parentheses. The name of the<br />

commenter is transferred as an environment argument. (2)<br />

This example will now be modified once again by interchanging the<br />

comment number <strong>and</strong> the name of the commenter. Placing the running<br />

number after the word Comment: is no problem, for it is simply necessary<br />

<strong>to</strong> insert those comm<strong>and</strong>s from {end def } at the location of the #1 dummy<br />

argument. However, putting the symbol #1 where the comment number<br />

used <strong>to</strong> be will produce an error message during the L AT E X processing since

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!