如何设置两行的中心对齐?

如何设置两行的中心对齐?

这条线是该线的延续这里。我想将行 (YLEIS、EPAJARJESTYS) 的中心设置在相同的位置,以便该方法也适用于任意数量的行。代码

\documentclass{beamer}
\usepackage[english]{babel}
\usetheme{Berkeley}
\usepackage{microtype}% more flexibility for narrow columns
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{adjustbox}

\usepackage{eforms}

\begin{document}
\begin{frame}
\begin{adjustbox}{max width=1.1\textwidth,center}
\begin{table}[!ht]
\centering
    % TODO have Form options in the table cells
    \begin{tabular}{|l|l|l|l|l|l|l|l|l|}
    \hline
    \textbf{Key} & 
        \textbf{V2} & \textbf{V1} & \textbf{V0} 
        & \textbf{SCORE} 
        & \textbf{P1} & \textbf{P2} & \textbf{P3} 
        & \textbf{Critical} \\ \hline
        &  &  &  & 1. Skills &  &  &  & \\ \hline
    \end{tabular}
\end{table}
\end{adjustbox}

    \begin{tabular}{lll}
    V2 & V1 & V0  \\
    \radioButton{mybuttom}{1em}{1em}{1}
    &
    \radioButton{mybuttom}{1em}{1em}{2}
    &
    \radioButton{mybuttom}{1em}{1em}{3}
    &
    \end{tabular}
    %
    YLEIS
    %
    \begin{tabular}{lll}
    P1 & P2 & P3  \\
    \radioButton{mybuttom}{1em}{1em}{1}
    &
    \radioButton{mybuttom}{1em}{1em}{2}
    &
    \radioButton{mybuttom}{1em}{1em}{3}
    &
    \end{tabular}

    \begin{tabular}{lll}
    V2 & V1 & V0  \\
    \radioButton{mybuttom}{1em}{1em}{1}
    &
    \radioButton{mybuttom}{1em}{1em}{2}
    &
    \radioButton{mybuttom}{1em}{1em}{3}
    &
    \end{tabular}
    %
    EPAJARJESTYS
    %
    \begin{tabular}{lll}
    P1 & P2 & P3  \\
    \radioButton{mybuttom}{1em}{1em}{1}
    &
    \radioButton{mybuttom}{1em}{1em}{2}
    &
    \radioButton{mybuttom}{1em}{1em}{3}
    &
    \end{tabular}

\end{frame}

\begin{frame}
% Show reproduction of the answers in the next sheet. 

\end{frame}
\end{document}

图 1 输出

在此处输入图片描述

预期输出:行名称居中对齐

使用最少的标题测试 Ulrike 的方法

代码

\documentclass{beamer}
\usepackage[english]{babel}
\usetheme{Berkeley}
\usepackage{microtype}% more flexibility for narrow columns
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{adjustbox}

\usepackage{eforms}

\begin{document}
\begin{frame}
\begin{adjustbox}{max width=1.1\textwidth,center}
%    % TODO have Form options in the table cells
    \begin{tabular}{|l|l|l|l|l|l|l|l|l|}
    \hline
    \textbf{Key} &
        \textbf{V2} & \textbf{V1} & \textbf{V0}
        & \textbf{SCORE}
        & \textbf{P1} & \textbf{P2} & \textbf{P3}
        & \textbf{Critical} \\ \hline
        &  &  &  & 1. Skills &  &  &  & \\ \hline
    \end{tabular}
\end{adjustbox}

\begin{tabular}{@{}lll@{}}
    \begin{tabular}{lll}
    V2 & V1 & V0  \\
    \radioButton{mybuttom}{1em}{1em}{1}
    &
    \radioButton{mybuttom}{1em}{1em}{2}
    &
    \radioButton{mybuttom}{1em}{1em}{3}    
    \end{tabular}
    &
    YLEIS
    &
    \begin{tabular}{lll}
    P1 & P2 & P3  \\
    \radioButton{mybuttom}{1em}{1em}{1}
    &
    \radioButton{mybuttom}{1em}{1em}{2}
    &
    \radioButton{mybuttom}{1em}{1em}{3}
    \end{tabular}\\
    \begin{tabular}{lll}
    \radioButton{mybuttom}{1em}{1em}{1}
    &
    \radioButton{mybuttom}{1em}{1em}{2}
    &
    \radioButton{mybuttom}{1em}{1em}{3}    
    \end{tabular}
    &
    EPAJARJESTYS
    &
    \begin{tabular}{lll}
    \radioButton{mybuttom}{1em}{1em}{1}
    &
    \radioButton{mybuttom}{1em}{1em}{2}
    &
    \radioButton{mybuttom}{1em}{1em}{3}    
    \end{tabular}
\end{tabular}    

\end{frame}

\end{document}

图 2 复选框未对齐的输出

在此处输入图片描述

操作系统:Debian 9
TeXLive:2017 在/usr/local/
Acrotex 和 eforms 上手动安装:这里

答案1

您的代码无法编译,您的许多表格在一行中有很多单元格,而且您不应该将表格放在调整框内。除此之外:我可能会使用外部表格来对齐框:

\documentclass{beamer}
\usepackage[english]{babel}
\usetheme{Berkeley}
\usepackage{microtype}% more flexibility for narrow columns
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{adjustbox}

\usepackage{eforms}

\begin{document}
\begin{frame}
\begin{adjustbox}{max width=1.1\textwidth,center}
%    % TODO have Form options in the table cells
    \begin{tabular}{|l|l|l|l|l|l|l|l|l|}
    \hline
    \textbf{Key} &
        \textbf{V2} & \textbf{V1} & \textbf{V0}
        & \textbf{SCORE}
        & \textbf{P1} & \textbf{P2} & \textbf{P3}
        & \textbf{Critical} \\ \hline
        &  &  &  & 1. Skills &  &  &  & \\ \hline
    \end{tabular}
\end{adjustbox}

\begin{tabular}{@{}lll@{}}
   \begin{tabular}{lll}
    V2 & V1 & V0  \\
    \radioButton{mybuttom}{1em}{1em}{1}
    &
    \radioButton{mybuttom}{1em}{1em}{2}
    &
    \radioButton{mybuttom}{1em}{1em}{3}    
    \end{tabular}
    &
    YLEIS
    &
    \begin{tabular}{lll}
    P1 & P2 & P3  \\
    \radioButton{mybuttom}{1em}{1em}{1}
    &
    \radioButton{mybuttom}{1em}{1em}{2}
    &
    \radioButton{mybuttom}{1em}{1em}{3}
    \end{tabular}\\
    \begin{tabular}{lll}
    V2 & V1 & V0  \\
    \radioButton{mybuttom}{1em}{1em}{1}
    &
    \radioButton{mybuttom}{1em}{1em}{2}
    &
    \radioButton{mybuttom}{1em}{1em}{3}    
    \end{tabular}
    &
    EPAJARJESTYS
    &
    \begin{tabular}{lll}
    P1 & P2 & P3  \\
    \radioButton{mybuttom}{1em}{1em}{1}
    &
    \radioButton{mybuttom}{1em}{1em}{2}
    &
    \radioButton{mybuttom}{1em}{1em}{3}    
    \end{tabular}
\end{tabular}    

\end{frame}

\end{document}

在此处输入图片描述

相关内容