0

I am writing my thesis. I need a small help. I have a comparison table inserted in my book but the way it looks on pdf is too big and hard to read. Could you suggest a different way of adding this tabular?. As you can see in the attached image that it takes too much space in between one single page. I expect something like I showed in the table green but in black and white.

For the code below, the resulting pdf is shown in second image. To run this code, please open overleaf and create main.tex and background and related work.tex file and then run main.tex to replicate the content.

main.tex

\documentclass[a4paper,oneside,12pt]{book}
\usepackage{booktabs,xltabular,ragged2e,glossaries}
\newcolumntype{P}[1]{>{\RaggedRight}p{#1}}
\newcolumntype{L}{>{\RaggedRight}X}

\begin{document}

\pagenumbering{roman} \setcounter{page}{1} % to start with roman page numbering

\cleardoublepage

\tableofcontents

% Print list of abbreviations, list of tables and list of figures \printnoidxglossary[nopostdot,nonumberlist,title=List of Abbreviations] \listoftables \listoffigures % Includes the pdf of the paper. It will give an error if the pdf is not available.

\clearpage \pagenumbering{arabic} \setcounter{page}{1} \clearpage \setlength{\textheight}{9in}

%start of main document \input{background and related work}

\clearpage

\nocite{*} \bibliographystyle{unsrt} \addcontentsline{toc}{chapter}{Bibliography} \bibliography{chapters/bibliography}

\end{document}

background and related work.tex

\begin{xltabular}{\linewidth}{ @{}
  P{.15\textwidth}
  P{.15\textwidth}
  L
  P{.15\textwidth}
  P{.15\textwidth}
  @{} }

\caption{Related works on computer vision (Comparison table)} \label{my-label}\ \toprule Topic & Goal & Idea & Technique & Use case\ \midrule \endfirsthead

\multicolumn{5}{@{}l}{Table \thetable, cont'd}\[1ex] \toprule Topic & Goal & Technique & Idea & Use case\ \midrule \endhead

\bottomrule \endlastfoot

Computer vision tasks & Localization & To perform localization is to define a bounding box enclosing the object in the image &To find the location of the objects in a set of images & Useful for creating dataset when combined with classifier where we need to crop images \

Computer vision tasks & Object detection (Fast R-CNN, R-CNN, Faster R-CNN, Mask R-CNN, SSD, YOLO, Data Augmentation, Haar cascade, objects as points) & To define objects within images involving outputting of bounding boxes and labels for individual objects. Purpose is to find the object and classify a N number of objects in an image & To identify and locate objects in an image or video & Powerful in classifying several objects within a digital image at once. \

\end{xltabular}%

My code pdf Expectations

Paul Gessler
  • 29,607
KSp
  • 129
  • 1
    What are the P and L column types? Also, please post a code that can be complied as is. – Bernard Aug 25 '21 at 14:53
  • 1
    Could you not put the table on its own page or pages in a landscape orientation? With that much text it would be difficult to do so portrait (to my limited knowledge). Also, please edit your code to include \documentclass, \begin and \end{document} and relevant packages so that people can copy the code and compile it without having to do too much work. –  Aug 25 '21 at 14:53
  • Its a thesis book in portrait format, if i put this table alone in landscape i dont know if it would make more sense?. – KSp Aug 25 '21 at 14:55
  • @bernard please check now. you will be able to replicate. – KSp Aug 25 '21 at 15:04
  • 1
    see the answers to this question yesterday, showing non-table layouts: your content is different but the same issues apply, squeezing things into a 4-column table is going to look squeezed whatever you do https://tex.stackexchange.com/questions/611919/how-to-fit-long-equations-in-table – David Carlisle Aug 25 '21 at 15:33
  • @KSp you could use the "rotating" or "landscape" packages to rotate the page (or pages) and then revert back to portrait for the rest of your thesis, the header and footer would still show properly in the printed out thesis as those packages rotate the header and footer, or follow David's advice. –  Aug 25 '21 at 15:41

1 Answers1

1

enter image description here

  • your question is actually duplication to question my-table-doesnt-fit-what-are-my-options
  • please always provide MWE (Minimal Working Example), a small but complete document, which reproduce your problem as it is (help us to help you)
  • your table is quite big, so you should consider to rotate it to landscape orientation and use smaller font size
  • with use pdflscape (for use landscape environment) and tabularray package for longtblr table, a possible MWE is:
\documentclass[a4paper,oneside,12pt]{book}
\usepackage{tabularray}
\usepackage{pdflscape}

\begin{document}

\begin{landscape} %\mbox{}\vfil \begin{longtblr}[ caption = {Related works on computer vision}, label = {tab:my-label}, ]{hline{1,Z} = {1pt}, hline{2}={0.6pt}, colspec={X[1,l] X[2,l] X[3,l] X[2,l] X[2,l]}, colsep=3pt, rowsep=3pt, rowhead=1, rows={font=\small}, row{1} = {font=\small\bfseries}, } % column headers Topic & Goal & Idea & Technique
& Use case \ % table body Computer vision tasks & Localization & To perform localization is to define a bounding box enclosing the object in the image & To find the location of the objects in a set of images & Useful for creating dataset when combined with classifier where we need to crop images \ Computer vision tasks & Object detection (Fast R-CNN, R-CNN, Faster R-CNN, Mask R-CNN, SSD, YOLO, Data Augmentation, Haar cascade, objects as points) & To define objects within images involving outputting of bounding boxes and labels for individual objects. Purpose is to find the object and classify a N number of objects in an image & To identify and locate objects in an image or video & Powerful in classifying several objects within a digital image at once. \ \end{longtblr} \end{landscape}

\end{document}

Zarko
  • 296,517