12.07.2015 Views

The memoir class - The UK TeX Archive

The memoir class - The UK TeX Archive

The memoir class - The UK TeX Archive

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

11. ROWS AND COLUMNS\newcolumntype{Y}{>{\small\raggedright\arraybackslash}X}then Y could be used in the tabularx format argument.\tabularxcolumn<strong>The</strong> X columns are set using the p column, which corresponds to \parbox[t]. You maywant them set using, say, the m column, which corresponds to \parbox[c]. It is notpossible to change the column type using the > syntax, so another system is provided.\tabularxcolumn should be defined to be a macro with one argument, which expandsto the tabular format specification that you want to correspond to X. <strong>The</strong> argument willbe replaced by the calculated width of a column.<strong>The</strong> default definition is\newcommand{\tabularxcolumn}[1]{p{#1}}This may be changed, for instance\renewcommand{\tabularxcolumn}[1]{>{\small}m{#1}}so that X columns will be typeset as m columns using the \small font.Normally all X columns in a single table are set to the same width, however it is possibleto make tabularx set them to different widths. A format argument of{>{\hsize=.5\hsize}X>{\hsize=1.5\hsize}X}specifies two columns, where the second will be three times as wide as the first. If youthink you need to do things like this try and redesign your table. However, if you mustyou should follow these two rules.• Make sure that the sum of the widths of all the X columns is unchanged. (In theabove example, the new widths still add up to twice the default width, the same astwo standard X columns.)• Do not use \multicolumn entries which cross any X column.tabularx will not set X columns to a negative width. If the widths of the ‘normal’columns of the table already total more than the requested total width you will get thewarning ‘X columns too narrow (table too wide)’. <strong>The</strong> X columns will be set to awidth of 1em and so the table itself will be wider than the requested total width given inthe argument to the environment.<strong>The</strong> standard \verb macro does not work inside a tabularx, just as it does not workin the argument to any macro.\TX@verb<strong>The</strong> ‘poor man’s \verb’ (and \verb*) defined here is based on page 382 of the <strong>TeX</strong>book. Asexplained there, doing verbatim this way means that spaces are not treated correctly, andso \verb* may well be useless. <strong>The</strong> mechanism is quite general, and any macro whichwants to allow a form of \verb to be used within its argument may\let\verb=\TX@verbIt must ensure that the real definition is restored afterwards.This version of \verb and \verb* are subject to the following restictions:1. Spaces in the argument are not read verbatim, but may be skipped according to <strong>TeX</strong>’susual rules.2. Spaces will be added to the output after control words, even if they were not presentin the input.224

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!