1

Two things I'm struggling with in the following MWE:

  1. "looooooooooonger text" doesn't fit: don't want the middle and right column to be equally spaced: the maple may move over a little to the right (but should not shift vertically by this operation).
  2. I've had several messy attempts at getting the maple to sit neatly vertically centred (and then vertically fudged according to discretion), see the many commented-out lines. There is probably a better way of doing it: David hinted to the \put command (?), see comment and link within the MWE. Suggestions welcome to better control the maple's vertical alignment (in the screenshot it is aligned as desired, but the code seems a mess).

enter image description here


MWE:

\documentclass[a4paper]{article}

\usepackage{graphicx}

%%%http://tex.stackexchange.com/questions/79414/how-to-align-the-following-in-a-table
\usepackage{calc}


 \newlength{\mylengthydate}
%\settowidth\mylengthydate{08/1968 – 10/1971}
\settowidth\mylengthydate{08/1968\,-\,10/1971}

%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{tabularx}

\usepackage{multirow}

% \usepackage{enumitem}
% \setlist[itemize]{nosep, leftmargin=*, partopsep=0pt}

%%% tex.SX (97180) - How to get column alignment in tabularx?
\usepackage{array}
\newcolumntype{Z}{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}X}
%{>{\hsize=1.5\hsize}X>{\hsize=0.5\hsize}X}

%------------------------------------

% \usepackage{layout}

\begin{document}

%%% \layout{}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{tabularx}{\textwidth}{@{}*{1}{p{\mylengthydate}}|*{1}{X}|*{1}{Z}@{}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%\begin{tabularx}{\textwidth}{@{}*{1}{p{\mylengthydate}}*{1}{l}*{1}{X}@{}}
%\begin{tabularx}{\textwidth}{@{}*{1}{p{\mylengthydate}}*{2}{X}@{}}
%\begin{tabularx}{\textwidth}{@{}*{1}{p{\mylengthydate}}|>{\hsize=1.5\hsize}X|>{\hsize=0.5\hsize}Z@{}}
%>{\hsize=1.5\hsize}
%\begin{tabularx}{\textwidth}{@{}*{1}{p{\mylengthydate}}|*{1}{X}|*{1}{c}@{}}
%\begin{tabularx}{\textwidth}{@{}*{2}{m{\mylengthydate}}*{1}{X}@{}}
%%% even older
%%% \begin{tabularx}{\textwidth}{@{}*{1}{m{\mylengthydate}}*{1}{l}*{1}{X}@{}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% http://en.wikibooks.org/wiki/LaTeX/Importing_Graphics
%% trim option's parameter order: left bottom right top
% \includegraphics[trim = 10mm 80mm 20mm 5mm, clip, width=3cm]{chicken}
% Note the presence of clip, as the trim operation will not work without it.
% Trick: You can also use negative trim values to add blank space to your graphics, in cases where you need some manual alignment.

%%%%% newest one (with pic on left)
%\multirow{7}{*}{\includegraphics[trim=0mm 0mm 0mm -5mm, clip, scale=0.15]{./figures/maple}}
%%%%%
%\includegraphics[trim=0mm -10mm 0mm -5mm, clip, scale=0.15]{./figures/maple}
%%% older ...
%\multirow{7}{*}{\includegraphics[scale=0.15]{./figures/maple}}
%\multirow{7}{*}{\includegraphics[trim=0mm 0mm 0mm -5mm, clip, scale=0.15]{./figures/maple}}
%%%%%%%%%%% \includegraphics[trim=0mm 0mm 0mm -5mm, clip, scale=0.15]{./figures/maple} & Date of birth

Some Thing
& some text here

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
& \multirow{8}{*}{\raisebox{-.83\height}[\ht\strutbox]{\includegraphics[trim=0mm 5mm -50mm 0mm, clip, scale=0.19]{./figures/maple}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% trim option's parameter order: left bottom right top
%& \raisebox{-\totalheight}{\multirow{8}{*}{\includegraphics[trim=0mm 0mm -50mm 0mm, clip, scale=0.23]{./figures/maple}}}
%%%http://tex.stackexchange.com/questions/79414/how-to-align-the-following-in-a-table
%%%http://www.golatex.de/wiki/\raisebox
%%%%%%%%%%%%% http://chat.stackexchange.com/transcript/message/22741805#22741805
%get rid of multirow and use \begin{picture}(0,0)\put(0,-10){\includegraphics{...}}\end{picture} and adjust the coordinate until it looks right
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%& \multirow{7}{*}{\raisebox{\baselineskip}{\includegraphics[trim=0mm 0mm -50mm 0mm, clip, scale=0.21]{./figures/maple}}}
%& \multirow{7}{*}{\includegraphics[trim=0mm -5mm -50mm 0mm, clip, scale=0.20]{./figures/maple}}
%& \multirow{7}{*}{\raisebox{5mm}[5mm]{\includegraphics[trim=0mm 0mm -50mm 0mm, clip, scale=0.21]{./figures/maple}}}
%& \raisebox{2\height}{\multirow{7}{*}{\includegraphics[trim=0mm 0mm -50mm 0mm, clip, scale=0.21]{./figures/maple}}}
%& \multirow{7}{*}{\raisebox{15mm}{\includegraphics[trim=0mm 0mm -50mm 0mm, clip, scale=0.21]{./figures/maple}}}
% & 
%& \multirow{7}{*}{\raisebox{0.01\baselineskip}[\ht\strutbox]{\includegraphics[trim=0mm 0mm -50mm 0mm, clip, scale=0.21]{./figures/maple}}}
%& \multirow{7}{*}{\raisebox{\baselineskip}[\ht\strutbox]{\includegraphics[trim=0mm 0mm -50mm 0mm, clip, scale=0.21]{./figures/maple}}}
%& \multirow{7}{*}{\raisebox{-\totalheight}[20mm]{\includegraphics[trim=0mm 0mm -50mm 0mm, clip, scale=0.21]{./figures/maple}}}
%%%% "hello!" :-)
%%%%& \multirow{7}{*}{\raisebox{\ht\strutbox-1.5\height}{{\includegraphics[trim=0mm 0mm -50mm 0mm, clip, scale=0.21]{./figures/maple}}}}
%& \multirow{7}{*}{\raisebox{-25mm}{{\includegraphics[trim=0mm 0mm -50mm 0mm, clip, scale=0.21]{./figures/maple}}}}
%%% older:
%%%%& \raisebox{-\totalheight}{\multirow{8}{*}{\includegraphics[trim=0mm 24mm -50mm 7mm, clip, scale=0.23]{./figures/maple}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\\

Some Thing
& some text here
&
\\

Some Thing
& some looooooooooooooooonger text here

&
\\

&&

\\[-0.5\normalbaselineskip]

07/1968\,-\,03/1970
& some text here
&
\\

08/1968\,-\,10/1971
& some text here
&
\\


Some Thing
& some text here
&
\\


\\[-\normalbaselineskip]


\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}

enter image description here

2

enter image description here

\documentclass[a4paper]{article}




\usepackage[framemethod=TikZ]{mdframed}


\definecolor{abcd}{RGB}{0,155,155}


\mdfsetup{skipabove=0pt,skipbelow=1.25\topskip, nobreak=true, innertopmargin=0.5\baselineskip, innerbottommargin=0.5\baselineskip, frametitleaboveskip=2pt, frametitlebelowskip=1pt, roundcorner=5pt}

\mdfdefinestyle{my_style_abcd}{%
     linecolor=abcd,middlelinewidth=0.7pt, frametitlebackgroundcolor=abcd}

\usepackage{tabularx}


%------------------------------------

% \usepackage{layout}


\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{mdframed}[style=my_style_abcd,frametitle=\color{white}{Important Information}\phantom{p}]


\noindent
\begin{tabularx}{\textwidth}{@{}l|X|c@{}}
Some Thing
& some text here
& \smash{\raisebox{-70pt}{\includegraphics[width=5em]{maple}}}
\\
Some Thing
& some text here
&
\\
Some Thing
& some looooooooooooooooonger text here
&
\\
&&
\\

07/1968\,--\,03/1970
& some text here
&
\\

08/1968\,--\,10/1971
& some text here
&
\\

Some Thing
& some text here
&
\\
\end{tabularx}

\end{mdframed}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}
  • A little bit more explanation would be nice :). – phx Jul 14 '15 at 14:25
  • @phx I just removed all the unnecessary code from the original and dropped in the maple leaf using \raisebox "by eye". All the mdframed setup is just copied. – David Carlisle Jul 14 '15 at 14:50

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.