summaryrefslogtreecommitdiff
path: root/manuscrit.xsl
diff options
context:
space:
mode:
Diffstat (limited to 'manuscrit.xsl')
-rw-r--r--manuscrit.xsl129
1 files changed, 129 insertions, 0 deletions
diff --git a/manuscrit.xsl b/manuscrit.xsl
new file mode 100644
index 0000000..15d10fa
--- /dev/null
+++ b/manuscrit.xsl
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:html="http://www.w3.org/1999/xhtml"
+ xmlns:m="http://planete-kraus.eu/ns/manuscrit">
+
+ <xsl:import href="http://h4sp.planete-kraus.eu/transform/latex.xsl" />
+
+ <xsl:output method="text" indent="no"/>
+ <xsl:strip-space elements="*" />
+
+ <xsl:template match="/">
+ <xsl:variable name="auteur">
+ <xsl:variable name="espacé">
+ <xsl:apply-templates select="/html:html/html:head/m:author" />
+ </xsl:variable>
+ <xsl:value-of select="normalize-space($espacé)" />
+ </xsl:variable>
+ <xsl:variable name="titre">
+ <xsl:variable name="espacé">
+ <xsl:apply-templates select="/html:html/html:head/html:title" />
+ </xsl:variable>
+ <xsl:value-of select="normalize-space($espacé)" />
+ </xsl:variable>
+ <xsl:text>\documentclass[11pt,a4paper,twoside,openright]{book}&#xA;</xsl:text>
+ <xsl:text>\usepackage[utf8]{inputenc}&#xA;</xsl:text>
+ <xsl:text>\usepackage[T1]{fontenc}&#xA;</xsl:text>
+ <xsl:text>\usepackage[french]{babel}&#xA;</xsl:text>
+ <xsl:text>\usepackage{graphicx}&#xA;</xsl:text>
+ <xsl:text>\usepackage{grffile}&#xA;</xsl:text>
+ <xsl:text>\usepackage{longtable}&#xA;</xsl:text>
+ <xsl:text>\usepackage{wrapfig}&#xA;</xsl:text>
+ <xsl:text>\usepackage{rotating}&#xA;</xsl:text>
+ <xsl:text>\usepackage[normalem]{ulem}&#xA;</xsl:text>
+ <xsl:text>\usepackage{amsmath}&#xA;</xsl:text>
+ <xsl:text>\usepackage{textcomp}&#xA;</xsl:text>
+ <xsl:text>\usepackage{amssymb}&#xA;</xsl:text>
+ <xsl:text>\usepackage{capt-of}&#xA;</xsl:text>
+ <xsl:text>\usepackage{hyperref}&#xA;</xsl:text>
+ <xsl:text>\usepackage{optidef}&#xA;</xsl:text>
+ <xsl:text>\usepackage{tikz}&#xA;</xsl:text>
+ <xsl:text>\usepackage{subcaption}&#xA;</xsl:text>
+ <xsl:text>\usepackage{geometry}&#xA;</xsl:text>
+ <xsl:text>\usepackage{import}&#xA;</xsl:text>
+ <xsl:text>\usepackage{caption}&#xA;</xsl:text>
+ <xsl:text>\usepackage{algorithm}&#xA;</xsl:text>
+ <xsl:text>\usepackage{algorithmicx}&#xA;</xsl:text>
+ <xsl:text>\usepackage{algpseudocode}&#xA;</xsl:text>
+ <xsl:text>\usepackage{pdfpages}&#xA;</xsl:text>
+ <xsl:text>\usepackage{svg}&#xA;</xsl:text>
+ <xsl:text>&#xA;</xsl:text>
+ <xsl:text>\author{</xsl:text><xsl:value-of select="$auteur" /><xsl:text>}&#xA;</xsl:text>
+ <xsl:text>\title{</xsl:text><xsl:value-of select="$titre" /><xsl:text>}&#xA;</xsl:text>
+ <xsl:text>&#xA;</xsl:text>
+ <xsl:text>\begin{document}&#xA;</xsl:text>
+ <xsl:text>&#xA;</xsl:text>
+ <xsl:text>\makeatletter&#xA;</xsl:text>
+ <xsl:text>\@ifundefined{srcdir}{}{&#xA;</xsl:text>
+ <xsl:text> \graphicspath{{\srcdir}}&#xA;</xsl:text>
+ <xsl:text> \newcommand{\insrcdir}[1]{\srcdir#1}&#xA;</xsl:text>
+ <xsl:text> \let\oldpgfimage\pgfimage&#xA;</xsl:text>
+ <xsl:text> \renewcommand{\pgfimage}[2][]{\oldpfgfimage[#1]{\insrcdir{images/#2}}}&#xA;</xsl:text>
+ <xsl:text>}&#xA;</xsl:text>
+ <xsl:text>\makeatother&#xA;</xsl:text>
+ <xsl:text>&#xA;</xsl:text>
+ <xsl:text>\let\mylistof\listof&#xA;</xsl:text>
+ <xsl:text>\renewcommand\listof[2]{\mylistof{algorithm}{Liste des algorithmes}}&#xA;</xsl:text>
+ <xsl:text>\makeatletter&#xA;</xsl:text>
+ <xsl:text>\providecommand*{\toclevel@algorithm}{0}&#xA;</xsl:text>
+ <xsl:text>\makeatother&#xA;</xsl:text>
+ <xsl:text>&#xA;</xsl:text>
+ <xsl:text>\includepdf{page-de-garde.pdf}&#xA;</xsl:text>
+ <xsl:text>&#xA;</xsl:text>
+ <xsl:apply-templates />
+ <xsl:text>\end{document}&#xA;</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="m:résumé">
+ <xsl:text>\section*{Résumé}&#xA;</xsl:text>
+ <xsl:apply-templates />
+ </xsl:template>
+
+ <xsl:template match="m:mots-clés">
+ <xsl:text>&#xA;</xsl:text>
+ <xsl:text>\vspace{1cm}&#xA;</xsl:text>
+ <xsl:text>&#xA;</xsl:text>
+ <xsl:text>\textbf{Mots-clés}~: &#xA;</xsl:text>
+ <xsl:apply-templates />
+ <xsl:text>&#xA;</xsl:text>
+ <xsl:text>\clearpage&#xA;</xsl:text>
+ <xsl:text>&#xA;</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="m:mot-clé[position() = last()]">
+ <xsl:apply-templates /><xsl:text>.&#xA;</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="m:mot-clé">
+ <xsl:apply-templates /><xsl:text>, </xsl:text>
+ </xsl:template>
+
+ <xsl:template match="m:abstract">
+ <xsl:text>\section*{Abstract}&#xA;</xsl:text>
+ <xsl:apply-templates />
+ </xsl:template>
+
+ <xsl:template match="m:keywords">
+ <xsl:text>&#xA;</xsl:text>
+ <xsl:text>\vspace{1cm}&#xA;</xsl:text>
+ <xsl:text>&#xA;</xsl:text>
+ <xsl:text>\textbf{Keywords}~: &#xA;</xsl:text>
+ <xsl:apply-templates />
+ <xsl:text>&#xA;</xsl:text>
+ <xsl:text>\cleardoublepage&#xA;</xsl:text>
+ <xsl:text>&#xA;</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="m:keyword[position() = last()]">
+ <xsl:apply-templates /><xsl:text>.&#xA;</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="m:keyword">
+ <xsl:apply-templates /><xsl:text>, </xsl:text>
+ </xsl:template>
+
+ <xsl:template match="html:head">
+ </xsl:template>
+</xsl:stylesheet>