将横向表格转换为 A4 尺寸论文集的纵向表格

将横向表格转换为 A4 尺寸论文集的纵向表格

我有这样的代码,我制作了景观文档,但我想将这个文档添加到我的论文书中,它不允许我有横向页面,所以我请求有人帮我将这种格式改为纵向。

\documentclass{article}

\usepackage{booktabs}
\usepackage{xltabular}
\usepackage{pdflscape}
\begin{document}

\begin{landscape}
\begin{xltabular}{\linewidth}{>{\raggedright\arraybackslash}p{.2\textwidth}
                              p{.35\textwidth}
                              X
                              >{\raggedright\arraybackslash}p{.15\textwidth}
                              >{\raggedright\arraybackslash}p{.175\textwidth}}
\caption{Related works on computer vision (Comparison table)}
\label{my-label}\\
\toprule 
Topic & Goal & Idea & Technique  & Use case\\
\midrule 
\endfirsthead
\toprule 
Topic & Goal & Technique & Idea  & Use case\\
\midrule 
\endhead
\bottomrule
\endlastfoot
Computer vision tasks & Image classification (CNN, AlexNet)  & Given an input that contains K images, each labelled with M distinct classes. We use the training set to train a classifier to learn what every one of the classes are like. Finally evaluate the quality of classifier by predicting labels for new set of images &  Classifying images into distinct category & With better classifier it could predict more images\\
\midrule


% Next comes YOLO versions and definitions and different classification techniques within the cv such as CNN, fast etc. 
\end{xltabular}%



\end{landscape}
\end{document}

具有相当宽列的表格的屏幕截图

答案1

像这样?除了删除\begin{landscape}\end{landscape}指令之外,我还对相对列宽进行了相当大的更改。

在此处输入图片描述

\documentclass{article}

\usepackage{booktabs,xltabular,ragged2e}
\newcolumntype{P}[1]{>{\RaggedRight}p{#1}}
\newcolumntype{L}{>{\RaggedRight}X}

\begin{document}

\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 & 
Image classification (CNN, AlexNet)  & 
Given an input that contains $K$ images, each labelled with $M$ distinct classes. We use the training set to train a classifier to learn what every one of the classes are like. Finally evaluate the quality of classifier by predicting labels for new set of images &  
Classifying images into distinct category & 
With better classifier it could predict more images \\

\end{xltabular}

\end{document}

相关内容