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'm using hyperref \CheckBox command to add checkboxes to a document for use on screen and in print.

I'm specifying the size of the \CheckBox (as part of command definition):

\CheckBox[width=0.8em,height=0.8em]{#1}

However, when the document is compiled with pdflatex the exact height specified is not used (the width does take effect). So, some of the checkboxes are square and some are not, which looks ugly.

I've tried changing the order of parameters, using absolute dimensions (e.g. 3mm) and relative (0.5\baselineskip) without success.

share|improve this question
5  
please give a complete example to see what exactly you did. –  Herbert Jan 20 '11 at 19:21
add comment

2 Answers

Just enclose the CheckBox in an mbox.

\mbox{\CheckBox[height=.5in,width=.5in]{Stuff}}

That will prevent the height from being set by other things in the same vbox as the CheckBox.

If you want to get into the hairy details of how these heights are set, you might consider reading Knuth's TeX book.

share|improve this answer
    
+1 Nice. I didn't think of that, and apparently neither did anyone else until you came along. :) –  Alan Munn Dec 24 '12 at 21:47
add comment

If you have another field (not necessarily another checkbox) in the same paragraph as your checkbox with a different height, all the fields will be the height of the largest one.

Example:

\documentclass{article}
\usepackage{hyperref}
\begin{document}
\begin{Form}
% These checkboxes will all have different heights.

\CheckBox[height=1in,width=1in]{Check}

\CheckBox[height=.5in,width=.5in]{Check}

\CheckBox[height=.25in,width=.25in]{Check}

%These checkboxes will all have the same (1in) height.

\CheckBox[height=1in,width=1in]{Check}
\CheckBox[height=.5in,width=.5in]{Check}
\CheckBox[height=.25in,width=.25in]{Check}


\end{Form}

\end{document}
share|improve this answer
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.