Skip to content

Instantly share code, notes, and snippets.

@daverosoff
Last active August 22, 2016 05:27
Show Gist options
  • Save daverosoff/74527e309234038de0622ff028137593 to your computer and use it in GitHub Desktop.
Save daverosoff/74527e309234038de0622ff028137593 to your computer and use it in GitHub Desktop.
LaTeX XSLT stylesheet for Survey of Algebra and Probability
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="../xsl/mathbook-latex.xsl" />
<xsl:output method="text" />
<xsl:param name="latex.preamble.late">
\setcounter{chapter}{-1}
\newcounter{mysection}
\let\oldchapter\chapter
\renewcommand{\chapter}{%
\ifnum\thechapter&lt;0%
\setcounter{mysection}{-1}%
\else%
\setcounter{mysection}{0}%
\fi\oldchapter}
\let\oldsection\section
\renewcommand{\section}{%
\stepcounter{mysection}
\oldsection}
\renewcommand\thesection{\ifcase\thechapter\relax\thechapter.\arabic{mysection}\else\thechapter.\Alph{section}\fi}
</xsl:param>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment