Use longtable for long tables

This commit is contained in:
RunasSudo 2021-02-20 22:31:52 +11:00
parent 7a4a7acda8
commit 6b7c2330c9
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
3 changed files with 66 additions and 24 deletions

View File

@ -0,0 +1,34 @@
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}
<%- if table.align in ('center', 'default') -%>
[c]
<%- elif table.align == 'left' -%>
[l]
<%- elif table.align == 'right' -%>
[r]
<%- endif -%>
<%= table.get_colspec() %>
<%- if table.caption -%>
\sphinxthelongtablecaptionisattop
\caption{<%= ''.join(table.caption) %>\strut}<%= labels %>\\*[\sphinxlongtablecapskipadjust]
\hline
<% elif labels -%>
\hline\noalign{\phantomsection<%= labels %>}%
<% else -%>
\hline
<% endif -%>
<%= ''.join(table.header) %>
\endfirsthead
\multicolumn{<%= table.colcount %>}{c}%
{\makebox[0pt]{\sphinxtablecontinued{<%= _('continued from previous page') %>}}}\\
\hline
<%= ''.join(table.header) %>
\endhead
\hline
\multicolumn{<%= table.colcount %>}{r}{\makebox[0pt][r]{\sphinxtablecontinued{<%= _('continues on next page') %>}}}\\
\endfoot
\endlastfoot
<%= ''.join(table.body) %>
\end{longtable}\sphinxatlongtableend\end{savenotes}

View File

@ -10,6 +10,7 @@
\def\sphinxcrossref#1{#1} % no italicised references \def\sphinxcrossref#1{#1} % no italicised references
\def\sphinxstyleindexentry#1{#1} % no monospaced index entries \def\sphinxstyleindexentry#1{#1} % no monospaced index entries
\def\sphinxstyleindexextra#1{ (#1)} % no italics \def\sphinxstyleindexextra#1{ (#1)} % no italics
\def\sphinxtablecontinued#1{{\sffamily\footnotesize #1}} % add footnotesize
% Allow line breaks in URLs % Allow line breaks in URLs
\usepackage{seqsplit} \usepackage{seqsplit}
@ -82,7 +83,11 @@
% Fix list spacing in tables % Fix list spacing in tables
\usepackage{enumitem} \usepackage{enumitem}
\def\sphinxattablestart{\par\vskip\dimexpr\sphinxtablepre\relax\setlist[itemize]{leftmargin=2.5ex,before=\vspace*{-1.3em},after=\vspace*{-1.3em}}} \def\table@fixitemize{\setlist[itemize]{leftmargin=2.5ex,before=\vspace*{-1.7em},after=\vspace*{-1.3em}}}
\let\orig@sphinxattablestart\sphinxattablestart
\def\sphinxattablestart{\orig@sphinxattablestart\table@fixitemize}
\let\orig@sphinxatlongtablestart\sphinxatlongtablestart
\def\sphinxatlongtablestart{\orig@sphinxatlongtablestart\table@fixitemize}
% Override Sphinx title page % Override Sphinx title page
\usepackage[iso]{isodate} \usepackage[iso]{isodate}

View File

@ -347,6 +347,9 @@ Customarily, a motion may be amended to:\ [#fn19]_
.. tabularcolumns:: |>{\raggedright}m{0.3\dimexpr\linewidth-4\tabcolsep-3\arrayrulewidth\relax}|p{0.7\dimexpr\linewidth-4\tabcolsep-3\arrayrulewidth\relax}| .. tabularcolumns:: |>{\raggedright}m{0.3\dimexpr\linewidth-4\tabcolsep-3\arrayrulewidth\relax}|p{0.7\dimexpr\linewidth-4\tabcolsep-3\arrayrulewidth\relax}|
.. table::
:class: longtable
+------------------------------------------+---------------------------------------------------------------------+ +------------------------------------------+---------------------------------------------------------------------+
| Action | Example motions | | Action | Example motions |
+==========================================+=====================================================================+ +==========================================+=====================================================================+