Создание LaTeX-версии таблицы шкалы юзабилити системы

Создание LaTeX-версии таблицы шкалы юзабилити системы

Я пытаюсь создать версию LaTeXШкала удобства использования системыкоторый довольно точно воспроизводит оригинал. Он примерно напоминает таблицу, но является ее довольно специализированной версией.

Выдержка из анкеты по шкале удобства использования системы

Моя довольно наивная попытка, в которой я теряю правильный интервал

\documentclass[12pt,twoside,a4paper]{article}
\usepackage[utf8]{inputenc}

\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\pagestyle{plain}

\begin{document}
\begin{table}[]
\centering
\caption{My caption}
\label{my-label}
\begin{tabular}{L{0.5\textwidth}|C{0.1\textwidth}|C{0.1\textwidth}|C{0.1\textwidth}|C{0.1\textwidth}|C{0.1\textwidth}|}
\cline{2-6}
I think that I would like to use this system frequently                                   & 1 & 2 & 3 & 4 & 5 \\ \cline{2-6} 
I found the system unnecessarily complex                                                  & 1 & 2 & 3 & 4 & 5 \\ \cline{2-6} 
I thought the system was easy to use                                                      & 1 & 2 & 3 & 4 & 5 \\ \cline{2-6} 
I think that I would need the support of a technical person to be able to use this system & 1 & 2 & 3 & 4 & 5 \\ \cline{2-6} 
I found the various functions in this system were well integrated                         & 1 & 2 & 3 & 4 & 5 \\ \cline{2-6} 
I thought there was too much inconsistency in this system                                 & 1 & 2 & 3 & 4 & 5 \\ \cline{2-6} 
I would imagine that most people would learn to use this system very quickly              & 1 & 2 & 3 & 4 & 5 \\ \cline{2-6} 
I found the system very cumbersome to use                                                 & 1 & 2 & 3 & 4 & 5 \\ \cline{2-6} 
I felt very confident using the system                                                    & 1 & 2 & 3 & 4 & 5 \\ \cline{2-6} 
I needed to learn a lot of things before I could get going with this system               & 1 & 2 & 3 & 4 & 5 \\ \cline{2-6} 
\end{tabular}
\end{table}
\end{document}

Я хотел бы узнать, следует ли для достижения этого стиля использовать 100% таблицы или есть ли трюк, чтобы правые строки оборачивали числа? Я бы хотел избежать использования изображений.

решение1

Я полагаю, можно сделать что-то вроде следующего. Это объединяет среду enumerate с табличной. (Ниже приведена отредактированная версия, содержащая новую команду \printtblhdr, которая теперь используется после \section.)

\documentclass[12pt,twoside,a4paper]{article}
\usepackage[showframe]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{enumitem}
\setlist[enumerate,1]{labelindent=0pt, leftmargin=*}
\usepackage{array,tabularx}

\newcolumntype{P}{>{\centering\arraybackslash}p{0.75cm}}
\newcolumntype{L}{>{\raggedright\arraybackslash}m{0.2\textwidth}}
\newcolumntype{R}{>{\raggedleft\arraybackslash}m{0.2\textwidth}}

\newcommand{\printtblhdr}{%
  \hfill
  \begingroup
  \setlength\tabcolsep{0pt}%
  \begin{tabularx}{0.41\textwidth}{ @{} l *{3}X r @{} }
    \multicolumn{2}{l}{\bfseries\shortstack[l]{Strongly\\ Disagree}}
    &&
    \multicolumn{2}{l}{\bfseries\shortstack[r]{Strongly\\ Agree}}
    \\
  \end{tabularx}
  \endgroup
}

\newcommand{\usetbl}{%
  \begin{tabular}{@{}|*5{P|}@{}}
    \hline
    1 & 2 & 3 & 4 & 5 \\
    \hline
  \end{tabular}
}

\newcommand\prop[1]{%
  \item
  \parbox[t]{0.5\textwidth}{#1}%
  \qquad
  \parbox[t]{0.5\textwidth}{\usetbl}%
}


\begin{document}

\section{Your Views Are Important to Us}


\printtblhdr

\begin{enumerate}
\prop{I think that I would like to use this system frequently}

\prop{I found the system unnecessarily complex}

\prop{I thought the system was easy to use}

\prop{I think that I would need the support of a technical person to be able to use this system}

\prop{I found the various functions in this system were well integrated}

\prop{I thought there was too much inconsistency in this system}

\prop{I would imagine that most people would learn to use this system very quickly}

\prop{I found the system very cumbersome to use}

\prop{I felt very confident using the system}

\prop{I needed to learn a lot of things before I could get going with this system}

\end{enumerate}

\end{document}

решение2

Стиль с автоматической нумерацией и автоматическим размещениемscaletable

\documentclass[12pt,twoside,a4paper]{article}
\usepackage[utf8]{inputenc}

\usepackage{array}

\newcounter{rowcntr}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{N}[1]{>{\stepcounter{rowcntr}\therowcntr.}R{#1}}




\newcommand{\scaletable}{%
  \begin{tabular}[t]{|*{5}{c|}}%
    \hline
    1 & 2 & 3 & 4 & 5 \tabularnewline
    \hline
  \end{tabular}
}



\pagestyle{plain}

\begin{document}
\begin{table}[]
\centering
\caption{My caption}
\label{my-label}
\begin{tabular}{N{1cm}L{0.6\textwidth}C{0.3\textwidth}}
\multicolumn{1}{l}{}  & &     \footnotesize \bfseries\parbox{0.14\textwidth}{Strongly\\ disagree}\parbox{0.14\textwidth}{\raggedleft Strongly agree} \tabularnewline
&I think that I would like to use this system frequently                                   & \scaletable \tabularnewline
&I found the system unnecessarily complex                                                  & \scaletable \tabularnewline
&I thought the system was easy to use                                                      & \scaletable \tabularnewline
&I think that I would need the support of a technical person to be able to use this system & \scaletable \tabularnewline
&I found the various functions in this system were well integrated                         & \scaletable \tabularnewline
&I thought there was too much inconsistency in this system                                 & \scaletable \tabularnewline
&I would imagine that most people would learn to use this system very quickly              & \scaletable \tabularnewline
&I found the system very cumbersome to use                                                 & \scaletable \tabularnewline
&I felt very confident using the system                                                    & \scaletable \tabularnewline
&I needed to learn a lot of things before I could get going with this system               & \scaletable \tabularnewline
\end{tabular}
\end{table}
\end{document}

введите описание изображения здесь

решение3

Вы можете определить всю табличную часть с числами 1--5 и вертикальными и горизонтальными линиями как макрос (примерно как в вашем примере). Тогда остается определить табличную часть следующим образом

\begin{tabular}{L{0.5\textwidth}@{\YourEarlierDefinedMacro}}

В данном случае @определяет элемент, который появляется в каждом стихе.

Связанный контент