<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


<!-- *********************************************************************** -->
<!-- 
 | Support for ACM_PROC_ARTICLE-SP.CLS - VERSION 2.6SP
 |         and ACM SIG-ALTERNATE.CLS - VERSION 1.6
 +-->
<xsl:template match="article[@class='llncs']">
\documentclass{<xsl:value-of select="@class"/>}
\usepackage{epsfig}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{moreverb}
\pagestyle{headings}  % switches on printing of running heads
\begin{document}

<!-- Build the title, subtitle, and various notes. -->
<xsl:text>\title{</xsl:text>
<xsl:apply-templates select="title/node()[name() != 'note']"/>
<xsl:if test="title/note">
	<xsl:text>\titlenote{</xsl:text>
	<xsl:apply-templates select="title/note/node()"/>
	<xsl:text>}</xsl:text>
	</xsl:if>
<xsl:text>}&#xa;</xsl:text>
<xsl:if test="subtitle">
	<xsl:text>\subtitle{</xsl:text>
	<xsl:apply-templates select="subtitle/node()[name() != 'note']"/>
	<xsl:if test="subtitle/note">
		<xsl:text>\titlenote{</xsl:text>
		<xsl:apply-templates select="subtitle/note/node()"/>
		<xsl:text>}</xsl:text>
		</xsl:if>
	<xsl:text>}&#xa;</xsl:text>
	</xsl:if>

<xsl:if test="runningtitle">
	<xsl:text>\titlerunning{</xsl:text>
	<xsl:apply-templates select="runningtitle/node()[name() != 'note']"/>
	<xsl:text>}&#xa;</xsl:text>
	</xsl:if>

<xsl:if test="author">
	<xsl:text>\author{</xsl:text>
	<xsl:for-each select="author">
		<xsl:text>\hbox{</xsl:text>
		<xsl:apply-templates select="name"/>

		<xsl:text> {\scriptsize \texttt </xsl:text>
		<xsl:apply-templates select="email"/>
		<xsl:text>}</xsl:text>

		<xsl:text>}</xsl:text>
		<xsl:if test="position() != last()"> \and </xsl:if>
		</xsl:for-each>
	<xsl:text>}&#xa;</xsl:text>
	</xsl:if>

<xsl:if test="institution">
	<xsl:text>\institute{</xsl:text>
	<xsl:for-each select="institution/addr">
		<xsl:value-of select="."/>
		<xsl:if test="position() != last()"> \\</xsl:if>
		</xsl:for-each>
	<xsl:text>}&#xa;</xsl:text>
	</xsl:if>

\maketitle

<!-- Build the article's Abstract -->
<xsl:if test="abstract">
\begin{abstract}
<xsl:apply-templates select="abstract/node()"/>
\end{abstract}
	</xsl:if>

<xsl:if test="keyword">
	<xsl:text>\keywords{</xsl:text>
	<xsl:for-each select="keyword">
		<xsl:if test="position() != 1">
			<xsl:text>, </xsl:text>
			</xsl:if>
		<xsl:apply-templates/>
		</xsl:for-each>
	<xsl:text>}&#xa;</xsl:text>
	</xsl:if>

<xsl:apply-templates select="section"/>

<xsl:if test="bibliography/*">
\bibliographystyle{abbrv}
<xsl:call-template name="build-bibliography"/>
	</xsl:if>

<xsl:if test="appendix">
\appendix
<xsl:apply-templates select="appendix/section"/>
	</xsl:if>

\end{document}
	</xsl:template>


</xsl:stylesheet>
