1

I'm trying to make a page with table-like form. There are a couple of characteristics:

  • The columns are evenly distributed. The examples show that the two or four column tables are evenly distributed over a page.
  • When a new page starts, the heading label, e.g., Wrong and Right in the first example, is automatically added.

How to make this table or tabbing environment?

enter image description here enter image description here

1
  • You would need a hybrid of the longtable and tabularx environments. There are the packages ltxtable and ltablex that do this, and also the longtabu environment of the tabu package. Dec 15, 2016 at 23:31

1 Answer 1

2

Two-column case

The first case with two columns "Wrong" and "Right" can be done by a longtable:

\documentclass{article}
\usepackage[
  a5paper,
  hmargin=.5cm,
  vmargin=.5cm,
  paperheight=4cm,
  includefoot,
]{geometry}


\usepackage{longtable}

\begin{document}
\begin{longtable}{
  @{}
  *{2}{p{.5\dimexpr\linewidth-\LTleft-\LTright-2\tabcolsep\relax}}
  @{}
}
  \itshape Wrong & \itshape Right \tabularnewline
\endhead
  acetyl-glucosamine & acetylglucosamine \\
  acid fast bacteria & acid-fast bacteria \\
  acid fushsin & acid fuchsine \\
  acridin orange & acridine orange \\
  acriflavin & acriflavine \\
\end{longtable}
\end{document}

Page 1 Page 2

Package longtable supports repeated headers (\endhead, and \endfirsthead). LaTeX adds space to the left and right of a column with amount \tabcolsep. @{} suppresses this space, as done in the example to the very left and right of the table. The width of the two columns can be calculated, saving the more complicate ways combining longtable with tabularx.

Four-column case

The second case with four columns is rather a two-column table in a two-column page layout. Then package supertabular (or some of it successors) can be used. However, the package has a weakness, that the page usually is not as good filled to the bottom as with package longtable.

\documentclass[twocolumn]{article}
\usepackage[
  a4paper,
  hmargin=.5cm,
  vmargin=.5cm,
  paperheight=5cm,
  includefoot,
]{geometry}

\usepackage{supertabular}

\begin{document}
\tablehead{\itshape Word & \itshape Abbreviation \tabularnewline}
\begin{supertabular}{
  @{}
  *{2}{p{.5\dimexpr\linewidth-2\tabcolsep\relax}}
  @{}
}
  Abstracts & Abstr. \\
  Academy & Acad. \\
  Acta & No abbrev. \\
  Advances & Adv. \\
  Agricultural & Agric. \\
  American & Am. \\
  \dots & \dots \\
  Bacteriology & Bacteriol. \\
  Bakteriologie & Bakteriol. \\
  Berichte & Ber. \\
  Biochemical & Biochem. \\
  Biochimica & Biochim. \\
  Biological & Biol. \\
  \dots & \dots \\
\end{supertabular}
\end{document}

Page 1 Page 2

Each table column has the same width. The space between column "Word" and "Abbreviation" is 2\tabcolsep and the space between the two page columns is \columnsep.

You must log in to answer this question.

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