Journal home page
General information
Submit an item
Download style files
Copyright
Contact us
logo for The PracTeX Journal TUG logo

Ask Nelly:
      How do I combine tabularx with longtable?
      How do I write matrices in the text?

The Editors



tpjlogo

Q: Dear Nelly: I often use the packages tabularx to produce tables with a specified width, and longtable to make tables spanning several pages. I wonder whether it is possible to combine the two packages, to produce long tables with a given width.

A: The answer is Yes. It is possible, by using a package named ltxtable, which is not so well known, at least not as well known as its author, David Carlisle himself. The package can be downloaded from CTAN, from the address http://www.ctan.org/tex-archive/macros/latex/contrib/carlisle/ltxtable.tex. By processing this file with LaTeX, you will get both the documentation and the style file, ltxtable.sty.

A table produced with ltxtable is essentially a longtable, and in the preamble you must give both the usual column specifiers and the X specifiers from tabularx. Keep in mind the following:

  • ltxtable has to be loaded by a \usepackage command.
  • The table should be put in a separate file. Let's call it ltable.tex.
  • The preamble of the longtable should be something of the form \begin{longtable}{|c|X|r|X|} (there should be at least an X-column).
  • When you want to include the table in the main file, if you want to produce a table of a certain width, use the command
    \LTXtable{width}{ltable.tex}.
  • Don't forget to indicate the width. Also be sure that the first three letters of the command are uppercase.
  • There are some subtleties related to the implementation of the \multicolumn command, so read the documentation, as well.

The above question was answered by Paul Blaga, a production editor of this journal. He can be reached at blaga

tpjlogo

Q: Dear Nelly: I want to introduce a 2x3 matrix in the text, but the matrices produced by the environments pmatrix and others of this sort are too big. What can I do?

A:
You should use the smallmatrix environment. The syntax is completely similar to that of any matrix-like environment. It is provided by the package amsmath. Please note that by default it doesn't add any delimiters, so you have to add them by hand.

The above question was answered by Paul Blaga, a production editor of this journal. He can be reached at blaga

tpjlogo




Page generated June 9, 2010 ; TUG home page; join TUG/renew membership; webmaster; facebook; x; mastodon.