Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LaTeX table too wide, how can I make it fit?

Tags:

latex

\usepackage[utf8]{inputenc}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{proof}
\usepackage[left=0.60in, right=0.60in, top=0.65in, bottom=0.65in, footskip=0.1in]{geometry}


\title{Peergrade 1}
\author{anonymous}
\date{September 2020}
\begin{document}


\maketitle
\section{Exercise 1}

\begin{tiny}
\begin{table}[h]
\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|}
\hline
A & B & C & A -\textgreater B & B -\textgreater $\sim$C & A -\textgreater $\sim$C & C -\textgreater $\sim$A & (A -\textgreater  $\sim$C) /\textbackslash (C -\textgreater $\sim$A) & (B -\textgreater $\sim$C) -\textgreater ((A -\textgreater $\sim$C) /\textbackslash (C -\textgreater $\sim$A)) & Prop 1 \\ \hline
T & T & T & T                 & F                       & F                       & F                       & F                                                                    & T                                                                                                             & T      \\ \hline
T & T & F & T                 & T                       & T                       & T                       & T                                                                    & T                                                                                                             & T      \\ \hline
T & F & T & F                 & F                       & F                       & F                       & F                                                                    & T                                                                                                             & T      \\ \hline
T & F & F & F                 & T                       & T                       & T                       & T                                                                    & T                                                                                                             & T      \\ \hline
F & T & T & T                 & F                       & T                       & T                       & T                                                                    & T                                                                                                             & T      \\ \hline
F & T & F & T                 & T                       & T                       & T                       & T                                                                    & T                                                                                                             & T      \\ \hline
F & F & T & T                 & F                       & T                       & T                       & T                                                                    & T                                                                                                             & T      \\ \hline
F & F & F & T                 & T                       & T                       & T                       & T                                                                    & T                                                                                                             & T      \\ \hline
\end{tabular}
\end{table}
\end{tiny}



\end{document}

Can anyone help me so that the table fits in LaTeX? It almost fits, but half of the last column part goes outiside the paper. I have already tried to add /small and /footnotesize, but it doesnt work.

like image 641
privatename Avatar asked Mar 03 '23 02:03

privatename


2 Answers

Please have a look at http://betterposters.blogspot.de/2012/08/the-data-prison.html how to design nice looking tables


You could use a tabularx and let latex adjust the size:

\documentclass{article}

\usepackage[utf8]{inputenc}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{proof}
\usepackage[left=0.60in, right=0.60in, top=0.65in, bottom=0.65in, footskip=0.1in]{geometry}


\usepackage{tabularx}

\title{Peergrade 1}
\author{anonymous}
\date{September 2020}
\begin{document}


\maketitle
\section{Exercise 1}

\begin{tiny}
\begin{table}[h]
\begin{tabularx}{\linewidth}{|l|l|l|l|l|l|l|l|X|l|}
\hline
A & B & C & A -\textgreater B & B -\textgreater $\sim$C & A -\textgreater $\sim$C & C -\textgreater $\sim$A & (A -\textgreater $\sim$C) /\textbackslash (C -\textgreater $\sim$A) & (B -\textgreater $\sim$C) -\textgreater ((A -\textgreater $\sim$C) /\textbackslash (C -\textgreater $\sim$A)) & Prop 1 \\ \hline
T & T & T & T & F & F & F & F & T & T \\ \hline
T & T & F & T & T & T & T & T & T & T \\ \hline
T & F & T & F & F & F & F & F & T & T \\ \hline
T & F & F & F & T & T & T & T & T & T \\ \hline
F & T & T & T & F & T & T & T & T & T \\ \hline
F & T & F & T & T & T & T & T & T & T \\ \hline
F & F & T & T & F & T & T & T & T & T \\ \hline
F & F & F & T & T & T & T & T & T & T \\ \hline
\end{tabularx}
\end{table}
\end{tiny}

\end{document}
like image 199
samcarter_is_at_topanswers.xyz Avatar answered Mar 08 '23 08:03

samcarter_is_at_topanswers.xyz


Just complementing the answer, if the table is very large, it's possible to rotate the sheet by using pdflscape:

\usepackage{pdflscape}
...

\begin{landscape}
(Your Table)
\end{landscape}
like image 26
André Machado Avatar answered Mar 08 '23 07:03

André Machado