4

Good night, friends.

How can I leave the elements (figures) in the table vertically aligned?

Follow the code below:

\begin{landscape}
\begin{figure}[!h]
  \centering
\caption{Vistas em perspectiva das placas (a) plana e com ondulações (b) quadradas, (c) trapezoidais e (d) triangulares.}

\begin{tabular}{cc}
\includegraphics[width=0.45\linewidth]{Capitulo3/Figuras/FigExp2a.png} & \includegraphics[width=0.45\linewidth]{Capitulo3/Figuras/FigExp2b.png} \\
(a)                                                                    & (b)                                                                    \\
\includegraphics[width=0.45\linewidth]{Capitulo3/Figuras/FigExp2c.png} & \includegraphics[width=0.45\linewidth]{Capitulo3/Figuras/FigExp2d.png} \\
(c)                                                                    & (d)                                                                   
\end{tabular}

\label{fig:desenhoplacas2}
\legend{Fonte: Próprio Autor.}
\end{figure}
\end{landscape}
5
  • Try \raisebox{-0.5\height}{...} for images. \raisebox{\dimexpr 0.5\depth-0.5\height}{...} in general. Commented Mar 22, 2021 at 2:39
  • 1
    Do you wish to center the entire figure environment vertically on the (landscape) page, or do you wish to center individual graphs within the tabular environment? Please clarify.
    – Mico
    Commented Mar 22, 2021 at 4:29
  • @Mico I would like the figures to be centered within the cells of the built support table. In the form of this image: i.sstatic.net/NiI1A.png
    – Sílvio
    Commented Mar 22, 2021 at 5:43
  • @JohnKormylo I did not understand. How would the code look? Where should I change?
    – Sílvio
    Commented Mar 22, 2021 at 5:44
  • \raisebox{-0.5\height}{\includegraphics[width=0.45\linewidth]{Capitulo3/Figuras/FigExp2a.png}}for example. Apply to each image in the row. Note, \raisebox works by moving the baseline. Commented Mar 22, 2021 at 13:50

2 Answers 2

3

You may achieve your formatting objective by employing the m column type that's provided by the array package.

enter image description here

\documentclass[demo]{article} % remove 'demo' option in real document
\usepackage[T1]{fontenc}
\usepackage[portuguese]{babel}
\usepackage{graphicx,threeparttable,pdflscape}
\usepackage{array} % for 'm' col. type and '\newcolumntype' macro
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}
\begin{document}

\begin{landscape}

\begin{figure}[!h]
\centering
\begin{threeparttable}
\caption{Vistas em perspectiva das placas (a) plana e com ondulações (b)~quadradas, (c) trapezoidais e (d) triangulares.}
\label{fig:desenhoplacas2}

\begin{tabular}{@{} *{2}{M{3.5in}} @{}}
\includegraphics[width=1\linewidth]{Capitulo3/Figuras/FigExp2a} & \includegraphics[width=1\linewidth]{Capitulo3/Figuras/FigExp2b} \\
(a) & (b) \\[2ex]
\includegraphics[width=1\linewidth]{Capitulo3/Figuras/FigExp2c} & \includegraphics[width=1\linewidth]{Capitulo3/Figuras/FigExp2d} \\
(c) & (d)                                                                   
\end{tabular}

\scriptsize Fonte: Próprio Autor. % how or where is "\legend" defined?
\end{threeparttable}
\end{figure}

\end{landscape}

\end{document}
0

A variation on Mico's answer with an undefined column width.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[portuguese]{babel}
\usepackage{graphicx,pdflscape}
\usepackage{array,collcell}
\newcolumntype{v}{>{\collectcell\myvcenter}c<{\endcollectcell}}
\newcommand{\myvcenter}[1]{\raisebox{\dimexpr 0.5\depth-0.5\height}{#1}}
\begin{document}

\begin{landscape}

\begin{figure}[!h]
\centering
\setlength{\belowcaptionskip}{\abovecaptionskip}% or \captionsetup{position=above} with caption package
\setlength{\abovecaptionskip}{0pt}%
\caption{Vistas em perspectiva das placas (a) plana e com ondulações (b)~quadradas, (c) trapezoidais e (d) triangulares.}
\label{fig:desenhoplacas2}

\begin{tabular}{vv}
\includegraphics[width=2cm]{example-image-a} & \includegraphics[width=1.5cm]{example-image-b} \\
(a) & (b) \\[2ex]
\includegraphics[width=1.5cm]{example-image-c} & \includegraphics[width=2cm]{example-image} \\
(c) & (d)                                                                   
\end{tabular}

\medskip
\scriptsize Fonte: Próprio Autor. % how or where is "\legend" defined?
\end{figure}

\end{landscape}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .