[texhax] Enumerate lists inside "tables"?
Uwe Lueck
uwe.lueck at web.de
Fri Jun 17 09:41:42 CEST 2011
Solving the \textwidth thing of my earlier
> \begin{minipage}{.924\textwidth}
> \strut
> \begin{enumerate}
> \item \strut oh
> \item \strut no
> \end{enumerate}
> \strut
> \end{minipage}
:
\makebox[0pt][c]{%
\begin{minipage}{\textwidth}
\strut
\begin{enumerate}
\item \strut oh
\item \strut no
\end{enumerate}
\strut
\end{minipage}
}
... May look confusing rather like a solution. Here is an approach
approaching a little package instead:
\newcommand*{\syllabusformhead}[4]{%
\formheadHrule
\noindent \formheadVrule \strut
\fixedwidthformheadfield\firstformwidth{#1}%
\fixedwidthformheadfield\secondformwidth{#2}%
\fixedwidthformheadfield\thirdformwidth{#3}%
\fillwidthformheadfield{#4}%
\formheadHrule
}
%% head field parameters:
\newcommand*{\formheadrule}{1pt}
\newcommand*{\formheadHrule}{\hrule height \formheadrule\relax}
\newcommand*{\formheadVrule}{\vrule width \formheadrule\relax}
\newcommand*{\firstformwidth}{3pc}
\newcommand*{\secondformwidth}{5pc}
\newcommand*{\thirdformwidth}{12pc}
%% applied:
\newcommand*{\fixedwidthformheadfield}[2]{%
\formheadfield{\makebox[{#1}][l]{#2}}}
\newcommand*{\formheadfield}[1]{%
\kern-\formheadrule\kern\tabcolsep#1\formheadVrule}
%% just one of the fields (one \kern-\formheadrule):
\newcommand*{\fillwidthformheadfield}[1]{%
\formheadfield{#1\hfill\kern-\formheadrule}}
\newenvironment*{framedpagefield}
{\noindent
\vrule \hfill
\hbox to 0pt\bgroup \hss
\begin{minipage}\textwidth
}{%
\end{minipage}%
\hss \egroup
\hfill \vrule
\hrule}
%% Applying former macros:
\syllabusformhead{A}{B}{C}{D}
\begin{framedpagefield}
\strut
\begin{enumerate}
\item \strut oh
\item \strut no
\end{enumerate}
\strut
\end{framedpagefield}
\begin{framedpagefield}
\strut
\begin{enumerate}
\item \strut ih
\item \strut ah
\end{enumerate}
\strut
\end{framedpagefield}
Cheers,
Uwe.
More information about the texhax
mailing list