1

MWE:

\documentclass[]{article}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{array}

\newcommand\lastbit[1]{\ifhmode\unskip\fi\nobreak\hfill\rlap{\hspace{3\tabcolsep}#1}}

\begin{document}
\pagenumbering{gobble}

\begin{center}

    \begin{tabular}{cp{8cm}}

        \textbf{L4} &
        For a sound explanation of both budget lines and indifference curves and a clear link to the separate demand curve, sound explanation of link between utility, price and demand, with accurate clear diagrams and a clear understanding of the principles involved. 
        \lastbit{\textbf{[9--12]}}\\
        &\\
        \textbf{L3} &
        For an accurate reference to the question but with a more limited explanation, perhaps omitting a clear explanation of utility or a clear link to the demand curve, or with minor errors in the analysis or in the diagrams.
        \lastbit{\textbf{[7--8]}}\\
        &\\
        \textbf{L2} &
        For a briefer explanation of the equilibrium position but with no link to the demand curve; or with inaccurate diagrams and weak explanation.
        \lastbit{\textbf{[5--6]}}\\
        &\\
        \textbf{L1} &
        For an answer which has some basic correct facts but includes irrelevancies and errors of theory.
        \lastbit{\textbf{[1--4]}}\\
    \end{tabular}

\end{center}


\end{document}

For some reason, this fails to center the table. It's aligned right.

How do I fix this?

Thev
  • 1,568

1 Answers1

4

It is centered. The issue is that your \lastbit macro applies its content in \rlapped format, which necessarily falls outside of the centering mechanism.

\documentclass[]{article}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{array}
\usepackage[pass,showframe]{geometry}
\newcommand\lastbit[1]{\ifhmode\unskip\fi\nobreak\hfill\rlap{\hspace{3\tabcolsep}#1}}

\begin{document}
\pagenumbering{gobble}

\begin{center}

\fboxsep=-\fboxrule
    \fbox{\begin{tabular}{cp{8cm}}

        \textbf{L4} &
        For a sound explanation of both budget lines and indifference curves and a clear link to the separate demand curve, sound explanation of link between utility, price and demand, with accurate clear diagrams and a clear understanding of the principles involved. 
        \lastbit{\textbf{[9--12]}}\\
        &\\
        \textbf{L3} &
        For an accurate reference to the question but with a more limited explanation, perhaps omitting a clear explanation of utility or a clear link to the demand curve, or with minor errors in the analysis or in the diagrams.
        \lastbit{\textbf{[7--8]}}\\
        &\\
        \textbf{L2} &
        For a briefer explanation of the equilibrium position but with no link to the demand curve; or with inaccurate diagrams and weak explanation.
        \lastbit{\textbf{[5--6]}}\\
        &\\
        \textbf{L1} &
        For an answer which has some basic correct facts but includes irrelevancies and errors of theory.
        \lastbit{\textbf{[1--4]}}\\
    \end{tabular}}

\end{center}


\end{document}

enter image description here

  • 1
    Thank you. I posted a follow-up here: https://tex.stackexchange.com/questions/447938/tabular-3-columns-with-top-align-and-bottom-align – Thev Aug 27 '18 at 10:20