diff --git a/templates/longtable.tex.jinja b/templates/longtable.tex.jinja new file mode 100644 index 0000000..219ef6b --- /dev/null +++ b/templates/longtable.tex.jinja @@ -0,0 +1,84 @@ +\begin{savenotes} +\sphinxatlongtablestart +\sphinxthistablewithglobalstyle +<% if 'booktabs' in table.styles -%> +\sphinxthistablewithbooktabsstyle +<% endif -%> +<% if 'borderless' in table.styles -%> +\sphinxthistablewithborderlessstyle +<% endif -%> +<% if 'standard' in table.styles -%> +\sphinxthistablewithstandardstyle +<% endif -%> +<% if 'vlines' in table.styles -%> +\sphinxthistablewithvlinesstyle +<% endif -%> +<% if 'novlines' in table.styles -%> +\sphinxthistablewithnovlinesstyle +<% endif -%> +<% if 'colorrows' in table.styles -%> +\sphinxthistablewithcolorrowsstyle +<% endif -%> +<% if 'nocolorrows' in table.styles -%> +\sphinxthistablewithnocolorrowsstyle +<% endif -%> +\makeatletter +<%- if table.align == 'default' %> + \LTleft 0cm + \LTright 0cm +<%- elif table.align == 'center' %> + \LTleft \@totalleftmargin plus1fill + \LTright\dimexpr\columnwidth-\@totalleftmargin-\linewidth\relax plus1fill +<%- elif table.align == 'left' %> + \LTleft \@totalleftmargin + \LTright\dimexpr\columnwidth-\@totalleftmargin-\linewidth\relax plus1fill +<%- elif table.align == 'right' %> + \LTleft \@totalleftmargin plus1fill + \LTright\dimexpr\columnwidth-\@totalleftmargin-\linewidth\relax +<%- endif %> +\makeatother +<% set total_width = table.colwidths|sum %> +<% set colspec_parts = [] %> +<% for width in table.colwidths %> + <% set part = 'p{{{:.4f}\\textwidth}}'.format((width * 0.92) / total_width) %> + <% set colspec_parts = colspec_parts.append(part) %> +<% endfor %> +<% set colspec_string = ''.join(colspec_parts) %> +\begin{longtable}{<%= colspec_string %>} +<%- if table.caption -%> +\sphinxthelongtablecaptionisattop +\caption{<%= ''.join(table.caption) %>\strut}<%= labels %>\\*[\sphinxlongtablecapskipadjust] +<% elif labels -%> +\noalign{\phantomsection<%= labels %>}% +<% endif -%> +\sphinxtoprule +<%= ''.join(table.header) -%> +<%- if table.header -%> +\sphinxmidrule +<% endif -%> +\endfirsthead + +\multicolumn{<%= table.colcount %>}{c}{\sphinxnorowcolor + \makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} <%= _('continued from previous page') %>}}% +}\\ +\sphinxtoprule +<%= ''.join(table.header) -%> +<%- if table.header -%> +\sphinxmidrule +<% endif -%> +\endhead + +\sphinxbottomrule +\multicolumn{<%= table.colcount %>}{r}{\sphinxnorowcolor + \makebox[0pt][r]{\sphinxtablecontinued{<%= _('continues on next page') %>}}% +}\\ +\endfoot + +\endlastfoot +\sphinxtableatstartofbodyhook +<%= ''.join(table.body) -%> +\sphinxbottomrule +\end{longtable} +\sphinxtableafterendhook +\sphinxatlongtableend +\end{savenotes} \ No newline at end of file diff --git a/templates/tabular.tex.jinja b/templates/tabular.tex.jinja new file mode 100644 index 0000000..e41a921 --- /dev/null +++ b/templates/tabular.tex.jinja @@ -0,0 +1,85 @@ +\begin{savenotes} +\sphinxatlongtablestart +\sphinxthistablewithglobalstyle +<% if 'booktabs' in table.styles -%> +\sphinxthistablewithbooktabsstyle +<% endif -%> +<% if 'borderless' in table.styles -%> +\sphinxthistablewithborderlessstyle +<% endif -%> +<% if 'standard' in table.styles -%> +\sphinxthistablewithstandardstyle +<% endif -%> +<% if 'vlines' in table.styles -%> +\sphinxthistablewithvlinesstyle +<% endif -%> +<% if 'novlines' in table.styles -%> +\sphinxthistablewithnovlinesstyle +<% endif -%> +<% if 'colorrows' in table.styles -%> +\sphinxthistablewithcolorrowsstyle +<% endif -%> +<% if 'nocolorrows' in table.styles -%> +\sphinxthistablewithnocolorrowsstyle +<% endif -%> +\makeatletter +<%- if table.align == 'default' %> + \LTleft 0cm + \LTright 0cm +<%- elif table.align == 'center' %> + \LTleft \@totalleftmargin plus1fill + \LTright\dimexpr\columnwidth-\@totalleftmargin-\linewidth\relax plus1fill +<%- elif table.align == 'left' %> + \LTleft \@totalleftmargin + \LTright\dimexpr\columnwidth-\@totalleftmargin-\linewidth\relax plus1fill +<%- elif table.align == 'right' %> + \LTleft \@totalleftmargin plus1fill + \LTright\dimexpr\columnwidth-\@totalleftmargin-\linewidth\relax +<%- endif %> +\makeatother +<% set total_width = table.colwidths|sum %> +<% set colspec_parts = [] %> +<% for width in table.colwidths %> + <% set part = 'p{{{:.4f}\\textwidth}}'.format((width * 0.92) / total_width) %> + <% set colspec_parts = colspec_parts.append(part) %> +<% endfor %> +<% set colspec_string = ''.join(colspec_parts) %> +\begin{longtable}{<%= colspec_string %>} +<%- if table.caption -%> +\sphinxthelongtablecaptionisattop +\caption{<%= ''.join(table.caption) %>\strut}<%= labels %>\\*[\sphinxlongtablecapskipadjust] +<% elif labels -%> +\noalign{\phantomsection<%= labels %>}% +<% endif -%> +\sphinxtoprule +<%= ''.join(table.header) -%> +<%- if table.header -%> +\sphinxmidrule +<% endif -%> +\endfirsthead + +\multicolumn{<%= table.colcount %>}{c}{\sphinxnorowcolor + \makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} <%= _('continued from previous page') %>}}% +}\\ +\sphinxtoprule +<%= ''.join(table.header) -%> +<%- if table.header -%> +\sphinxmidrule +<% endif -%> +\endhead + +\sphinxbottomrule +\multicolumn{<%= table.colcount %>}{r}{\sphinxnorowcolor + \makebox[0pt][r]{\sphinxtablecontinued{<%= _('continues on next page') %>}}% +}\\ +\endfoot + +\endlastfoot +\sphinxtableatstartofbodyhook +\raggedright +<%= ''.join(table.body) -%> +\sphinxbottomrule +\end{longtable} +\sphinxtableafterendhook +\sphinxatlongtableend +\end{savenotes} \ No newline at end of file diff --git a/templates/tabulary.tex.jinja b/templates/tabulary.tex.jinja new file mode 100644 index 0000000..219ef6b --- /dev/null +++ b/templates/tabulary.tex.jinja @@ -0,0 +1,84 @@ +\begin{savenotes} +\sphinxatlongtablestart +\sphinxthistablewithglobalstyle +<% if 'booktabs' in table.styles -%> +\sphinxthistablewithbooktabsstyle +<% endif -%> +<% if 'borderless' in table.styles -%> +\sphinxthistablewithborderlessstyle +<% endif -%> +<% if 'standard' in table.styles -%> +\sphinxthistablewithstandardstyle +<% endif -%> +<% if 'vlines' in table.styles -%> +\sphinxthistablewithvlinesstyle +<% endif -%> +<% if 'novlines' in table.styles -%> +\sphinxthistablewithnovlinesstyle +<% endif -%> +<% if 'colorrows' in table.styles -%> +\sphinxthistablewithcolorrowsstyle +<% endif -%> +<% if 'nocolorrows' in table.styles -%> +\sphinxthistablewithnocolorrowsstyle +<% endif -%> +\makeatletter +<%- if table.align == 'default' %> + \LTleft 0cm + \LTright 0cm +<%- elif table.align == 'center' %> + \LTleft \@totalleftmargin plus1fill + \LTright\dimexpr\columnwidth-\@totalleftmargin-\linewidth\relax plus1fill +<%- elif table.align == 'left' %> + \LTleft \@totalleftmargin + \LTright\dimexpr\columnwidth-\@totalleftmargin-\linewidth\relax plus1fill +<%- elif table.align == 'right' %> + \LTleft \@totalleftmargin plus1fill + \LTright\dimexpr\columnwidth-\@totalleftmargin-\linewidth\relax +<%- endif %> +\makeatother +<% set total_width = table.colwidths|sum %> +<% set colspec_parts = [] %> +<% for width in table.colwidths %> + <% set part = 'p{{{:.4f}\\textwidth}}'.format((width * 0.92) / total_width) %> + <% set colspec_parts = colspec_parts.append(part) %> +<% endfor %> +<% set colspec_string = ''.join(colspec_parts) %> +\begin{longtable}{<%= colspec_string %>} +<%- if table.caption -%> +\sphinxthelongtablecaptionisattop +\caption{<%= ''.join(table.caption) %>\strut}<%= labels %>\\*[\sphinxlongtablecapskipadjust] +<% elif labels -%> +\noalign{\phantomsection<%= labels %>}% +<% endif -%> +\sphinxtoprule +<%= ''.join(table.header) -%> +<%- if table.header -%> +\sphinxmidrule +<% endif -%> +\endfirsthead + +\multicolumn{<%= table.colcount %>}{c}{\sphinxnorowcolor + \makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} <%= _('continued from previous page') %>}}% +}\\ +\sphinxtoprule +<%= ''.join(table.header) -%> +<%- if table.header -%> +\sphinxmidrule +<% endif -%> +\endhead + +\sphinxbottomrule +\multicolumn{<%= table.colcount %>}{r}{\sphinxnorowcolor + \makebox[0pt][r]{\sphinxtablecontinued{<%= _('continues on next page') %>}}% +}\\ +\endfoot + +\endlastfoot +\sphinxtableatstartofbodyhook +<%= ''.join(table.body) -%> +\sphinxbottomrule +\end{longtable} +\sphinxtableafterendhook +\sphinxatlongtableend +\end{savenotes} \ No newline at end of file