3

I'd like to get rid of the additional empty space on the right between \begin{tabular}{ll} \textsc{place,} & \textsc{date}\\ Place, & \today \end{tabular} % and the right page margin/border:

enter image description here

The title isn't the best I admit, if anyone knows a better one feel free to edit it and this line please.

MWE

\documentclass[
fontsize=12pt,
a4paper,
DIV=15,
parskip=half
]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{
lmodern,
lipsum
}

\listfiles

\begin{document}
%\vspace{0.5cm}
\begin{flushleft}
Words\\
More Words
\end{flushleft}%
\begin{tabular}{@{}l}
\textsc{code}\\
11-22-33-44
\end{tabular}%
\hfill
\begin{tabular}{ll}
\textsc{place,} & \textsc{date}\\
Place, & \today
\end{tabular}
\begin{flushleft}
\bfseries Words
\end{flushleft}
\begin{flushleft}
Something,
\end{flushleft}
\lipsum[3]
\end{document}
lockstep
  • 250,273
henry
  • 6,594

2 Answers2

3

You need a l@{} so the text has no tabcolsep padding on the right (just as you have already used at the left margin in other tables. Then you need to make sure that the \hfill is not balanced by the \parfillskip glue that is added to the last line of a paragraph. As you want the same effect on both sides, center is an appropriate environment.

enter image description here

\documentclass[
fontsize=12pt,
a4paper,
DIV=15,
parskip=half
]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{
lmodern,
lipsum
}

\listfiles

\begin{document}
\begin{flushleft}
Words\\
More Words
\end{flushleft}%
\begin{center}
\noindent\begin{tabular}{@{}l}
\textsc{code}\\
11-22-33-44
\end{tabular}%
\hfill
\begin{tabular}{ll@{}}
\textsc{place,} & \textsc{date}\\
Place, & \today
\end{tabular}
\end{center}
\begin{flushleft}
\bfseries Words
\end{flushleft}
\begin{flushleft}
Something,
\end{flushleft}
\lipsum[3]
\end{document}
David Carlisle
  • 757,742
0

Played around a bit and found

\begin{tabular}{ll@{}}
\textsc{place,} & \textsc{date}\\
Place, & \today
\end{tabular}\\

works. => MWE

\documentclass[
fontsize=12pt,
a4paper,
DIV=15,
parskip=half
]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{
lmodern,
lipsum
}

\listfiles

\begin{document}
\begin{flushleft}
Words\\
More Words
\end{flushleft}%
\noindent\begin{tabular}{@{}l}
\textsc{code}\\
11-22-33-44
\end{tabular}%
\hfill
\begin{tabular}{ll@{}}
\textsc{place,} & \textsc{date}\\
Place, & \today
\end{tabular}\\
\begin{flushleft}
\bfseries Words
\end{flushleft}
\begin{flushleft}
Something,
\end{flushleft}
\lipsum[3]
\end{document}

Happy to read other answers, maybe this isn't the only/best solution.

henry
  • 6,594
  • No. never end a paragraph with \\ – David Carlisle Jan 09 '14 at 11:14
  • Oh, ok. Well I usually don't but wasn't aware of this "strict" opinion. I was my best next guess. – henry Jan 09 '14 at 11:29
  • 2
    I phrased it strictly there to overcome the slight problem that in this case \\ worked rather well:-) But it's a bad habit to get in to and in most circumstances it does the wrong thing. more discussion at http://tex.stackexchange.com/questions/82664/when-to-use-par-and-when/82666#82666 – David Carlisle Jan 09 '14 at 11:34
  • Haha, Isee. :) Was surprised the linked post was relatively short, very interesting, thanks. – henry Jan 09 '14 at 11:39