Skip to content

Commit

Permalink
add subfigure support for multiple images in a single paragraph
Browse files Browse the repository at this point in the history
  • Loading branch information
Fletcher T. Penney committed Feb 9, 2010
1 parent 83c3202 commit 7b23725
Showing 1 changed file with 43 additions and 6 deletions.
49 changes: 43 additions & 6 deletions XSLT/beamer.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@
</xsl:template>

<xsl:template name="latex-footer">
<xsl:text>\begin{frame}[allowframebreaks]
\frametitle{Bibliography}
% <xsl:text>\begin{frame}[allowframebreaks]
%\frametitle{Bibliography}

% Bibliography
\bibliographystyle{\mybibliostyle}
\bibliocommand
\end{frame}
%\bibliographystyle{\mybibliostyle}
%\bibliocommand
%\end{frame}

\end{document}
</xsl:text>
</xsl:template>

<xsl:template name="latex-document-class">
<xsl:text>\documentclass[ignorenonframetext,12pt]{beamer}
<xsl:text>\documentclass[ignorenonframetext,11pt]{beamer}
%\documentclass[onesided]{article}
%\usepackage{graphicx}
%\usepackage{beamerarticle}
Expand All @@ -76,6 +76,7 @@
\usepackage{tabulary} % Support longer table cells
\usepackage{booktabs} % Support better tables

\usepackage{subfigure}

\let\oldSubtitle\subtitle

Expand Down Expand Up @@ -355,6 +356,42 @@
</xsl:text>
</xsl:template>

<xsl:template match="html:img" mode="images">
<xsl:if test="@id">
<xsl:text>\label{</xsl:text>
<xsl:value-of select="@id"/>
<xsl:text>}
</xsl:text>
</xsl:if>
<xsl:text>\subfigure</xsl:text>
<xsl:if test="@title">
<xsl:if test="not(@title = '')">
<xsl:text>[</xsl:text>
<xsl:apply-templates select="@title"/>
<xsl:text>]</xsl:text>
</xsl:if>
</xsl:if>
<xsl:text>{\includegraphics[keepaspectratio,width=\textwidth, height=.75\textheight]{</xsl:text>
<xsl:value-of select="@src"/>
<xsl:text>}}\quad
</xsl:text>
</xsl:template>

<!-- paragraph with multiple images -->
<xsl:template match="html:p[count(child::html:img) > '1']">
<xsl:text>\begin{figure}
\begin{center}
</xsl:text>

<xsl:apply-templates select="node()" mode="images"/>
<xsl:text>\end{center}
\end{figure}
</xsl:text>
<xsl:value-of select="$newline"/>
<xsl:value-of select="$newline"/>
<xsl:value-of select="$newline"/>
</xsl:template>

<xsl:template match="html:div[@class='bibliography']">
<!-- close the preceding frame first - we want to be our own slide(s) -->
<xsl:text>\end{frame}
Expand Down

0 comments on commit 7b23725

Please sign in to comment.