TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am writing this question after seeing this one as I had no idea that you could make forms like that in TeX.

Playing a bit with the code in that example I came across two issues I could not find how to change with the \TextField[parameters]{label}environment.

How to set the number of lines in a multiline environment and how to move the label at the top rather than the bottom of the multiline box.

According to the manual the option for the multiline environment is just a boolean parameter

multiline boolean false whether text box is multiline

and the label appears at the bottom rather than the top.

share|improve this question
up vote 1 down vote accepted
  1. To specify the height of a multiline text fielf, use the optional argument height, such as

  2. For vertical alignment, you could use \height which gives he height of a box, together with \raisebox, such as

    \renewcommand*{\LayoutTextField}[2]{\makebox[6em][l]{#1: }%
  3. You could even adjust the default height of a multiline text field, like


Here's a complete example for this, re-using the code of the linked question:

\renewcommand*{\LayoutTextField}[2]{\makebox[6em][l]{#1: }%
%\renewcommand*{\LayoutTextField}[2]{% or this or similar ...
  %\raisebox{-\height}{\makebox[6em][l]{#1: }}\raisebox{-\height}{#2}}
\def\LayoutChoiceField#1#2{\makebox[6em][l]{#1: }#2}
  backgroundcolor={.85 .85 .85}]{Name}\vskip1ex

  backgroundcolor={.85 .85 .85},]{Affiliation}\vskip1ex

  backgroundcolor={.85 .85 .85}]{Are you a}{Student, Academic}\\

  width=\longline,borderwidth=0,backgroundcolor={.85 .85 .85}]{Comments}\\

enter image description here

share|improve this answer
Is there a particular reason that the same code does not provide the same results with XeLatex? Everything appears to be misaligned again. I am using Xelatex for the fontspec package as I am trying to use a system font not available to pdftex – o4tlulz Jun 16 '12 at 10:05
@o4tlulz Interesting! I noticed that too. However, it works fine with LuaLaTeX. Could you use that? – Stefan Kottwitz Jun 16 '12 at 17:51

Your Answer


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.