7

I am trying to have an itemize inside one of the columns in a tabularx, but when trying to compile this code:

\begin{table}
\begin{tabularx}{\linewidth}{>{\setlength\hsize{.2\hsize}}X|>{\setlength\hsize{1.8\hsize}}X|>{\setlength\hsize{0.3\hsize}}X}
\textbf{Req.} & \textbf{Description} & \textbf{Priority} \\ \hline \hline
\textbf{FR1} & \textbf{Starting application and logging in:}The user has to be able to start the application and authorize himself against an authorizing mechanism. & High \\ \hline
\textbf{FR2} & \textbf{Send a message to another user:}The user has to be able send a simple message via regular email protocols to a recipient of own choice. & High \\ \hline
\textbf{FR3} & \textbf{Browse received messages:} The user has to be able to browse all messages he has received. & High \\ \hline
\textbf{FR4} & \textbf{Browse sent messages:} The user has to be able to browse all messages he has sent, and see the status of a sent message, where the relevant statuses are “message delivered” and “message read”. & High \\ \hline
\textbf{FR5} & \textbf{Viewing address book:} The user has to be able to view the address book with all contacts, so that he is able to choose a recipient from a list when he wants to send a message. & High \\ \hline
\textbf{FR6} & \textbf{Marking messages with a grade of importance:}The user has to be able to set Security Label, Message Priority and Message Type on a message, so that the receiver of the message knows who the message is intended for, how important it is and in what environment it is is of interest. The Message Priority will decide how intrusive XOXOmail is, that is, how much ihe app takes over the phone in order to show the user that a message has arrived.  & High \\ \hline
\textbf{FR7} & \textbf{Sending and receiving message with attachments:}The user has to be able to add an attachment to the message, so that the recipient gets the attachment as well as the message. By opening the message, the attachments will also show. & Medium \\ \hline
\textbf{FR8} & \textbf{Answer, delete and forward messages:}The user has to be able to, by clicking on a message, choose if he wants to answer, delete or forward the message, and be brought to the correct screen for doing the selected action. & Medium \\ \hline
\textbf{FR9} & \textbf{Send instant message:}The user has to be able to, via very few screen interactions, send an instant message with a predefined security label and priority, to a predefined list of recipients. & Medium \\ \hline
\textbf{FR10} & \textbf{Settings menu:}The user has to be able to alter the following settings: 
\begin{itemize}
\item{}Change default values of dropdown menus in the New Message window.
\item{}What the lowest security priority is before the message is sent via SMS
\item{}Setting text size in GUI, e.g. on received message text.
\end{itemize}  & Low
\end{tabularx}
\caption{Functional requirements} \label{tab:functionalreq}
\end{table}

I'll get this error message:

! LaTeX Error: Something's wrong--perhaps a missing \item.

I would really appreciate some help!

2
  • I think it works fine: Source, Output.
    – Silke
    Commented Oct 9, 2012 at 11:06
  • Also works fine for me. Please provide a full minimal working example and which engine you use on what OS. Commented Oct 9, 2012 at 11:28

2 Answers 2

5

If you modify the widths of X columns you must ensure that you don't change the total width, so it needs to add up to 3 in this case. Also for display lists to work you need to reset \linewidth as well as \hsize.

enter image description here

\documentclass{article}
\usepackage{tabularx}

\begin{document}

\begin{table}
\small
\noindent
\begin{tabularx}{\linewidth}{>{\setlength\hsize{.2\hsize}}X|>{\setlength\hsize{2.5\hsize}\setlength\linewidth{\hsize}}X|>{\setlength\hsize{.3\hsize}}X}
\textbf{Req.} & \textbf{Description} & \textbf{Priority} \\ \hline \hline
\textbf{FR1} & \textbf{Starting application and logging in:}The user has to be able to start the application and authorize himself against an authorizing mechanism. & High \\ \hline
\textbf{FR2} & \textbf{Send a message to another user:}The user has to be able send a simple message via regular email protocols to a recipient of own choice. & High \\ \hline
\textbf{FR3} & \textbf{Browse received messages:} The user has to be able to browse all messages he has received. & High \\ \hline
\textbf{FR4} & \textbf{Browse sent messages:} The user has to be able to browse all messages he has sent, and see the status of a sent message, where the relevant statuses are “message delivered” and “message read”. & High \\ \hline
\textbf{FR5} & \textbf{Viewing address book:} The user has to be able to view the address book with all contacts, so that he is able to choose a recipient from a list when he wants to send a message. & High \\ \hline
\textbf{FR6} & \textbf{Marking messages with a grade of importance:}The user has to be able to set Security Label, Message Priority and Message Type on a message, so that the receiver of the message knows who the message is intended for, how important it is and in what environment it is is of interest. The Message Priority will decide how intrusive XOXOmail is, that is, how much ihe app takes over the phone in order to show the user that a message has arrived.  & High \\ \hline
\textbf{FR7} & \textbf{Sending and receiving message with attachments:}The user has to be able to add an attachment to the message, so that the recipient gets the attachment as well as the message. By opening the message, the attachments will also show. & Medium \\ \hline
\textbf{FR8} & \textbf{Answer, delete and forward messages:}The user has to be able to, by clicking on a message, choose if he wants to answer, delete or forward the message, and be brought to the correct screen for doing the selected action. & Medium \\ \hline
\textbf{FR9} & \textbf{Send instant message:}The user has to be able to, via very few screen interactions, send an instant message with a predefined security label and priority, to a predefined list of recipients. & Medium \\ \hline
\textbf{FR10} & \textbf{Settings menu:}The user has to be able to alter the following settings: 
\begin{itemize}
\item{}Change default values of dropdown menus in the New Message window.
\item{}What the lowest security priority is before the message is sent via SMS
\item{}Setting text size in GUI, e.g. on received message text.
\end{itemize}  & Low
\end{tabularx}
\caption{Functional requirements} \label{tab:functionalreq}
\end{table}


\end{document}
1
  • But at the font sized use (\small) longtable wouldn't make it look much different (as it fits on a page anyway) and using X columns with longtable requires more extensive changes. Commented Oct 9, 2012 at 12:18
1

It seems, the itemize environment only recognizes the original \hsize calculated by tabularx and ignores the local redefinition in the column description.

It works correctly, if you specify the column width manually (by using p-columns) or if you use only one X-column:

\documentclass[a4paper]{scrartcl}

\usepackage{tabularx}

\begin{document}
\begin{table}
% calculate width of p-column manually:
% \begin{tabular}{p{0.1\linewidth}|p{0.78\linewidth}|p{0.1\linewidth}}
% or use only 1 X-column:
\begin{tabularx}{\linewidth}{c|X|l}
\textbf{Req.} & \textbf{Description} & \textbf{Priority} \\ \hline \hline
\textbf{FR1} & \textbf{Starting application and logging in:}The user has to be able to start the application and authorize himself against an authorizing mechanism. & High \\ \hline
\textbf{FR2} & \textbf{Send a message to another user:}The user has to be able send a simple message via regular email protocols to a recipient of own choice. & High \\ \hline
\textbf{FR3} & \textbf{Browse received messages:} The user has to be able to browse all messages he has received. & High \\ \hline
\textbf{FR4} & \textbf{Browse sent messages:} The user has to be able to browse all messages he has sent, and see the status of a sent message, where the relevant statuses are “message delivered” and “message read”. & High \\ \hline
\textbf{FR5} & \textbf{Viewing address book:} The user has to be able to view the address book with all contacts, so that he is able to choose a recipient from a list when he wants to send a message. & High \\ \hline
\textbf{FR6} & \textbf{Marking messages with a grade of importance:}The user has to be able to set Security Label, Message Priority and Message Type on a message, so that the receiver of the message knows who the message is intended for, how important it is and in what environment it is is of interest. The Message Priority will decide how intrusive XOXOmail is, that is, how much ihe app takes over the phone in order to show the user that a message has arrived.  & High \\ \hline
\textbf{FR7} & \textbf{Sending and receiving message with attachments:}The user has to be able to add an attachment to the message, so that the recipient gets the attachment as well as the message. By opening the message, the attachments will also show. & Medium \\ \hline
\textbf{FR8} & \textbf{Answer, delete and forward messages:}The user has to be able to, by clicking on a message, choose if he wants to answer, delete or forward the message, and be brought to the correct screen for doing the selected action. & Medium \\ \hline
\textbf{FR9} & \textbf{Send instant message:}The user has to be able to, via very few screen interactions, send an instant message with a predefined security label and priority, to a predefined list of recipients. & Medium \\ \hline
\textbf{FR10} & \textbf{Settings menu:}The user has to be able to alter the following settings: 
\begin{itemize}
\item{}Change default values of dropdown menus in the New Message window.
\item{}What the lowest security priority is before the message is sent via SMS
\item{}Setting text size in GUI, e.g. on received message text.
\end{itemize}  & Low
% \end{tabular}
\end{tabularx}
\caption{Functional requirements} \label{tab:functionalreq}
\end{table}
\end{document}

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .