[OS X TeX] Strange behavior of tabular / \hline

Bernhard Barkow bb at creativeeyes.at
Mon Jun 6 15:45:10 CEST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On 6. Jun 2005, at 15:37, Johan Almqvist wrote:
> A very simple workaround that may or may not work for you:
>
> %!TEX TS-program = pdflatex
> \documentclass{article}
>
> \newcommand{\anentry}[1]{#1 \\
> \hline
> }
>
> \begin{document}
>
> \begin{tabular}{|c|}
> \hline
> test \\
> \hline
> test \\
> \hline
>
> \input{testinp.tex}
>
>
> \end{tabular}
>
> \end{document}
> - ----
> and this is the input file (testinp.tex):
> - ----
> \anentry{test1}
> \anentry{test2}
>
>
>
>
>
> On Jun 6, 2005, at 15:10, Bernhard Barkow wrote:
>
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Hi,
>>
>> I spent the last 2 hours trying to figure out how to properly  
>> include lines from an external file in a tabular environment:
>>
> [...]
>
>> The problem is related to the \hline defined in \anentry; I end up  
>> with the error:
>>
>> You can't use `\hrule' here except with leaders.
>> \hline ->\noalign {\ifnum 0=`}\fi \hrule
>>                                          \@height \arrayrulewidth  
>> \futurelet...
>>
>> and in the table I get the word "height" instead of a line.
>> If I replace the \input{...} by the file's contents, it works, of  
>> course.
>> I also tried \tabularnewline from the array package instead of \\,  
>> no success.
>>
>> (Just for completeness: the main goal is to generate a kind  
>> of .toc file with automatically generated entries to be displayed  
>> inside a tabular environment)
>>
>> Does anyone have an idea how to do this right?
>>
>>

Thank you, but this doesn't work either. It produces the same  
results, just the other way round...

Bernhard
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFCpFNqqJ8JxFkhAg0RArokAKDbgBXngcldAhWwr8bpTRchNeqhywCfXMko
vqvnTop6h1P2oJtSwFxOIkg=
=ZmVh
-----END PGP SIGNATURE-----
--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the macostex-archives mailing list