![将横向表格转换为 A4 尺寸论文集的纵向表格](https://linux22.com/image/433314/%E5%B0%86%E6%A8%AA%E5%90%91%E8%A1%A8%E6%A0%BC%E8%BD%AC%E6%8D%A2%E4%B8%BA%20A4%20%E5%B0%BA%E5%AF%B8%E8%AE%BA%E6%96%87%E9%9B%86%E7%9A%84%E7%BA%B5%E5%90%91%E8%A1%A8%E6%A0%BC.png)
我有这样的代码,我制作了景观文档,但我想将这个文档添加到我的论文书中,它不允许我有横向页面,所以我请求有人帮我将这种格式改为纵向。
\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}