[OS X TeX] Geometry package, lists and hfill weirdness

Alain Matthes alain.matthes at mac.com
Tue Oct 16 12:31:29 EDT 2007


Le 15 oct. 07 à 15:34, Charilaos Skiadas a écrit :

> I ran into a weird (at least to me) problem, and was hoping someone  
> would have some ideas. Consider the following code:
>
> \documentclass{article}
> \usepackage[left=1cm,right=1cm,top=1cm,bottom=1cm]{geometry}
> \newcommand{\filltwo}[2]{\par\hfill #1 \hfill {#2} \hfill}
> \begin{document}
>   \begin{enumerate}
>     \item In list:\par
>     \hfill Hi \hfill there! \hfill
>     \item Also in list:
>     \filltwo{Hi}{there!}
>   \end{enumerate}
>   \par\hfill Hi \hfill there! \hfill
>   \filltwo{Hi}{there!}
> \end{document}
>
>
> As the code stands, the last \hfill in both direct hfill attempts  
> and the first "filltwo" call (i.e. the one in the enumerate) seem  
> to be eaten up. In other words, all the "there!" except for the  
> very last one are lined up with the right side of the page.
>
> If on the other hand we comment out the geometry package, then  
> those hfills work just fine. (still though things are not aligned  
> quite as I would like them to be).
>
> So two questions:
> 1. Is this a known behavior of the geometry package, and do you  
> know of a way to circumvent it?
> 2. How can I make the \filltwo calls in the enumerate environment  
> distribute their arguments equidistant in a single line?
>
>

hello:) Geometry is not a problem with your code but you have
  a lot of bad white spaces and if you put a \hfill at hte end
  of the line, I suppose that you want :

<right>         hi         there!           <left>

try you code but like this:

without white spaces and with hfil instead of hfill


\documentclass{article}
\usepackage[left=1cm,right=1cm,top=1cm,bottom=1cm]{geometry}
\newcommand{\filltwo}[2]{\par\hfil#1\hfil{#2}\hfil}%
\begin{document}
	\parindent=0pt
   \begin{enumerate}
     \item In list:\par
     \hfil Hi\hfil there!\hfil%
     \item Also in list:%
     \filltwo{Hi}{there!}
   \end{enumerate}%
\par\hfil Hi\hfil there!\hfil%
\filltwo{Hi}{there!}%
\end{document}

Regards Alain
------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the MacOSX-TeX mailing list