我如何添加用于手写文本的“字段”?

我如何添加用于手写文本的“字段”?

我需要在我的文档中添加一堆手写文本字段,如下所示:

Your Name ___________
Your Age  ___________

作为示例,我可以向您展示我必须重现的表格:

正如您所看到的,在顶部和中间我们有这样的字段。

当然我也考虑过_符号,但我认为______一直打字不是 TeX 风格。

答案1

对于我的考试,我使用:

  \begin{center}Name: \line(1,0){275} \end{center}

很简单。(话虽如此,我会看看@lockstep 提到的包。)

答案2

看看dashundergaps包装。包装说明:

该软件包提供了命令(\un­der­line\dotu­line\dashu­line),每个命令都用软件包能够使用的样式之一为其参数加下划线。还提供了幻影模式,其中下划线(无论何种形式)可用作学生评估表的“填充块”。

答案3

要记住的一件事是,您可能会想要一些允许您指定整个字段(包括标签)的宽度以用于对齐目的。morbusg 的解决方案以这种方式工作,我的解决方案也是如此:

% GENERAL USAGE: \COMMAND[width]{text}
\def\entrywithlabel[#1]#2{\parbox{#1}{{\small #2:} \hrulefill}}
\def\entrywithlabelunder[#1]#2{\parbox{#1}{\hrulefill\\[-.75ex]\centerline {#2}}}
\def\entrywithlabelraised[#1]#2{\parbox{#1}{\smash{\raise-1ex\hbox{{\tiny #2}}}\hrulefill}}
\def\boxentry[#1]#2{{\setlength{\fboxsep}{-\fboxrule}\fbox{\parbox{#1}{\smash{\raise-6.5pt\hbox{~{\tiny #2}}}\vspace{2ex}\mbox{}}}}}
\def\boxpar[#1]#2#3{{\setlength{\fboxsep}{-\fboxrule}\fbox{\parbox[][#2][t]{#1}{\mbox{}\\[-.125\baselineskip]\mbox{}~#3}}}}

我还喜欢使用\dynTable自动生成空白表行的命令:

% Usage: \dynTable{\begin{tabular}{tablespec}}{# repetitions}{rows}{\end{tabular}}
\makeatletter
\newcommand*{\InitToks}{\toks@={}}
\newcommand{\AddToks}[1]{\toks@=\expandafter{\the\toks@ #1}}
\newcommand*{\PrintToks}{\the\toks@}

\newcount\rowNo
\newcommand*{\dynTable}[4]{%
  \begingroup
    \InitToks\AddToks{#1}%
    \rowNo=0 %
    \loop\ifnum\rowNo<#2\relax\advance\rowNo by 1
      \expandafter\AddToks\expandafter{#3}%
    \repeat
   \AddToks{#4}\PrintToks
  \endgroup}
\makeatother

月末分配工作表示例:

\documentclass[11pt,letterpaper]{article}
\usepackage[centering,width=7.5in,height=9.5in]{geometry}
\usepackage[parfill]{parskip}
\pagestyle{empty}

% GENERAL USAGE: \COMMAND[width]{text}
\def\entrywithlabel[#1]#2{\parbox{#1}{{\small #2:} \hrulefill}}
\def\entrywithlabelunder[#1]#2{\parbox{#1}{\hrulefill\\[-.75ex]\centerline {#2}}}
\def\entrywithlabelraised[#1]#2{\parbox{#1}{\smash{\raise-1ex\hbox{{\tiny #2}}}\hrulefill}}
\def\boxentry[#1]#2{{\setlength{\fboxsep}{-\fboxrule}\fbox{\parbox{#1}{\smash{\raise-6.5pt\hbox{~{\tiny #2}}}\vspace{2ex}\mbox{}}}}}
\def\boxpar[#1]#2#3{{\setlength{\fboxsep}{-\fboxrule}\fbox{\parbox[][#2][t]{#1}{\mbox{}\\[-.125\baselineskip]\mbox{}~#3}}}}

% Usage: \dynTable{\begin{tabular}{tablespec}}{# repetitions}{rows}{\end{tabular}}
\makeatletter
\newcommand*{\InitToks}{\toks@={}}
\newcommand{\AddToks}[1]{\toks@=\expandafter{\the\toks@ #1}}
\newcommand*{\PrintToks}{\the\toks@}

\newcount\rowNo
\newcommand*{\dynTable}[4]{%
  \begingroup
    \InitToks\AddToks{#1}%
    \rowNo=0 %
    \loop\ifnum\rowNo<#2\relax\advance\rowNo by 1
      \expandafter\AddToks\expandafter{#3}%
    \repeat
   \AddToks{#4}\PrintToks
  \endgroup}
\makeatother

\begin{document}

\entrywithlabel[.45\hsize]{Month}\hfill \entrywithlabel[.45\hsize]{Year}    \entrywithlabel[.45\hsize]{Submitter}\hfill  \entrywithlabel[.45\hsize]{Date}    \begin{center}
  \def\h#1{\multicolumn{1}{c|}{\bfseries #1}}
  \def\H#1{\multicolumn{1}{|c|}{\bfseries #1}}
  \def\arraystretch{1.5}
  \dynTable{%
\begin{tabular}{@{}|@{}p{3in}@{}|@{}p{.75in}@{}|@{}p{.75in}@{}|@{}p{3in}@{}|@{}}\hline
\H{Account} & \h{Debit} & \h{Credit} & \h{Project}\\\hline\hline
}{25}{ &&&\\\cline{2-4} }{&&&\\\hline\end{tabular}}
\end{center}

\end{document}

财务报告

使用 boxentry 和 entrywithlabelunder 的更精美的绩效报告

\documentclass[11pt,letterpaper]{article}
\usepackage[centering,width=7in,height=10in]{geometry}
\usepackage[parfill]{parskip}
\usepackage{array,tabularx}
\renewcommand{\title}[2][]{\begin{center}\sffamily\bfseries\Large #2\ifx\relax#1\else\\\normalsize #1\fi\end{center}\vspace{1ex}}
\pagestyle{empty}

% GENERAL USAGE: \COMMAND[width]{text}
\def\entrywithlabel[#1]#2{\parbox{#1}{{\small #2:} \hrulefill}}
\def\entrywithlabelunder[#1]#2{\parbox{#1}{\hrulefill\\[-.75ex]\centerline {{\small #2}}}}
\def\entrywithlabelraised[#1]#2{\parbox{#1}{\smash{\raise-1ex\hbox{{\tiny #2}}}\hrulefill}}
\def\boxentry[#1]#2{{\setlength{\fboxsep}{-\fboxrule}\fbox{\parbox{#1}{\smash{\raise-6.5pt\hbox{~{\tiny #2}}}\vspace{2ex}\mbox{}}}}}
\def\boxpar[#1]#2#3{{\setlength{\fboxsep}{-\fboxrule}\fbox{\parbox[][#2][t]{#1}{\mbox{}\\[-.125\baselineskip]\mbox{}~#3}}}}
\begin{document}

\title{Performance Report}

\boxentry[.5\hsize]{Employee Name}\boxentry[.5\hsize]{Job Title}\\[-1.5pt]
\boxentry[.5\hsize]{Salary}\boxentry[.5\hsize]{Date Hired}\\[-1.5pt]
\boxentry[.5\hsize]{Reviewer Name}\boxentry[.5\hsize]{Date of Review}

{ \setlength{\extrarowheight}{-3pt}
  \def\arraystretch{3}
  \def\row#1{#1&&\\\hline}
  \begin{tabularx}{\hsize}{|l|c|X|}\hline
    \multicolumn{1}{|c|}{\textbf{Category}} & \textbf{Grade} & \mbox{}\hfill\textbf{Comments}\hfill\mbox{}\\\hline
    \row{Attendance/Punctuality}
    \row{Work Attitude}
    \row{Mathematical Quality}
    \row{Independence}
    \row{Pedagogical Skill}
    \row{Interpersonal Skill}
  \end{tabularx}
}

\boxpar[\hsize]{2in}{Reviewer Summary {\small (provide attachments if additional details required)}:}\\[-1.5pt]
\boxpar[\hsize]{2in}{Goals:}

\vfill

\entrywithlabelunder[.45\hsize]{Employee Signature}\hfill\entrywithlabelunder[.45\hsize]{Reviewer Signature}\\[-\baselineskip]

\end{document}

绩效报告

答案4

我之前用过类似的东西:

\long\def\question#1\par{\bigskip\vbox{#1\par
  \hbox to\hsize{\hrulefill}\par
  \hbox to\hsize{\hrulefill}}\bigskip}
\def\info#1\par{#1\hrulefill\hss\par}
\everypar={\setbox0=\lastbox}
\baselineskip=15pt
\hsize=.5\hsize
\info Your Name

\info Your Age

\question Something very lengthy about you

\bye

在此处输入图片描述

相关内容