如何创建多个彼此相邻的复选框?

如何创建多个彼此相邻的复选框?

在此处输入图片描述

我已经能够使用以下代码创建交互式复选框\CheckBox{....}\\

但是我目前遇到了麻烦,无法弄清楚如何创建多个并排的框,如附图所示。非常感谢您的帮助!

\documentclass[11Pt]{article}

\usepackage{hyperref,wasysym}

\usepackage{fancyhdr}

\pagestyle{fancy}

\fancyhf{}

\fancyhead[LE,RO]{ATA-27}

\fancyhead[RE,LO]{Acceptance Test Manual}

\fancyfoot[CE,CO]{xxx}

\fancyfoot[LE,RO]{Page \thepage}

\renewcommand{\headrulewidth}{1pt}

\renewcommand{\footrulewidth}{1pt}

\begin{document}

\title{A320 Acceptance Test Manual (ATM)\ ATA 27 - Flight Controls}

\author{Parsa Shamsi}

\date{\today}

\maketitle

\break

\tableofcontents

\break

\begin{Form}

\section{On Ground}

\subsection{Indications}

\textbf{Set GREEN HYD SYS OFF:}\\

\CheckBox{Confirm Spoilers 1 and 5 are unavailable: }\\

\CheckBox{Confirm L and R GREEN SYS AIL are unavailable: }\\

\CheckBox{Confirm L inner ELEV is unavailable: }\\

\CheckBox{Confirm RUDDER GREEN SYS is unavailable: }\\

\section{In Flight}
\end{Form}
\end{document}

答案1

这里有一个演示两种不同方法的方法:一个使用,tabular另一个不使用。

代码:

  • 修复了包加载的顺序,将其放在hyperref最后;

  • 通过读取控制台并使用提供的geometry值来消除不一致的布局;fancyhdrheadheight

  • 演示如何避免 TeX 对坏框的抱怨,同时为现有示例插入额外的空格;

  • 以普通文本形式提供多个复选框的示例;

  • tabular提供了使用对齐的示例。

该解决方案使用arraybooktabs来格式化tabular示例。

\documentclass[11pt]{article}
\usepackage{wasysym}
\usepackage{fancyhdr,booktabs,array}
\usepackage[headheight=14pt]{geometry}% read the console - fandyhdr tells you what value you need for consistent layout!
\usepackage{hyperref}% load last unless you know a package should be loaded later

\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{ATA-27}
\fancyhead[RE,LO]{Acceptance Test Manual}
\fancyfoot[CE,CO]{xxx}
\fancyfoot[LE,RO]{Page \thepage}
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{1pt}

\begin{document}
\title{A320 Acceptance Test Manual (ATM)\ ATA 27 - Flight Controls}
\author{Parsa Shamsi}
\date{\today}
\maketitle
\break

\tableofcontents
\break

\begin{Form}
  \section{On Ground}

  \subsection{Indications}

  \textbf{Set GREEN HYD SYS OFF:}\bigskip

  \CheckBox{Confirm Spoilers 1 and 5 are unavailable: }\bigskip

  \CheckBox{Confirm L and R GREEN SYS AIL are unavailable: }\bigskip

  \CheckBox{Confirm L inner ELEV is unavailable: }\bigskip

  \CheckBox{Confirm RUDDER GREEN SYS is unavailable: }\bigskip

  \section{In Flight}

  Does this pass or fail? \CheckBox{ } \CheckBox{ } \CheckBox{ } \CheckBox{ }\bigskip

  And this?  \CheckBox{ } \CheckBox{ } \CheckBox{ } \CheckBox{ }\bigskip

  \begin{tabular}{l*{4}{>{\centering\arraybackslash}p{3.5em}}c@{}}

    \toprule
      & Pass & Fail & Unclear & N/A\\
    \midrule
    Test 1  & \CheckBox{ } & \CheckBox{ } & \CheckBox{ } & \CheckBox{ } &\\[1ex]
    Test 2  & \CheckBox{ } & \CheckBox{ } & \CheckBox{ } & \CheckBox{ } &\\[1ex]
    Test 3  & \CheckBox{ } & \CheckBox{ } & \CheckBox{ } & \CheckBox{ } &\\[1ex]
    Test 4  & \CheckBox{ } & \CheckBox{ } & \CheckBox{ } & \CheckBox{ } &\\[1ex]
    Test 5  & \CheckBox{ } & \CheckBox{ } & \CheckBox{ } & \CheckBox{ } &\\[1ex]
    \bottomrule
  \end{tabular}
\end{Form}
\end{document}

多方框

答案2

您可以尝试以下类似方法(注意:我已经简化了您的原始.tex文件):

\documentclass[11pt]{article}% note the change from 11Pt to 11pt
\usepackage{hyperref,wasysym,array}
% Not needed for minimal working example (MWE):
% \usepackage{fancyhdr}
% \pagestyle{fancy}
% \fancyhf{}
% \fancyhead[LE,RO]{ATA-27}
% \fancyhead[RE,LO]{Acceptance Test Manual}
% \fancyfoot[CE,CO]{xxx}
% \fancyfoot[LE,RO]{Page \thepage}
% \renewcommand{\headrulewidth}{1pt}
% \renewcommand{\footrulewidth}{1pt}

\newcommand\dblbox[1]{%
\addvspace{\baselineskip}%
\CheckBox{#1:~}\hspace{0.5em}\CheckBox{}}

\newcommand\tblbox[1]{%
#1: & \CheckBox{}\hspace{0.5em}\CheckBox{}\tabularnewline}

\begin{document}

\begin{Form}

\section{On Ground}

\subsection{Indications}

\textbf{Set GREEN HYD SYS OFF:}

\dblbox{Confirm Spoilers 1 and 5 are unavailable}

\dblbox{Confirm L and R GREEN SYS AIL are unavailable}

\dblbox{Confirm L inner ELEV is unavailable}

\dblbox{Confirm RUDDER GREEN SYS is unavailable}


\section{Or in a Table}

\begin{tabular}{l>{\raggedleft}p{3cm}}

\tblbox{Confirm Spoilers 1 and 5 are unavailable}

\tblbox{Confirm L and R GREEN SYS AIL are unavailable}

\tblbox{Confirm L inner ELEV is unavailable}

\tblbox{Confirm RUDDER GREEN SYS is unavailable}

\end{tabular}

\end{Form}
\end{document}

相关内容