1

How do I do this with the extra twist of getting the text (i.e. my custom page numbering) right aligned?

The end results should look something like this (full width):

Text .........    1-2
Text ......... 34-143
Text text text
text tex .....    3-5

PS I have tried the obvious setting the cell alignment to r but this don't have any real effect.

(I'm using LuaTex with the document class memoir).

imdk4242
  • 163

1 Answers1

1

If you only have two columns this can be done using \renewcommand\tabularxcolumn[1]{b{#1}}as shown in the following example:

enter image description here

\documentclass{memoir}

\usepackage{tabularx}

\renewcommand\tabularxcolumn[1]{b{#1}}

\begin{document}
\noindent 
\begin{tabularx}{\linewidth}{  X r }
    test text text  text  text  text  text  text  text  text  text
  text  text  text  text  text  text  text  text\dotfill & 1-2\\
   line test text text  text  text  text  text  text  text  text  text
  text  text  text  text  text  text  text  text \dotfill& 34-143\\
   line for comparison \dotfill & 3-5 
\end{tabularx}
\end{document}
leandriis
  • 62,593
  • Thanks. And if I want to increase the white space between the rows in the table (but not add the full space of a \newline), is that best achieved with \vspace{X} or does tabularx/memoir ones again come to the rescue with a build-in function for this feature? – imdk4242 Jul 14 '19 at 19:36
  • @imdk4242: You can use for example \renewcommand{\arraystretch}{1.5} or any other factor of your choice. – leandriis Jul 14 '19 at 20:10
  • Thanks. So, this is maybe a seperat question but I'll start by posting it here: if I need one more column to the left (right aligned at the top), what do I then do? With the current code example, and adding a column to the left and setting it to r, pushes the text to the bottom right (rather than the top right). Do I need to make an adjustment to the \tabularxcolumn to make this change happen? – imdk4242 Jul 14 '19 at 20:46
  • Partly yes, but this get's us back to the right most column being aligned left and not right (and the table not being full ```\linewidth````). I think this is a separate problem, will post a new question – imdk4242 Jul 14 '19 at 21:18