Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

\begin{verbatim}..\end{verbatim} doesn't prevent automated line breaks

772 views
Skip to first unread message

Richard Mathar

unread,
Jan 4, 2000, 3:00:00 AM1/4/00
to
My problem occurs with a latex source code which contains a very long line
within a verbatim environment:

\documentclass[11pt,twoside]{article}

%\usepackage{times}

\begin{document}
\begin{verbatim}
ATTRIBUTE Vector recent(TEMPSINPAR,float) // TEMPSINPAR LakeShore temperatures (Kelvin)
\end{verbatim}

\end{document}

This prints as intended, ie, the long line within the verbatim environment
is cut by the paper margin. But if the 'times' packages is included (as
indicated in the source code), latex shows a much too small overfull box and
introduces a line break, though the long line is not supposed to be handled
that way. How does my version with the times package "change" the behaviour
of the verbatim environment? [Note that TeX, Version 3.1415 (C version 6.1)
of LaTeX2e <1997/06/01> works as expected, ie, it honours the verbatim
environment and does not break the long line.]

This is TeX, Version 3.14159 (Web2C 7.3.1)
(fdr.tex
LaTeX2e <1998/12/01> patch level 1
Babel <v3.6x> and hyphenation patterns for american, french, german, ngerman, n
ohyphenation, loaded.
(/disk-a/mathar/sys/teTeX-1.0/texmf/tex/latex/base/article.cls
Document Class: article 1999/01/07 v1.4a Standard LaTeX document class
(/disk-a/mathar/sys/teTeX-1.0/texmf/tex/latex/base/size11.clo))
(/disk-a/mathar/sys/teTeX-1.0/texmf/tex/latex/psnfss/times.sty) (fdr.aux)
(/disk-a/mathar/sys/teTeX-1.0/texmf/tex/latex/psnfss/ot1ptm.fd)
(/disk-a/mathar/sys/teTeX-1.0/texmf/tex/latex/psnfss/ot1pcr.fd)
Overfull \hbox (80.18947pt too wide) in paragraph at lines 8--8
[] \OT1/pcr/m/n/10.95 AT-TRIBUTE Vec-tor re-cent(TEMPSINPAR,float)
// TEMPSIN-
[1] (fdr.aux) )
(see the transcript file for additional information)
Output written on fdr.dvi (1 page, 368 bytes).
Transcript written on fdr.log.


===============================================================================
Richard J Mathar phone (+49) (0) 6221 528 302 (office)
Max-Planck-Institut fur Astronomie
Konigstuhl 17
69117 Heidelberg Email mat...@mpia-hd.mpg.de

James Kilfiger

unread,
Jan 4, 2000, 3:00:00 AM1/4/00
to
Richard Mathar wrote:
>My problem occurs with a latex source code which contains a very long line
>within a verbatim environment:
>
>if the 'times' packages is included (as
>indicated in the source code), latex shows a much too small overfull box and
>introduces a line break,

In the courier font hyphenation is permitted, I'm not sure why. In cmtt
hyphenation is disallowed.

One way round your problem is to use the verbatim package, like this:
\usepackage{verbatim}
\makeatletter
\renewcommand{\verbatim@font}{\normalfont\ttfamily\hyphenchar\font=-1%
\let\do\do@noligs
\verbatim@nolig@list}
\makeatother

The \hyphenchar command dissallows hyphenation.

Another is copy the contents of ot1pcr into a style file, edit them
and load the font defintions as a package. This assumes some knowedge
of how .fd files and packages work.

Does anybody know why hyphenation is permitted by courier but not by
cmtt?

James

Donald Arseneau

unread,
Jan 4, 2000, 3:00:00 AM1/4/00
to
In article <slrn874gv7...@mimosa.csv.warwick.ac.uk>, ma...@mimosa.csv.warwick.ac.uk (James Kilfiger) writes...

>Does anybody know why hyphenation is permitted by courier but not by
>cmtt?

Does anyone know why the verbatim environment relies on this idiosyncracy
of cmtt? It should disable hyphenation explicitly.

Donald Arseneau as...@triumf.ca

Richard Mathar

unread,
Jan 6, 2000, 3:00:00 AM1/6/00
to
I wrote:
|> My problem occurs with a latex source code which contains a very long line
|> within a verbatim environment:
|>
|> \documentclass[11pt,twoside]{article}
|>
|> %\usepackage{times}
|>
|> \begin{document}
|> \begin{verbatim}
|> ATTRIBUTE Vector recent(TEMPSINPAR,float) // TEMPSINPAR LakeShore temperatures (Kelvin)
|> \end{verbatim}
|>
|> \end{document}
|>
|> This prints as intended, ie, the long line within the verbatim environment
|> is cut by the paper margin. But if the 'times' packages is included (as

|> indicated in the source code), latex shows a much too small overfull box and
|> introduces a line break, though the long line is not supposed to be handled
|> that way. How does my version with the times package "change" the behaviour
|> of the verbatim environment? [Note that TeX, Version 3.1415 (C version 6.1)
|> of LaTeX2e <1997/06/01> works as expected, ie, it honours the verbatim
|> environment and does not break the long line.]

James Kilfinger (ma...@csv.warwick.ac.uk) answered:


|>
|> In the courier font hyphenation is permitted, I'm not sure why. In cmtt
|> hyphenation is disallowed.
|>
|> One way round your problem is to use the verbatim package, like this:
|> \usepackage{verbatim}
|> \makeatletter
|> \renewcommand{\verbatim@font}{\normalfont\ttfamily\hyphenchar\font=-1%
|> \let\do\do@noligs
|> \verbatim@nolig@list}
|> \makeatother
|>
|> The \hyphenchar command dissallows hyphenation.
|>

|> ...
|> Does anybody know why hyphenation is permitted by courier but not by
|> cmtt?

and his proposal also works if the verbatim package is not included explicitly.
R. J. Mathar, mat...@mpia-hd.mpg.de

0 new messages