3

I have been benefits from the post Center figure that is wider than \textwidth and the post Flushright or left of a long Table .

I try to use this \makebox[\textwidth][c] or \makebox[\textwidth][l] or \makebox[\textwidth][r].

But it turns out that [l] is shifting the table far to right. and [r] is shifting the table far to left. And [c] is very close to what I wish, but needs some few mm adjustment to shift to a bit more left.

Q1: Is there any function like \makebox[\textwidth][c]{3mm} with {3mm} shifting?

-

Q2: Is there anyway to adjust the position locate the table somehow between \makebox[\textwidth][c] and \makebox[\textwidth][l]?

Thank you for the comments from the experts!

wonderich
  • 2,387

2 Answers2

5
\hspace*{3mm}\makebox[...]{.....}\hspace*{-3mm}
David Carlisle
  • 757,742
2

I think the cause of your slightly off spacing might be a missing \noindent.

As paragraphs are usually indented, when you use \makebox on its own line a indent is added. See below for a comparison with and without \noindent:

enter image description here

Notes:

  • I adjusted the \textwidth, and added the showframe option to the geometry package so that the effect would be easier to see.

Code:

\documentclass{article}
\usepackage[textwidth=5cm,showframe]{geometry}
\usepackage{xcolor}
\begin{document}
Some text

\makebox[\textwidth][c]{\textcolor{red}{CENTER}}

\makebox[\textwidth][l]{\textcolor{red}{LEFT}}

\bigskip \noindent But with \verb|\noindent|: \medskip

\noindent \makebox[\textwidth][c]{\textcolor{blue}{CENTER}}

\noindent \makebox[\textwidth][l]{\textcolor{blue}{LEFT}}

\end{document}

Peter Grill
  • 223,288
  • @Idear: That is one reason it is recommended to always compose a fully compilable MWE including \documentclass and the appropriate packages that reproduces the problem, no matter how trivial it may seem. – Peter Grill May 05 '14 at 01:12