3

I have a table containing a few lines that don't extend all the way to the end. These lines being end up being stretched beyond presentability. I've tried several methods looked up here and none seem to work. The only thing that does is putting it in Math mode, which is not what I want for the table I am working with.

The line

not(dep(adjective, dep)), (dep(adjective, nmod)  

ends up looking like

not(dep(adjective,     dep)),     (dep(adjective,     nmod)  

in order to fit the space in the Table

My MWE

\documentclass[11pt]{article}

\begin{document}

\begin{table*}[t]
\small
\caption{\small \label{table-4} \textit{Table}}
\begin{tabular}{|p{13.5cm}|}
\hline

not(dep(adjective, dep)), (dep(adjective, nmod) 
not(pos(parent(adjective), RB)), not(dep(children(adjective), nsubj)))   facet(States);

\\
\hline
\end{tabular}
\end{table*}
\end{document}

enter image description here

2
3

Your table has two issues. The first, already mentioned in your posting, is that it would be better if the material were typeset ragged-right rather than fully justified. The second issue is that the tabular environment is quite a bit wider than the text block.

To remedy both problems, I suggest you use a tabularx environment, with width set to \textwidth, and that you use a modified form of the X column type that typesets its material ragged-right (aka flushleft) while still allowing hyphenation. See the code below for an implementation of these suggestions.

Separately, instead of engaging in visual formatting by typing \caption{\small \label{table-4} \textit{Table}}, consider loading the caption package and using suitable arguments for a \captionsetup instruction. Again, see the code below for a specific implementation of this recommendation.

enter image description here

\documentclass[11pt]{article}
\usepackage{tabularx,ragged2e,caption}
\newcolumntype{Y}{>{\RaggedRight\arraybackslash}X}
\begin{document}

\begin{table}
\captionsetup{size=small,textfont=it,skip=0.333\baselineskip}
\small
\caption{Table}
\begin{tabularx}{\textwidth}{|Y|}
\hline
not(dep(adjective, dep)), (dep(adjective, nmod) 
not(pos(parent(adjective), RB)), not(dep(children(adjective), nsubj))) facet(States);
\\
\hline
\end{tabularx}
\end{table}
\end{document}
1
3

Following the questions I mentioned in my comment, you can use this for example (array package and \raggedright command):

\documentclass[11pt]{article}

\usepackage{array}

\begin{document}

\begin{table*}[t]
\small
\caption{\small \label{table-4} \textit{Table}}
\begin{tabular}{|>{\raggedright\arraybackslash}p{135mm}|}
\hline
not(dep(adjective, dep)), (dep(adjective, nmod) 
not(pos(parent(adjective), RB)), not(dep(children(adjective), nsubj)))   facet(States);\\
\hline
\end{tabular}
\end{table*}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.