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,29 +347,32 @@ 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::
| Action | Example motions | :class: longtable
+==========================================+=====================================================================+
| *omit* (or delete or strike out) words | * That the motion be amended by omitting ‘…’ | +------------------------------------------+---------------------------------------------------------------------+
| | * That the words ‘…’ be omitted | | Action | Example motions |
| | * That ‘…’ be omitted from line X | +==========================================+=====================================================================+
| | * | That the motion be amended as follows: | | *omit* (or delete or strike out) words | * That the motion be amended by omitting ‘…’ |
| | | Omit ‘…’ | | | * That the words ‘…’ be omitted |
+------------------------------------------+---------------------------------------------------------------------+ | | * That ‘…’ be omitted from line X |
| *insert* (or add) words\ [#fn21]_ | * That the motion be amended by inserting ‘…’ after ‘…’ | | | * | That the motion be amended as follows: |
| | * That the words ‘…’ be inserted after ‘…’ | | | | Omit ‘…’ |
| | * That ‘…’ be added at the end of the motion | +------------------------------------------+---------------------------------------------------------------------+
| | * | That the motion be amended as follows: | | *insert* (or add) words\ [#fn21]_ | * That the motion be amended by inserting ‘…’ after ‘…’ |
| | | After ‘…’, insert ‘…’ | | | * That the words ‘…’ be inserted after ‘…’ |
+------------------------------------------+---------------------------------------------------------------------+ | | * That ‘…’ be added at the end of the motion |
| omit words and *substitute* others\ | * That the motion be amended by omitting ‘…’ and substituting ‘…’ | | | * | That the motion be amended as follows: |
| [#fn22]_ | * That the motion be amended by omitting all words after ‘That’ and | | | | After ‘…’, insert ‘…’ |
| | substituting ‘…’\ [#fn11]_ | +------------------------------------------+---------------------------------------------------------------------+
| | * That the words ‘…’ be omitted and ‘…’ inserted in their place | | omit words and *substitute* others\ | * That the motion be amended by omitting ‘…’ and substituting ‘…’ |
| | * That ‘…’ be substituted for ‘…’\ [#fn12]_ | | [#fn22]_ | * That the motion be amended by omitting all words after ‘That’ and |
| | * | That the motion be amended as follows: | | | substituting ‘…’\ [#fn11]_ |
| | | Omit ‘…’, substitute ‘…’ | | | * That the words ‘…’ be omitted and ‘…’ inserted in their place |
+------------------------------------------+---------------------------------------------------------------------+ | | * That ‘…’ be substituted for ‘…’\ [#fn12]_ |
| | * | That the motion be amended as follows: |
| | | Omit ‘…’, substitute ‘…’ |
+------------------------------------------+---------------------------------------------------------------------+
The example motions shown above are non-exhaustive, and many other valid forms will be seen in practice – including forms for more complex types of amendment. All should be regarded as acceptable, so long as the intended effect is clear. The example motions shown above are non-exhaustive, and many other valid forms will be seen in practice – including forms for more complex types of amendment. All should be regarded as acceptable, so long as the intended effect is clear.