2

I have the following code:

\documentclass[12pt]{article}

\usepackage[a4paper, top = 0.8cm, left = 1cm, right = 1cm, bottom = 0.8cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{ulem}
\usepackage{graphicx}
\usepackage{array}
\usepackage{xcolor}

\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
\newcolumntype{L}[1]{>{\arraybackslash}m{#1}}

\newcommand\Bstrut{\rule[-1ex]{0pt}{0pt}}

\begin{document}
    \pagestyle{empty}
    \centering
    \uline{\bfseries Gewindearten}\\
    \vspace{0.3cm}
    \begin{minipage}[t]{0.49\linewidth}
        \centering
        {\scriptsize
            \begin{minipage}[t]{0.77\linewidth}     
                \centering
                \setlength\extrarowheight{0.15cm}
                \begin{tabular}{@{} l|l|l @{}}
                    Bezeichung & Durchmesser & Fläche\\\hline
                    Außen-/Nenn- & $d$ & $A_{\!N\Bstrut} = \frac{\pi d^2}{4}$\\
                    \textcolor{blue}{Flanken-} & $d_{2\Bstrut} = d-0,64952 \cdot P$ & $A_2 = \frac{\pi d_2^2}{4}$\\
                    \textcolor{green}{Kern-} & $d_{3\Bstrut} = d-1,22687 \cdot P$ & $A_3 = \frac{\pi d_3^2}{4}$\\
                    \textcolor{red}{Spannungs-} & $d_{S\Bstrut} = 0,5 \cdot (d_2 + d_3) \cdot P$ & $A_S = \frac{\pi d_3^2}{4}$\\
                \end{tabular}
            \end{minipage}\hfill     
            \begin{minipage}[t]{0.23\linewidth} 
                \centering  
                $P$\\
                =\\ 
                Gewindesteigung\\
        \end{minipage}}\hfill
        \vspace*{0.2cm}
        \begin{minipage}[t]{0.3\linewidth}
            \centering  
            \raisebox{-.5\height}{\includegraphics[height=2.2cm]{example-image-a}}
            \hfill
        \end{minipage}\hfill
        \begin{minipage}[t]{0.3\linewidth}
            \centering
            \hfill
            \raisebox{-.5\height}{\includegraphics[height=2.2cm]{example-image-a}}
        \end{minipage}\hfill
        \begin{minipage}[t]{0.3\linewidth}
            \centering
            \raisebox{-.5\height}{\includegraphics[height=2.2cm]{example-image-a}}
            \hfill
        \end{minipage}\hfill
    \end{minipage}\hfill\vrule\hfill
    \begin{minipage}[t]{0.49\linewidth}
        \centering
        \vspace{0.2cm}
        {\tiny
            \begin{tabular}{@{} L{1.3cm}C{1.1cm}L{5.96cm} @{}}
                Gewindetyp & Ausführung & Beschreibung\\\hline
                Spitzgewinde & \raisebox{-.5\height}{\includegraphics[width=1cm]{example-image-a}}& Übliches Befestigunsgewinde\\
                Trapezgewinde & \raisebox{-.5\height}{\includegraphics[width=1cm]{example-image-a}} & Bewegungsgewinde (Bsp.: Leitspindeln)\\
                Rundgewinde & \raisebox{-.5\height}{\includegraphics[width=1cm]{example-image-a}} & Bewegungsgewinde für hochverschmutzte Geräte\\
                Sägegewinde & \raisebox{-.5\height}{\includegraphics[width=1cm]{example-image-a}} & Bewegungsgewinde bei einseitiger Belastungsrichtung\\
                Flachgewinde & \raisebox{-.5\height}{\includegraphics[width=1cm]{example-image-a}} & Nicht abgeschrägtes Ineinandergreifen der Zähne\\
        \end{tabular}}
    \end{minipage}\hfill
\end{document}

Producing this page: enter image description here

How can I fix the vertical alignment of each of the pages? I already tried \vfill as well as \raisebox, though uncessfully. The issue is present in the minipage right to the small table, the pictures below the table as well as the table on the right most minipage.

I would really appreciate it if somebody could help me!

Thanks!

  • Please don't "accept" the first good answer that comes your way right away, unless you really really wish to discourage other would-be answer writers from providing additional solutions. You are, of course, encouraged to up-vote any good answers immediately. However, site guidelines suggest that one should wait several hours, and maybe even a day or so, before "accepting" the answer that's most helpful. – Mico May 8 '17 at 19:32
  • @Mico I just don't expect anybody to answer a question that has already been sufficiently answered.. so I want to give the person that answered it the deserved reputation. I will consider what you said for the future though. – Skydiver May 8 '17 at 19:36
  • There's usually more than one good way to typeset tabular material. An answer that may appear to you to be "sufficiently good" at first glance may turn out to be inferior to another answer that somebody else might come up with. However, you won't find out about these other solution possibilities if you, de facto, discourage people from posting them in the first place. – Mico May 8 '17 at 19:39
  • @Mico I do understand you point and will, as said, take this into consideration for future activities on this site. – Skydiver May 8 '17 at 19:44
2

Not sure quite what layout you want, but this is perhaps closer:

enter image description here

\documentclass[12pt]{article}

\usepackage[a4paper, top = 0.8cm, left = 1cm, right = 1cm, bottom = 0.8cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{ulem}
\usepackage{graphicx}
\usepackage{array}
\usepackage{xcolor}

\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
\newcolumntype{L}[1]{>{\arraybackslash}m{#1}}

\newcommand\Bstrut{\rule[-1ex]{0pt}{0pt}}

\begin{document}
    \pagestyle{empty}
    \centering
    \uline{\bfseries Gewindearten}

    \vspace{0.3cm}
    \begin{minipage}[t]{0.49\linewidth}
        \centering
        {\scriptsize
            \begin{minipage}[t]{0.7\linewidth}     
                \centering
        \vspace{0cm}
                \setlength\extrarowheight{0.15cm}
                \begin{tabular}{@{} l|l|l @{}}
                    Bezeichung & Durchmesser & Fläche\\\hline
                    Außen-/Nenn- & $d$ & $A_{\!N\Bstrut} = \frac{\pi d^2}{4}$\\
                    \textcolor{blue}{Flanken-} & $d_{2\Bstrut} = d-0,64952 \cdot P$ & $A_2 = \frac{\pi d_2^2}{4}$\\
                    \textcolor{green}{Kern-} & $d_{3\Bstrut} = d-1,22687 \cdot P$ & $A_3 = \frac{\pi d_3^2}{4}$\\
                    \textcolor{red}{Spannungs-} & $d_{S\Bstrut} = 0,5 \cdot (d_2 + d_3) \cdot P$ & $A_S = \frac{\pi d_3^2}{4}$\\
                \end{tabular}
            \end{minipage}\hfill     
            \begin{minipage}[t]{0.23\linewidth} 
                \centering  
        \vspace{1cm}
                $P$\\
                =\\ 
                Gewindesteigung\\
        \end{minipage}}

        \vspace*{.2cm}

            \raisebox{-.5\height}{\includegraphics[height=2.2cm]{example-image-a}}%
            \hfill
            \raisebox{-.5\height}{\includegraphics[height=2.2cm]{example-image-a}}
            \hfill
            \raisebox{-.5\height}{\includegraphics[height=2.2cm]{example-image-a}}
            \hfill
    \end{minipage}\hfill\vrule\hfill
    \begin{minipage}[t]{0.49\linewidth}
        \centering
        \vspace{0cm}
        {\tiny
            \begin{tabular}{@{} L{1.3cm}C{1.1cm}L{5.96cm} @{}}
                Gewindetyp & Ausführung & Beschreibung\\\hline
                Spitzgewinde & \raisebox{-.5\height}{\includegraphics[width=1cm]{example-image-a}}& Übliches Befestigunsgewinde\\
                Trapezgewinde & \raisebox{-.5\height}{\includegraphics[width=1cm]{example-image-a}} & Bewegungsgewinde (Bsp.: Leitspindeln)\\
                Rundgewinde & \raisebox{-.5\height}{\includegraphics[width=1cm]{example-image-a}} & Bewegungsgewinde für hochverschmutzte Geräte\\
                Sägegewinde & \raisebox{-.5\height}{\includegraphics[width=1cm]{example-image-a}} & Bewegungsgewinde bei einseitiger Belastungsrichtung\\
                Flachgewinde & \raisebox{-.5\height}{\includegraphics[width=1cm]{example-image-a}} & Nicht abgeschrägtes Ineinandergreifen der Zähne\\
        \end{tabular}}
    \end{minipage}
\end{document}
  • I've no idea why the vspaces fixed it the way they did, but thank you it worked! Is the a way to vertically center the right table on it's minipage automaticall? – Skydiver May 8 '17 at 18:46
  • @Skydiver vertical centre is the default for both minipage and tabular but you have over-ridden that and forced [t] top alignment everywhere. i didn't change that. – David Carlisle May 8 '17 at 18:51
  • Removing the [t] moves the table up instead of down though.. – Skydiver May 8 '17 at 19:05
  • @Skydiver yes, that would be expected. If you have zzzz \begin{tabular}[t] then the top row of the table aligns with zzzz if you remove the [t] or equivalently use [c] then the centre of the table aligns with zzz so the table is effectively shifted up by half its height. – David Carlisle May 8 '17 at 19:08
2

Here's a version that doesn't impose \tiny on the material on the right-hand half of the page. This should make it a lot easier on your readers to actually read and absorb what you've written.

enter image description here

\documentclass[12pt]{article}

\usepackage[a4paper,vmargin=0.8cm,hmargin=1cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,graphicx,array,xcolor,multirow}

\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
\newcolumntype{L}[1]{>{\arraybackslash}m{#1}}
\usepackage{tabularx}
\renewcommand{\tabularxcolumn}[1]{m{#1}}
\newcolumntype{Y}{>{\raggedright\arraybackslash}X}

\newcommand\Bstrut{\rule[-1ex]{0pt}{0pt}}

\begin{document}
\pagestyle{empty}
\centering
\textbf{Gewindearten}

\vspace{3mm}

\begin{minipage}[t]{0.49\linewidth}  % left-hand half
\scriptsize
\setlength\extrarowheight{1.5mm}
\begin{minipage}[t]{\linewidth}     
\begin{tabular}[t]{@{} l|>{$}l<{$}|>{$}l<{$} c @{}}
     Bezeichnung & $Durchmesser$ & $Fläche$\\
     \cline{1-3}
     Außen-/Nenn- & 
          d & 
          A_N = \frac{\pi}{4\Bstrut} d^2\\
     \textcolor{blue}{Flanken-} & 
          d_{2} = d-0{,}64952  P & 
          A_2 = \frac{\pi}{4\Bstrut} d_2^2 &
          \multirow{3}{*}{\begin{tabular}{@{}c@{}}   
               $P={}$\\Gewindesteigung
              \end{tabular}}\\
     \textcolor{green}{Kern-} & 
          d_{3} = d-1{,}22687  P & 
          A_3 = \frac{\pi}{4\Bstrut} d_3^2\\
     \textcolor{red}{Spannungs-} & 
          d_{S} = 0{,}5  (d_2 + d_3)  P & 
          A_S = \frac{\pi}{4} d_3^2\\
\end{tabular} 
\end{minipage}

\vspace{4mm}
\begin{minipage}[t]{\linewidth}
\includegraphics[width=0.3\linewidth]{example-image-a}%
\hfill
\includegraphics[width=0.3\linewidth]{example-image-a}%
\hfill
\includegraphics[width=0.3\linewidth]{example-image-a}%
\end{minipage}
\end{minipage}%   %% end of left-hand half
\hfill\vrule\hfill
\begin{minipage}[t]{0.49\linewidth} % right-hand half
\centering
\scriptsize
\setlength\tabcolsep{2pt}
\begin{tabularx}{\linewidth}[t]{@{} l C{1.6cm}Y @{}}
     Gewindetyp & Ausführung & Beschreibung\\
     \hline
     Spitzgewinde & \includegraphics[width=1cm]{example-image-a}
        & Übliches Befestigungsgewinde\\[-1mm]
     Trapezgewinde & \includegraphics[width=1cm]{example-image-a} 
        & Bewegungsgewinde (Bsp.: Leitspindeln)\\[-1mm]
     Rundgewinde & \includegraphics[width=1cm]{example-image-a} 
        & Bewegungsgewinde für hochverschmutzte Geräte\\[-1mm]
     Sägegewinde & \includegraphics[width=1cm]{example-image-a} 
        & Bewegungsgewinde bei einseitiger Belastungsrichtung\\[-1mm]
     Flachgewinde & \includegraphics[width=1cm]{example-image-a} 
        & Nicht abgeschrägtes Ineinandergreifen der Zähne
\end{tabularx}
\end{minipage}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.