I defined a new environment like this:
\newenvironment{hungitem}[1]%
{\noindent\mbox{#1}\\\mbox{}\hfill\begin{minipage}{.9\textwidth}}
{\end{minipage}\vspace{\baselineskip}}
The envy does exactly what it should, but the problem is that
minipages don't break across pages. LaTeX has to put an integer
number of environments on a page and in some cases this leads
to have too much white space between environments...
What should I do to permit LaTeX to spread the text in the minipage
across more than one page? I thought about \parbox, but I don't
know how to embed the open/close brace needed by parbox's syntax
in the environment definition.
Thanks for the Help,
--
ciao ciao, Giuliano
#!/usr/bin/perl
$i=$j=$r=$b=-16.0;while((print"\n"),$b++<15){foreach$a(0..78){print
+(split //,' .:-;!/>)|&IH%*#')[$k&15];for($i=$k=$r=0;$j=$r*$r-$i*$i
-2+$a/25,$i=2*$r*$i+$b/10,$j*$j+$i*$i<11&&$k++<111;$r=$j){}}}
Giuliano Cioffi wrote:
>
> While waiting for my copy of ``LaTeX: A Document Preparation System''
> to arrive, I have a simple question...
>
> I defined a new environment like this:
>
> \newenvironment{hungitem}[1]%
> {\noindent\mbox{#1}\\\mbox{}\hfill\begin{minipage}{.9\textwidth}}
> {\end{minipage}\vspace{\baselineskip}}
>
> The envy does exactly what it should, but the problem is that
> minipages don't break across pages. LaTeX has to put an integer
> number of environments on a page and in some cases this leads
> to have too much white space between environments...
>
LaTeX does not break boxes (e.g., parbox, minipage) across pages.
How about defining a list environment instead?
Peter W.
peter.r...@boeing.com
Minipage (or parboxes) don't break, ever.
It looks like you're trying to do a sort of list, but this wheel has
already be invented, by the list environment.
\begin{list}{}{\leftmargin=0.1\linewidth
\rightmargin=0pt
\labelwidth=0.1\linewidth
\advance\labelwidth by -0.5em
\labelsep=0.5em
\def\makelabel#1{#1\hfil}}
\item[blah] .....
\end{list}
(forgive my plain speaking, you can latexify it with \setlength,
\renewcommand if you wish)
try
\newenvironment{hungitem}[1]%
{\noindent\mbox{#1}\\\begin{list}{}{\setlength{\leftmargin}{
0.1\textwidth}}}
{\end{list}}
and wait for your copy of Lamport's book, you will see that
there are many better ways to do what you probably intent...
> What should I do to permit LaTeX to spread the text in the
minipage
> across more than one page? I thought about \parbox, but I
don't
> know how to embed the open/close brace needed by parbox's
syntax
> in the environment definition.
well, the main problem is not how to split the braces
(impossible), but that parbox won't be better than
minipage -- if it differs from minipage in some cases, it's
usually lees good.
\bye
Matthias Köhler
Basically, \hfil means 'fill horizontal space if no \hfill is present;
do nothing otherwise'
The idea is that you can overwrite a \hfil by a \hfill.
Neither \hfil nor \hfill (nor \hskip1cm) will work on the
beginning of a line; you'll have to put an empty box or rule
before the \hfill.
\mbox{}\hfill works as expected.
(The label is not part of the current line)
Gernot
> > \begin{list}{}{\leftmargin=0.1\linewidth
> > \rightmargin=0pt
> > \labelwidth=0.1\linewidth
> > \advance\labelwidth by -0.5em
> > \labelsep=0.5em
> > \def\makelabel#1{#1\hfil}}
> > \item[blah] .....
> > \end{list}
> Are ``\hfil'' and ``\hfill'' synonyms?
No, they aren't (TeXbook, page 71); both represent infinite horizontal
stretchability, but \hfill is stronger (an infinity of higher order).
--
Maurizio Loreti http://www.pd.infn.it/~loreti/mlo.html
Univ. of Padova, Dept. of Physics - Padova, Italy lor...@pd.infn.it
Uhm, where am I wrong?
I did the following:
\newenvironment{hungitemize}%
{
\begin{list}{}{\leftmargin=0.1\linewidth
\rightmargin=0pt
\labelwidth=.1\linewidth
\advance\labelwidth by -0.5em
\labelsep=0.5em
\def\makelabel##1{##1\mbox{}\hfill}}}
{\end{list}}
> (The label is not part of the current line)
I understand, in fact, to manually tell latex to break the line after
the label I do:
\item[blah]\mbox{}\\
(otherwise it will complain about ``linebreak between paragraphs'')
I still want to break the line right after labels, directly in the
envy definition...
> Gernot
Thanks for the help!
You cannot order a line break INSIDE the label; the label
is a box of given size, and cannot be made to extend to
the end of the line.
You can either *) increase the \labelwidth to the
width of a line; in that case TeX will break
automatically (don't forget to care for \itemindent).
Or *) you could hack \item so that \item will produce
a \mbox{}\hfill\linebreak at the begin of the first
line of the paragraph (which is right after the label).
Gernot
or else not to directly use list environment at all,
See my post to the thread `LaTeX: descritpion environment question'
(dated 27 March)