1

I have the following newenvironment defined using tabularx

\newenvironment{factlist}{%
    \newdimen\unbaseline
    \unbaseline=\dimexpr-\baselinestretch\baselineskip\relax
    \renewcommand\item[2]{%
    \textsc{##1} & {\raggedright ##2\smallskip\\}\\[\unbaseline]}
    \tabularx{\linewidth}{rX}}
    {\endtabularx}

I use it as follows:

\begin{factlist}
\item{A}{aaaa}
\item{B}{bbbb}
...
\item{Z}{zzzz}
\end{factlist}

Trouble is, the "factlist" does not split across pages. I believe this is because tabularx does not fit across pages.

I figured that "longtabu" from the "tabu" package has the same syntax as tabularx. However, I am not able to replace \tabularx and \endtabularx with \begin{longtabu} and \end{longtabu} in newenvironment. It throws a Runaway argument exception.

I am new to Latex. It would be nice if you could help me getting this code to work.

I am open to other methods as well, since all I want to do is BE ABLE TO SPLIT THE "FACTLIST" ACROSS PAGES!

1
  • In any case, \newdimen should be outside the environment. You declare a dimen, and then set it every time with the environment. But there's no reason to (in fact you can't) declare a new dimen everytime you use the environment.
    – Manuel
    Nov 30, 2014 at 20:41

1 Answer 1

2

It is almost always better to set these things as a list:

\documentclass{article}
\newenvironment{factlist}{%
\begin{enumerate}
\renewcommand\labelenumi{\textsc{\Alph{enumi}}}}
{\end{enumerate}}
\begin{document}

\begin{factlist}
\item One two three four five.
\item One two three four five.
\item One two three four five.
\item One two three four five.
\item One two three four five.
\item One two three four five.
\item One two three four five.
\item One two three four five.
\item One two three four five.
\item One two three four five.
\item One two three four five.
\item One two three four five.
\end{factlist}

\end{document}

the exact list parameters can be tuned to the exact requirements,

3
  • I've used \textsc as in the question but it's an almost unnoticable font change on capital letters. Nov 30, 2014 at 20:54
  • The question is not about \textsc at all. This tex script is taken from a template for a resume. And using \textsc is relevant in that context. Also, your reply isn't exactly what I was looking for. I am aware that I can use \item, but I need a table to ensure proper alignment, etc in the resume.
    – P.C.
    Nov 30, 2014 at 23:44
  • @P.C. yes that's why I relegated the \textsc to a comment. It would be very surprising if you can not get the alignment that you need using a list based layout. But it's your document and only you know the requirements that you have, Dec 1, 2014 at 0:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .