Graphics, Figures & Tablesminipage position problem

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
BlauBeer
Posts: 1
Joined: Sun Oct 31, 2010 6:15 pm

minipage position problem

Post by BlauBeer »

Hi,

I want to have two minipages on the same level (one left and the other right), both contain two lines. But this two minipages are not on the same level

Code: Select all

\begin{minipage}{0.4\textwidth}
\begin{flushleft}
\underline{Stuttgart, den \today{}}\\
(Ort und Datum)
\end{flushleft}
\end{minipage}
%
\begin{minipage}{0.6\textwidth}
\begin{flushright}
\underline{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\\
(Unterschrift des Verfassers)
\end{flushright}
\end{minipage}
Attachments
2010-10-31-173404_648x80_scrot.png
2010-10-31-173404_648x80_scrot.png (12.76 KiB) Viewed 22889 times
Last edited by BlauBeer on Mon Nov 01, 2010 12:11 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

minipage position problem

Post by localghost »

Please always provide a full and compilable example. Otherwise the solution of a problem will fail when it comes to more complicated issues.

Use an optional alignment parameter for the minipage environments to align them with respect to the current line as shown below.

Code: Select all

\documentclass[ngerman]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{selinput}
\SelectInputMappings{%
  adieresis={ä},
  germandbls={ß},
  Euro={€},
}
\usepackage{babel}

\begin{document}
  \begin{minipage}[b]{0.4\textwidth}
    \raggedright
    Stuttgart, den \today \\
    \rule[1ex]{14em}{0.5pt}\\
    (Ort und Datum)
  \end{minipage}
%
  \begin{minipage}[b]{0.6\textwidth}
    \raggedleft
    \rule[1ex]{14em}{0.5pt}\\
    (Unterschrift des Verfassers)
  \end{minipage}
\end{document}
As you see, the environments for text alignment have been replaced by the according switches in order to avoid additional vertical space.


Best regards and welcome to the board
Thorsten
Post Reply