Skip to content

Instantly share code, notes, and snippets.

@dstndstn
Created August 31, 2017 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dstndstn/2de60ae0f9b7abecc66e50d4e68622a2 to your computer and use it in GitHub Desktop.
Save dstndstn/2de60ae0f9b7abecc66e50d4e68622a2 to your computer and use it in GitHub Desktop.
Latex: vertically aligning images in tables
\documentclass{article}
\usepackage{graphicx}
\usepackage{adjustbox}
\begin{document}
\begin{tabular}{ccc}
\adjustimage{width=0.1\textwidth,valign=T,frame}{method-a} &
\adjustimage{width=0.1\textwidth,valign=T,frame}{method-b} &
valign=T \\
\end{tabular}
\vspace{2em}
\begin{tabular}{ccc}
\adjustimage{width=0.1\textwidth,valign=M,frame}{method-a} &
\adjustimage{width=0.1\textwidth,valign=M,frame}{method-b} &
valign=M \\
\end{tabular}
\vspace{2em}
\begin{tabular}{ccc}
\adjustimage{width=0.1\textwidth,valign=B,frame}{method-a} &
\adjustimage{width=0.1\textwidth,valign=B,frame}{method-b} &
valign=B \\
\end{tabular}
\vspace{2em}
\begin{tabular}{ccc}
\adjustimage{width=0.1\textwidth,valign=t,frame}{method-a} &
\adjustimage{width=0.1\textwidth,valign=t,frame}{method-b} &
valign=t \\
\end{tabular}
\vspace{2em}
\begin{tabular}{ccc}
\adjustimage{width=0.1\textwidth,valign=m,frame}{method-a} &
\adjustimage{width=0.1\textwidth,valign=m,frame}{method-b} &
valign=m \\
\end{tabular}
\vspace{2em}
\begin{tabular}{ccc}
\adjustimage{width=0.1\textwidth,valign=b,frame}{method-a} &
\adjustimage{width=0.1\textwidth,valign=b,frame}{method-b} &
valign=b \\
\end{tabular}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment