我想用 LaTeX 重新创建一个表单,可以手动填写,或者 --- 当然 --- 通过 LaTeX 填写。如何创建框,顶部带有脚注大小的标签,并留有足够的空间来填充文本?
答案1
一种方法是使用mdframed
包:
笔记:
- 如果您只是使用打印的表格,则可以使用
MyForm
宏。但是,如果您希望表格可以以电子方式填写,则可以使用宏\MyFormX
(按照 Marco Daniel 的建议)。
代码:
\documentclass{article}
\usepackage{mdframed}
\usepackage{xcolor}
%% Use this if you want it electronically editable PDF.
\usepackage{hyperref}
\newcommand{\MyFormX}[2][1.0cm]{%
\begin{mdframed}[style=MyFormStyle]%
{\noindent\footnotesize#2}\\%
\TextField[format={var f =f.textFont = 'Verdana';f.strokeColor =['T'];f.fillColor=['T']}, width=\linewidth, height=#1, charsize=10pt]{ }%
\end{mdframed}%
}
\mdfdefinestyle{MyFormStyle}{%
linewidth=1.5pt,
skipbelow=\topskip,
skipabove=\topskip
}
\newcommand{\MyForm}[2][1.0cm]{%
\begin{mdframed}[style=MyFormStyle]%
{\noindent\footnotesize#2}\vspace{#1}%
\end{mdframed}%
}
\begin{document}
Text before. Text before. Text before. Text before.
Text before. Text before. Text before. Text before.
Text before. Text before. Text before.
\MyFormX{This one is electronically fill-able}
\MyForm[2.0cm]{Larger Space}
Text after Text After Text after Text After Text after
Text After Text after Text After Text after Text After
Text after Text After Text after
\end{document}