4

This is somehow poorly documented subject, or I didn't search deep enought. It seems like there is some confusion with the term label in the ChoiceField.

Basicly all I need is to have the radio button at the left of the text label entry (not at the left of the category or whatever is called).

Using the renewcommand\LayoutChoiceField seems to work for CheckBox, but not with radio/choice.

\documentclass[9pt,a4paper,notitlepage]{extarticle}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{amsfonts}
\usepackage{hyperref}     
\renewcommand{\LayoutChoiceField}[2]{%
  \leavevmode #2 #1%
}    
\begin{document}    
\begin{Form}
Box in the left side, but not true radio    
Choose only one:
\ChoiceMenu[radio,radiosymbol=\ding{108}]{Option 1}{ }
\ChoiceMenu[radio,radiosymbol=\ding{108}]{Option 2}{ } 
\ChoiceMenu[radio,radiosymbol=\ding{108}]{Option 3}{ } 
\ChoiceMenu[radio,radiosymbol=\ding{108}]{Option 4}{ } 

\hrulefill

True radio, but box on the right side     
\ChoiceMenu[radio,radiosymbol=\ding{108}]{Choose only one:}{Option 1 ,Option 2 ,Option 3 ,Option 4 }
\end{Form}
\end{document}
2

Redifining the \LayoutChoiceField seems to confuse things by swapping texts designated to come before/after the button.

I found a simple way to solve two of your problems:

  1. One way to get a true radio, is to give them the same name

 \documentclass{article}
 \usepackage{hyperref}
 \usepackage{amsmath}
 \begin{document}
  \begin{Form}
    Box in the left side, \textbf{true} radio\\
    Choose only one:\;\;
    \ChoiceMenu[radio,radiosymbol=\ding{108}, name=a]{Option 1}{ }\;
    \ChoiceMenu[radio,radiosymbol=\ding{108}, name=a]{Option 2}{ }
  \end{Form}
 \end{document}
  1. To get text on the left/right of the button, why not type the text before/after the \ChoiceMenu[..., ...]{...}{ } command ? Keeping both the braces { } blank triggers the radio-button to vanish completely. So, a minimal text inside the first brace should do.

 \documentclass{article}
 \usepackage{hyperref, color}
 \usepackage{amsmath}
 \begin{document}
  \begin{Form}
    Box in the left side, \textbf{true} radio\\
    Choose only one:
    \ChoiceMenu[radio,radiosymbol=\ding{108}, name=b]{\textcolor{white}{:}}{ } Option 1\quad
    \ChoiceMenu[radio,radiosymbol=\ding{108}, name=b]{\textcolor{white}{:}}{ } Option 2\quad
  \end{Form}
 \end{document}

I admit the latter is a foolish way of doing it, but given the slowly gaining intelligence of the computer, one day it might be easier to communicate our wishes to the machine much more easily. Till then, we may have to satisfy ourselves with such 'foolish' things, if nothing better seems available.

  • @CarLaTeX Thanks for the keen feedback ! Now, both examples are separately tested (Sorry I did that within another document previously). The \includepackage{hyperref} completes both examples. An additional package {color} helps hide the :s with a \textcolor{white}{:}. – Partha D. Dec 8 '17 at 6:07

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.