1

I'm trying to create a form with labeled checkboxes.

Like this:

enter image description here

I have a nice pdf form written out using eforms, but I am unable to overlay anything on top of a checkbox or textfield. I was almost able to create the desired effect with the following code:

\documentclass{article}

\usepackage{eforms}

\begin{document}
\begin{Form}

\fbox{
\CheckBox[
name=course1,
radio=true,
radiosymbol=\ding{52},
borderwidth=0.0,
bordercolor={1 1 1},
width=12px,
height=14px]
{\mbox{}}}
\null \hspace{2px} 
\hspace{-33px}
\raisebox{-1px}{\framebox(22,16){\raisebox{-13px}{\hspace*{-16px}{\tiny 1a}}}}

\end{Form}
\end{document}

Which generates this:

enter image description here

I know this is a horrendous hack-job. And the first fbox has a border that I don't want. So I am sending this off to the internet gods in hopes of some mercy.

  • 2
    Could you please provide a complete, compilable MWE (minimal working example)? A MWE begins at \documentclass and ends at \end{document} – Skillmon Apr 3 '17 at 18:31
  • @Skillmon, thanks for the request. I have updated the code to be an MWE. – jdods Apr 3 '17 at 18:53
4

There are a number of problems with your code. First, 1px is an incredibly small unit. Second, \CheckBox and the Form environment are defined in hyperref, which is loaded by eforms.

The only way to move the letters closer to the checkmark is to reduce the width of the \CheckBox. 6pt is about as narrow as you can go.

\documentclass{standalone}

\usepackage{hyperref}

\begin{document}
\begin{Form}

\fboxsep=1pt
\fbox{\hspace{-\fboxsep}\raisebox{\dimexpr \fboxrule-\fboxsep}[0pt][0pt]{\tiny 1a}%
\hspace{-2pt}\CheckBox[
name=course1,
radio=true,
radiosymbol=\ding{52},
borderwidth=0,
bordercolor={1 1 1},
width=12pt,
height=14pt]{}}

\end{Form}
\end{document}

demo

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.