我想创建一个包含长文本的长表。
最小工作示例如下:
\documentclass[12pt, a4paper, twoside]{article}
\usepackage{authblk}
\usepackage{titlesec}
\usepackage[T1]{fontenc}
\usepackage{times}
\usepackage[latin9]{inputenc}
\usepackage[english]{babel}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{mathptmx}
\usepackage{float}
\usepackage{url}
\usepackage[final]{graphicx}
\usepackage{natbib}
\setlength{\bibsep}{0.0pt}
%page margins
\usepackage{geometry}
\geometry{verbose,tmargin=3cm,bmargin=3cm,lmargin=3cm,rmargin=3cm }
\setlength\parindent{24pt}
%produces line numbers
\usepackage{textcomp}
\usepackage{textgreek}
\usepackage[toc,page]{appendix}
\usepackage{libertineRoman}
%line spacing
\usepackage{setspace}
\onehalfspacing
\usepackage{titlesec}
\usepackage{caption}% <-- added
\usepackage{tabulary}
\usepackage[para]{threeparttable}
\usepackage{array,booktabs,longtable,tabularx}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}% <-- added
\usepackage{caption}% <-- added
\setlength{\LTcapwidth}{7in}
\usepackage{ltablex}% <-- added
\usepackage{siunitx}% <-- added
\usepackage[flushleft]{threeparttablex}
\usepackage{pdflscape}
\usepackage{amssymb}
\begin{document}
\section{introduction}
Introduction text is given here.
\begin{landscape}
\begin{longtable}
\caption{Structure}
\label{tab:str}\\
\toprule
& \multicolumn{2}{c}{\textbf{Main 1}} & & \multicolumn{4}{c}{\textbf{Main 2}} & & \multicolumn{1}{c}{\textbf{Main 3}} & & \multicolumn{1}{c}{\textbf{Main 4}} & & \multicolumn{1}{c}{\textbf{Main 5}} & & \multicolumn{2}{c}{\textbf{Main 6}} & & \multicolumn{1}{c}{\textbf{Main 7}} \\
\cmidrule{2-3}\cmidrule{5-8}\cmidrule{10-10}\cmidrule{12-12}\cmidrule{14-14}\cmidrule{16-17}\cmidrule{19-19}
& Text 1a & & Text2a & Text2b & Text2c & Text 2d & & Text 3a & & Text4a & & Text5a & & Text 6a & Text 6b & & Text6b \\
\endfirsthead
\multicolumn{19}{c}%
{{\bfseries \tablename\ \thetable{} -- continued from previous page}}\\
\toprule
& \multicolumn{2}{c}{\textbf{Main 1}} & & \multicolumn{4}{c} {\textbf{Main 2}} & & \multicolumn{1}{c}{\textbf{Main 3}} & & \multicolumn{1}{c}{\textbf{Main 4}} & & \multicolumn{1}{c}{\textbf{Main 5}} & & \multicolumn{2}{c}{\textbf{Main 6}} & & \multicolumn{1}{c}{\textbf{Main 7}} \\
\cmidrule{2-3}\cmidrule{5-8}\cmidrule{10-10}\cmidrule{12-12}\cmidrule{14-14}\cmidrule{16-17}\cmidrule{19-19}
& Text 1a & & Text2a & Text2b & Text2c & Text 2d & & Text 3a & & Text4a & & Text5a & & Text 6a & Text 6b & & Text6b \\
\endhead
\multicolumn{19}{r}{{Continued on next page}} \\
\endfoot
\endlastfoot
%%%%%% Main contents of Table Starts here %%%%%%%%%%%%
\multicolumn{19}{l}{\textbf{Structure }} \\
\midrule
Issuer & Licensed UCI & Licensed UCI & & Specialised Credit Institution & Specialised Credit Institution & Specialised Credit Institution & Specialised Credit Institution & & Licensed UCI & & UCI & & Licensed UCI & & UCI, Specialised Credit Institution & UCI, Specialised Credit Institution & & UCI, Specialised Credit Institution \\
Recourse to credit institution & Yes, direct & Yes, direct & & Yes, direct & Yes, direct & Yes, direct & Yes, direct & & Yes, direct & & Yes, direct & & Yes, direct & & Yes, direct & Yes, direct & & Yes, direct \\
Owner of cover assets & Credit Institution acting as fiduciary & Credit Institution acting as fiduciary & & Credit Institution, pledged to the issuer & Credit Institution, pledged to the issuer & The issuer directly & Credit Institution, pledged to the issuer & & The issuer directly & & SPE which guarantees the CBs & & SPE which guarantees the CBs & & The issuer directly & The issuer directly & & The issuer directly \\
Issuer is originator of assets & Flexible & Flexible & & No & No & Flexible & No & & Yes & & Yes & & Flexible & & Yes & Yes & & Yes \\
\midrule
\multicolumn{19}{l}{\textbf{Framework }} \\
\midrule
Special legilsation & Yes & Yes & & Yes & No & Yes & Yes & & Yes & & Yes & & Yes & & Yes & Yes & & Yes \\
Legal framework for the bankcruptcy of issuer & Special legal framework superseding general insolvency law & Special legal framework superseding general insolvency law & & Special legal framework superseding general insolvency law & General insolvency law & Special legal framework superseding general insolvency law & Special legal framework superseding general insolvency law & & Special legal framework superseding general insolvency law & & Special legal framework superseding general insolvency law & & General insolvency law & & Special legal framework superseding general insolvency law & Special legal framework superseding general insolvency law & & Special legal framework superseding general insolvency law \\
\midrule
\multicolumn{19}{l}{\textbf{Assets }} \\
\midrule
Types of assets & Public Sector loans
Mortgage loans
Loans to credit institutions & Public Sector loans
Mortgage loans
Loans to credit institutions & & Mortgage Loans & Mortgage Loans & Public Sector loans
Mortgage loans
Loans to credit institutions
Senior MBS & Mortgage loans
Senior MBS & & Public Sector loans
Mortgage loans
Loans to credit institutions
Ship loans
Aircraft loans & & Public Sector loans
Mortgage loans
Senior MBS & & Public Sector loans
Mortgage loans
Loans to credit institutions
Ship loans & & Mortgage loans
Senior MBS & Public Sector loans
Senior MBS & & Mortgage Loans \\
Geographical scope of cover assets & Domestic, EEA, CH & Domestic, EEA, CH & & Domestic (France Only) & Domestic & Flexible & Flexible & & Domestic, EEA, CH, USA, Canada, Japan & & EEA, CH & & Domestic and EEA & & EEA & EEA & & EEA \\
Regulator CB specific disclosure requirements to public & Not mandatory & Not mandatory & & Mandatory & Mandatory & Mandatory & Mandatory & & Mandatory & & Not mandatory & & Mandatory & & Not mandatory & Not mandatory & & Mandatory \\
\bottomrule
\end{longtable}%
\end{landscape}
\end{document}
还有一些多列。所需的表格形式如下:
答案1
您所关注的空间是由修剪的参数\cmidrule
,例如\cmidrule(lr){2-3}
。请查阅此处使用的软件包的文档以了解正在发生的事情。代码:
\documentclass{article}
\usepackage{geometry}
\geometry{a4paper,textheight=20cm}
\usepackage{booktabs,ragged2e,ltxtable,pdflscape,filecontents}
\begin{filecontents}{lt.tab}
\begin{longtable}[c]{@{}p{3cm}*{12}{>{\hspace{0pt}\RaggedRight}X}@{}}
\caption{Structure}\label{tab:str}\\
\toprule
& \multicolumn{2}{c}{\textbf{Main 1}}
& \multicolumn{4}{c}{\textbf{Main 2}}
& \multicolumn{1}{c}{\textbf{Main 3}}
& \multicolumn{1}{c}{\textbf{Main 4}}
& \multicolumn{1}{c}{\textbf{Main 5}}
& \multicolumn{2}{c}{\textbf{Main 6}}
& \multicolumn{1}{c}{\textbf{Main 7}} \\
\cmidrule(r){1-1}\cmidrule(lr){2-3}\cmidrule(lr){4-7}\cmidrule(lr){8-8}%
\cmidrule(lr){9-9}\cmidrule(lr){10-10}\cmidrule(lr){11-12}\cmidrule(l){13-13}
%
& Text 1a & Text 1b & Text 2a & Text 2b & Text 2c & Text 2d
& Text 3a & Text 4a & Text 5a & Text 6a & Text 6b & Text 7a \\
%
\midrule
\multicolumn{13}{@{}l}{\textbf{Structure}} \\
\midrule
Issuer & Licensed UCI & Licensed UCI & Specialised Credit Institution
& Specialised Credit Institution & Specialised Credit Institution
& Specialised Credit Institution & Licensed UCI & UCI
& Licensed UCI & UCI, Specialised Credit Institution
& UCI, Specialised Credit Institution & UCI, Specialised Credit Institution
\end{longtable}
\end{filecontents}
\begin{document}
\begin{landscape}
\footnotesize
\LTXtable{20cm}{lt.tab}
\end{landscape}
\end{document}