Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'd like to produce a bunch of pages in the 'minicard' format (2.75 by 1.1), with a 1-inch qr code taking up one side of the thing, and centered multiline text on the other side.

Unfortunately, I don't have a handle on vertical centering. My current approach uses the 'm' column type, which supposedly centers text vertically, but that isn't happening:

\documentclass{article}

\usepackage{graphicx}
\usepackage{array}
\usepackage[margin=.05in,papersize={2.75in,1.1in}]{geometry}
\begin{document}

\renewcommand\arraystretch{0}
\renewcommand\tabcolsep{0pt}

\begin{table}
\begin{tabular}{p{1in} | >{\centering\arraybackslash}m{1.65in} |}
\hline
\includegraphics[width=1in,height=1in]{600px-QR_code_Wikimedia_Commons_(URL).png} 
& unique key a 
\\ \hline
\end{tabular}
\end{table}

\end{document}

A solution would be wonderful, but I'd settle for an explanation. Should I even be using a table?

share|improve this question
    
first post :) I wasn't able to insert a pair of images, but they seemed necessary to get my point across, so they've been code'd out. –  zpmorgan Aug 26 '12 at 9:52
1  
Welcome to TeX.sx! You need some more rep before able to include images so that they show automatically (I suspect this is a spam countering measure). I've included the images so that they show up in the post for you :-) –  morbusg Aug 26 '12 at 9:57
    
Put your image inside this macro \raisebox{-1cm}{\includegraphics[.... } which might give you an idea why this is happening :) –  percusse Aug 26 '12 at 9:58
add comment

1 Answer 1

up vote 2 down vote accepted

This is a known bug in the package, as described here: Vertical alignment in table: m-column, row size - problem in last column

You can use the tweak in your case too. You ought to increase the dimesions a bit to get rid of the warnings and to get everything settled correctly:

\documentclass{article}

\usepackage[demo]{graphicx} % remove `[demo]` in your case
\usepackage{array}
\usepackage[margin=.05in,papersize={2.79in,1.12in}]{geometry}
\begin{document}

\renewcommand\arraystretch{0}
\renewcommand\tabcolsep{0pt}

\begin{table}
\begin{tabular}{m{1.02in} | >{\centering\arraybackslash}m{1.65in} |@{}m{0pt}@{}}
\hline
\includegraphics[width=1in,height=1in]{600px-QR_code_Wikimedia_Commons_(URL).png} 
& unique key a 
&\\ \hline
\end{tabular}
\end{table}

\end{document}
share|improve this answer
    
Wow, thanks! That worked perfectly. –  zpmorgan Aug 26 '12 at 10:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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