Source files of fsfe.org, pdfreaders.org, freeyourandroid.org, ilovefs.org, drm.info, and test.fsfe.org. Contribute: https://fsfe.org/contribute/web/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mk-tex-a3.xsl 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <xsl:output method="text" encoding="UTF-8"/>
  4. <xsl:param name="language"/>
  5. <xsl:template match="html">
  6. <xsl:apply-templates match="body"/>
  7. </xsl:template>
  8. <xsl:template match="head"/>
  9. <xsl:template match="body">
  10. <xsl:text>\documentclass[11pt]{article}
  11. \usepackage[a3paper]{geometry}</xsl:text>
  12. <xsl:if test="$language='el'">\usepackage[english,greek]{babel}</xsl:if>
  13. <xsl:text>\usepackage{ucs}
  14. \usepackage[utf8x]{inputenc}
  15. \usepackage[T1]{fontenc}
  16. </xsl:text><xsl:if test="$language!='el'">\usepackage{helvet}</xsl:if><xsl:text>
  17. \usepackage{graphics}
  18. \usepackage{color}
  19. \usepackage[absolute]{textpos}
  20. % Switch to A3 paper
  21. \setlength\paperwidth{420mm}
  22. \setlength\paperheight{297mm}
  23. % No chapter numbering
  24. \setcounter{secnumdepth}{-2}
  25. % Colors
  26. \definecolor{bluedark}{cmyk}{.9,.2,.1,.05}
  27. \definecolor{fsfeblue}{cmyk}{1,.7,.05,.2}
  28. \renewcommand{\familydefault}{\sfdefault}
  29. % Section and subsection formatting
  30. \makeatletter
  31. \renewcommand{\section}{\@startsection{section}{2}{\z@}%
  32. {-3.5ex \@plus -1ex \@minus -.2ex}%
  33. {2.3ex \@plus.2ex}%
  34. {\fontsize{16pt}{18pt}\selectfont\bfseries\color{fsfeblue}}}
  35. \renewcommand{\subsection}{\@startsection{section}{3}{\z@}%
  36. {\bigskipamount}%
  37. {\smallskipamount}%
  38. {\fontsize{12pt}{14.4pt}\selectfont\bfseries\itshape\color{fsfeblue}}}
  39. \makeatother
  40. </xsl:text>
  41. <!-- Begin of document -->
  42. <xsl:text>\begin{document}</xsl:text>
  43. <xsl:text>\pagestyle{empty}</xsl:text>
  44. <!-- First (outer) page -->
  45. <xsl:text>\begin{textblock*}{170mm}(20mm,70mm)</xsl:text>
  46. <xsl:text>\raggedright</xsl:text>
  47. <xsl:apply-templates select="div[@id='contribute']"/>
  48. <!-- Disclaimer -->
  49. <xsl:if test="$language!='de' and $language!='en' and $language!='es' and $language!='it'">
  50. <xsl:if test="$language='el'">
  51. \selectlanguage{english}
  52. </xsl:if>
  53. <xsl:text>
  54. \bigskip \scriptsize This is an inofficial translation. Please see
  55. http://www.fsfe.org/about/printable/printable.en.html for the
  56. original text.
  57. </xsl:text>
  58. </xsl:if>
  59. <xsl:text>\end{textblock*}</xsl:text>
  60. <xsl:text>\begin{textblock*}{\paperwidth}(-32pt,0pt)</xsl:text>
  61. <xsl:text>\includegraphics{background-a3-outer.pdf}</xsl:text>
  62. <xsl:text>\end{textblock*}</xsl:text>
  63. <xsl:text>~\pagebreak</xsl:text>
  64. <!-- Second (inner) page -->
  65. <xsl:text>\begin{textblock*}{170mm}(20mm,55mm)</xsl:text>
  66. <xsl:text>\raggedright</xsl:text>
  67. <xsl:apply-templates select="div[@id='fsfe']"/>
  68. <xsl:text>\end{textblock*}</xsl:text>
  69. <xsl:text>\begin{textblock*}{170mm}(230mm,55mm)</xsl:text>
  70. <xsl:text>\raggedright</xsl:text>
  71. <xsl:apply-templates select="div[@id='free_software']"/>
  72. <xsl:text>\end{textblock*}</xsl:text>
  73. <xsl:text>\begin{textblock*}{\paperwidth}(-32pt,0pt)</xsl:text>
  74. <xsl:text>\includegraphics{background-a3-inner.pdf}</xsl:text>
  75. <xsl:text>\end{textblock*}</xsl:text>
  76. <!-- End of document -->
  77. <xsl:text>\end{document}</xsl:text>
  78. </xsl:template>
  79. <xsl:template match="div">
  80. <xsl:apply-templates select="node()"/>
  81. </xsl:template>
  82. <xsl:template match="h1">
  83. <xsl:text>\section{</xsl:text>
  84. <xsl:apply-templates select="node()"/>
  85. <xsl:text>}</xsl:text>
  86. </xsl:template>
  87. <xsl:template match="h2">
  88. <xsl:text>\subsection{</xsl:text>
  89. <xsl:apply-templates select="node()"/>
  90. <xsl:text>}</xsl:text>
  91. </xsl:template>
  92. <xsl:template match="p">
  93. <xsl:apply-templates select="node()"/>
  94. <xsl:text>\par </xsl:text>
  95. </xsl:template>
  96. <xsl:template match="ul">
  97. <xsl:apply-templates select="li"/>
  98. <xsl:text>\bigskip</xsl:text>
  99. </xsl:template>
  100. <xsl:template match="li">
  101. <xsl:apply-templates select="node()"/>
  102. </xsl:template>
  103. <xsl:template match="b">
  104. <xsl:text>\subsection{</xsl:text>
  105. <xsl:apply-templates select="node()"/>
  106. <xsl:text>}</xsl:text>
  107. </xsl:template>
  108. <xsl:template match="latin">
  109. <xsl:text>{\selectlanguage{english}</xsl:text>
  110. <xsl:apply-templates select="node()"/>
  111. <xsl:text>}</xsl:text>
  112. </xsl:template>
  113. <xsl:template match="a">
  114. <xsl:text>{\color{bluedark} </xsl:text>
  115. <xsl:apply-templates select="node()"/>
  116. <xsl:text>}</xsl:text>
  117. </xsl:template>
  118. <xsl:template match="br">\\</xsl:template>
  119. <xsl:template match="timestamp"/>
  120. <xsl:template match="translator"/>
  121. </xsl:stylesheet>