Skip to content

Commit

Permalink
Fix tables in LaTeX
Browse files Browse the repository at this point in the history
  • Loading branch information
utensil committed Jul 18, 2024
1 parent 4900bc1 commit 23f5cbf
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 10 deletions.
23 changes: 23 additions & 0 deletions assets/latex.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,27 @@
<xsl:text>\listoftodos</xsl:text>
</xsl:template>

<xsl:template match="html:table">
<xsl:text>\begin{tabular}{</xsl:text>
<xsl:for-each select="html:thead/html:tr/html:th">
<xsl:text> c </xsl:text>
</xsl:for-each>
<xsl:text>}</xsl:text>
<xsl:text>\toprule&#xa;</xsl:text>
<xsl:for-each select="html:thead/html:tr/html:th">
<xsl:if test="position() > 1"><xsl:text> &amp; </xsl:text></xsl:if>
<xsl:apply-templates />
</xsl:for-each>
<xsl:text> \\ \midrule&#xa;</xsl:text>
<xsl:for-each select="html:tbody/html:tr">
<xsl:for-each select="html:td">
<xsl:if test="position() > 1"><xsl:text> &amp; </xsl:text></xsl:if>
<xsl:apply-templates />
</xsl:for-each>
<xsl:text> \\&#xa;</xsl:text>
</xsl:for-each>
<xsl:text>\bottomrule&#xa;</xsl:text>
<xsl:text>\end{tabular}</xsl:text>
</xsl:template>

</xsl:stylesheet>
4 changes: 3 additions & 1 deletion tex/preamble.tex
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,16 @@
\input{../tex/mdframed}
% \input{../tex/tcolorbox}

%% Special markups
%% Content markups

% https://www.overleaf.com/learn/latex/Typesetting_quotations
\usepackage{csquotes}

% NOTE: Won't work in web version for roman numerals, but it works well for PDF version
\usepackage{enumerate}% http://ctan.org/pkg/enumerate

\usepackage{booktabs}

\usepackage{todonotes}
\todostyle{uts}{color=LightGoldenrodYellow,shadow,inline}
% \usepackage[textsize=scriptsize,shadow]{todonotes}
Expand Down
12 changes: 12 additions & 0 deletions trees/macros.tree
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@
\<html:table>{\body}
}

\p{\code{thead[body]}: A table header.}

\def\thead[body]{
\<html:thead>{\body}
}

\p{\code{tbody[body]}: A table body.}

\def\tbody[body]{
\<html:tbody>{\body}
}

\p{\code{tr[body]}: A table row.}

\def\tr[body]{
Expand Down
22 changes: 13 additions & 9 deletions trees/tt-004Y.tree
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,20 @@

\taxon{notation}\note{directions in (co)limits}{
\table{
\tr{
\th{Concept}
\th{Limit}
\th{Colimit}
\thead{
\tr{
\th{Concept}
\th{Limit}
\th{Colimit}
}
}
\tbody{
\row{arrows}{into the diagram}{out of the diagram}
\row{on [(co)shape P](tt-000W)}{[pullback](tt-000V)}{[pushout](tt-000X)}
\row{categories have all ...}{[left exact](tt-002F)}{[right exact](tt-003C)}
\row{functors preserve all ...}{[left exact](tt-002H)}{[right exact](tt-002H)}
\row{on directed [poset](tt-002C)}{[inverse/projective limit](tt-002D) #{\lim\limits_{\longleftarrow} \fF}}{[direct/inductive limit(tt-002G) #{\lim\limits_{\longrightarrow} \fF}}
}
\row{arrows}{into the diagram}{out of the diagram}
\row{on [(co)shape P](tt-000W)}{[pullback](tt-000V)}{[pushout](tt-000X)}
\row{categories have all ...}{[left exact](tt-002F)}{[right exact](tt-003C)}
\row{functors preserve all ...}{[left exact](tt-002H)}{[right exact](tt-002H)}
\row{on directed [poset](tt-002C)}{[inverse/projective limit](tt-002D) #{\lim\limits_{\longleftarrow} \fF}}{[direct/inductive limit](tt-002G) #{\lim\limits_{\longrightarrow} \fF}}
}

\p{One can see from the table that, in general, limits have the direction "back" "into" (where "back", "inverse", "left" are consistent), and colimits have the opposite: "forward" "out of".
Expand Down

0 comments on commit 23f5cbf

Please sign in to comment.