使用 hyperref 包时如何插入 < 和 >?

使用 hyperref 包时如何插入 < 和 >?

我的代码在这里:

\documentclass{article}
\usepackage[linkcolor=black]{hyperref}
\begin{document}
\begin{Form}
\renewcommand*{\LayoutCheckField}[2]{#2 #1}
We want to build up a statistical model to predict tution fees of students. We will use these information to build up the model. Your privacy must be ensured. Please help us for developing the model by giving your information mentioning below-\\\\

\TextField[name=name,align=0]{Name:}\\\\
  \ChoiceMenu[radio,name=year]{Year:}{1st,2nd,3rd,4th,MS}\\\\
  \ChoiceMenu[radio,name=university]{University:}{DU,BUET,DMC,JU,JNU}\\\\
  \TextField[name=dept.]{Department:}  \ChoiceMenu[radio,name=section]{Section:}{Science,Arts,Commerce}\\\\
  \ChoiceMenu[radio,name=hsscsection]{HSC Section:}{Science,Arts,Commerce}\\\\
  \TextField[name=hsscCollege]{HSC College:}\\\\
  \TextField[name=hall]{Hall:}\ChoiceMenu[radio,name=hall]{}{mess,Basha}\\\\
  \TextField[name=homedistict]{Home District:}\\\\
  \ChoiceMenu[radio,name=foccupation]{Father's occupation:}{Farmer,Job holder,Businessman}\\\\
  \ChoiceMenu[radio,name=moccupation]{Mother's occupation:}{Housewife,Job holder}\\\\
  \TextField[name=familymembers]{Family members:}\\\\
  \TextField[name=earningmembers]{No. of earning members:}\\\\
  \TextField[name=birthposition]{Birth Position:}\\\\
  \ChoiceMenu[radio,name=texperi]{Experienc as tutor:}{no,1y,2y,3y,4y,4up}\\\\
  \ChoiceMenu[radio,name=scholarship]{Getting scholarship per month:}{0.00,1-2,2.1-3.0,3.1-4.0,4.1-5.0,5up}\\\\
  \ChoiceMenu[radio,name=takingmoneyhome]{Getting money per month from home:}{0.00,1-2,2.1-3.0,3.1-4.0,4.1-5.0,5up}\\\\
  \TextField[name=tourcount]{Number of tour per year:}\\\\
  \ChoiceMenu[radio,name=meal]{From where taking meal:}{Hall dyning/mess, Hall canteen, hotel,Basha}\\\\
  \ChoiceMenu[radio,name=GF]{Having GF?}{yes,no}\\\\
  \ChoiceMenu[radio,name=smoker]{Smoker?}{yes,no}\\\\
  \ChoiceMenu[radio,name=readd]{Having readdmission?}{yes,no}\\\\
  \ChoiceMenu[radio,name=result]{Result:}{\textless 2.5,<3.00,<3.5,<4.00}\\\\

\end{Form}
\end{document}

此代码结果:

Underfull \hbox (badness 10000) in paragraph at lines 6--7


Underfull \hbox (badness 10000) in paragraph at lines 6--7

(/usr/local/texlive/2016/texmf-dist/tex/latex/base/omlcmr.fd)
! TeX capacity exceeded, sorry [input stack size=5000].
\font@name ->
             \OML/cmr/m/n/10 
l.29 ...]{Result:}{\textless 2.5,<3.00,<3.5,<4.00}
                                                  \\\\
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on questionaire.log.

使用 时发生错误\textless。现在,我该如何插入<>

答案1

默认情况下,hyperref 不仅将值用作字段的标签,还将值用作表单的导出值。如果值包含用于排版的复杂命令,则这可能会有问题。在这种情况下,您可以使用 keyval 语法设置显式(更简单)的导出值:如果您添加一个按钮来显示字段的值(这也是要导出或发送到脚本的值),则可以看到显示的文本和值之间的差异:

\documentclass{article}
\usepackage{hyperref}

\begin{document}

\begin{Form}

\ChoiceMenu[radio,name=result,default=A]{Result:}{\textless 2.5=A,\textless 3.5=B,\textless 4.5=C}

\medskip     
\PushButton[onclick={app.alert("The value is " + this.getField("result").value)}]{Submit}
\end{Form}
\end{document}

在此处输入图片描述

相关内容