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\sphinxstyleindexentry#1{#1} % no monospaced index entries
\def\sphinxstyleindexextra#1{ (#1)} % no italics
\def\sphinxtablecontinued#1{{\sffamily\footnotesize #1}} % add footnotesize
% Allow line breaks in URLs
\usepackage{seqsplit}
@ -82,7 +83,11 @@
% Fix list spacing in tables
\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
\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}|
+------------------------------------------+---------------------------------------------------------------------+
| Action | Example motions |
+==========================================+=====================================================================+
| *omit* (or delete or strike out) words | * That the motion be amended by omitting ‘…’ |
| | * That the words ‘…’ be omitted |
| | * That ‘…’ be omitted from line X |
| | * | That the motion be amended as follows: |
| | | Omit ‘…’ |
+------------------------------------------+---------------------------------------------------------------------+
| *insert* (or add) words\ [#fn21]_ | * That the motion be amended by inserting ‘…’ after ‘…’ |
| | * That the words ‘…’ be inserted after ‘…’ |
| | * That ‘…’ be added at the end of the motion |
| | * | That the motion be amended as follows: |
| | | After ‘…’, insert ‘…’ |
+------------------------------------------+---------------------------------------------------------------------+
| omit words and *substitute* others\ | * That the motion be amended by omitting ‘…’ and substituting ‘…’ |
| [#fn22]_ | * That the motion be amended by omitting all words after ‘That’ and |
| | substituting ‘…’\ [#fn11]_ |
| | * That the words ‘…’ be omitted and ‘…’ inserted in their place |
| | * That ‘…’ be substituted for ‘…’\ [#fn12]_ |
| | * | That the motion be amended as follows: |
| | | Omit ‘…’, substitute ‘…’ |
+------------------------------------------+---------------------------------------------------------------------+
.. table::
:class: longtable
+------------------------------------------+---------------------------------------------------------------------+
| Action | Example motions |
+==========================================+=====================================================================+
| *omit* (or delete or strike out) words | * That the motion be amended by omitting ‘…’ |
| | * That the words ‘…’ be omitted |
| | * That ‘…’ be omitted from line X |
| | * | That the motion be amended as follows: |
| | | Omit ‘…’ |
+------------------------------------------+---------------------------------------------------------------------+
| *insert* (or add) words\ [#fn21]_ | * That the motion be amended by inserting ‘…’ after ‘…’ |
| | * That the words ‘…’ be inserted after ‘…’ |
| | * That ‘…’ be added at the end of the motion |
| | * | That the motion be amended as follows: |
| | | After ‘…’, insert ‘…’ |
+------------------------------------------+---------------------------------------------------------------------+
| omit words and *substitute* others\ | * That the motion be amended by omitting ‘…’ and substituting ‘…’ |
| [#fn22]_ | * That the motion be amended by omitting all words after ‘That’ and |
| | substituting ‘…’\ [#fn11]_ |
| | * 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.