Flush left and right tabular environments in same line

horizontal alignmenttables

I am writing a declaration for my thesis. I want the signature and place, date parts to be on the extreme left and right respectively. I used \flushleft and \flushright, but the result is not as expected.

I am using tabular as I have to use \includegraphics to include my signature.

\leavevmode
\vfill\noindent
\begin{center}
    \textbf{DECLARATION}
\end{center}
„I hereby ensure the sole composure of the Master thesis without any other sources
than the ones mentioned or any other auxiliary means. All parts taken from other sources in verbatim or gist manner are indicated appropriately“.

\vspace*{4em}\noindent
\hfill
\begin{flushleft}
\begin{tabular}[t]{c}
    \vspace{-5.5mm}\includegraphics{Figures/Signature}\\
    \rule{10em}{0.4pt}\\ Signature
\end{tabular}
\end{flushleft}
\hfill
\begin{flushright}
\begin{tabular}[t]{c}
    \vspace{-5.5mm}Stade, 19.10.2021\\
    \rule{10em}{0.4pt}\\ Place, Date
\end{tabular}
\end{flushright}
\hfill\strut

enter image description here

Please help.
Thanks!

Best Answer

I'd avoid cluttering the document with so many commands.

Having a definition for \declaratory is better because you have a “centralized” place where to make the final typographic decisions.

The command has

  • a first optional argument for the options to \includegraphics;
  • a mandatory argument for the file name of the signature;
  • the place and date.

The interface makes it easier to insert for instance a trim option in the appropriate spot for lowering the signature or removing white space around it.

The two parts below are aligned thanks to tabular*.

\documentclass[a4paper]{book}
\usepackage{graphicx}

\newcommand{\declaratory}[3][]{%
  \clearpage % or \cleardoublepage
  \thispagestyle{empty}
  \vspace*{\stretch{3}}
  \begin{center}
  \bfseries DECLARATION
  \end{center}

  \vspace{4ex}

  \noindent
  I hereby ensure the sole composure of the Master thesis
  without any other sources than the ones mentioned or any
  other auxiliary means. All parts taken from other sources
  in verbatim or gist manner are indicated appropriately.

  \vspace{8ex}

  \noindent
  \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}c@{}c@{}}
  \hspace*{0.5em}\includegraphics[#1]{#2}\hspace*{0.5em} &
  \hspace*{0.5em}#3\hspace*{0.5em} \\
  \cline{1-1} \cline{2-2}
  \scriptsize Signature & \scriptsize Place, Date
  \end{tabular*}

  \vspace*{\stretch{1}}
  \clearpage
}

\begin{document}

\declaratory[
  trim=0 20 0 0,
  width=5cm,
]{example-image}
{City, 31.02.2022}

\end{document}

In the picture the image is drawn behind the rule, in a real-world application the signature would be on a transparent background.

When your document is finished, you can go to the definition of \declaratory and fix the details.

Avoid things such as \leavevmode\vfill: LaTeX has \vspace*{\fill} for the purpose.

enter image description here