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.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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>
  17. <xsl:if test="$language='ru'">\usepackage[russian]{babel}
  18. </xsl:if>
  19. <xsl:if test="$language!='el'">\usepackage{helvet}</xsl:if><xsl:text>
  20. \usepackage{graphics}
  21. \usepackage{color}
  22. \usepackage[absolute]{textpos}
  23. % Switch to A3 paper
  24. \setlength\paperwidth{420mm}
  25. \setlength\paperheight{297mm}
  26. % No chapter numbering
  27. \setcounter{secnumdepth}{-2}
  28. % Colors
  29. \definecolor{bluedark}{cmyk}{.9,.2,.1,.05}
  30. \definecolor{fsfeblue}{cmyk}{1,.7,.05,.2}
  31. \renewcommand{\familydefault}{\sfdefault}
  32. % Section and subsection formatting
  33. \makeatletter
  34. \renewcommand{\section}{\@startsection{section}{2}{\z@}%
  35. {-3.5ex \@plus -1ex \@minus -.2ex}%
  36. {2.3ex \@plus.2ex}%
  37. {\fontsize{16pt}{18pt}\selectfont\bfseries\color{fsfeblue}}}
  38. \renewcommand{\subsection}{\@startsection{section}{3}{\z@}%
  39. {\bigskipamount}%
  40. {\smallskipamount}%
  41. {\fontsize{12pt}{14.4pt}\selectfont\bfseries\itshape\color{fsfeblue}}}
  42. \makeatother
  43. </xsl:text>
  44. <!-- Begin of document -->
  45. <xsl:text>\begin{document}</xsl:text>
  46. <xsl:text>\pagestyle{empty}</xsl:text>
  47. <!-- First (outer) page -->
  48. <xsl:text>\begin{textblock*}{\paperwidth}(-32pt,0pt)</xsl:text>
  49. <xsl:text>\includegraphics{background-a3-outer.pdf}</xsl:text>
  50. <xsl:text>\end{textblock*}</xsl:text>
  51. <xsl:text>\begin{textblock*}{170mm}(20mm,70mm)</xsl:text>
  52. <xsl:text>\raggedright</xsl:text>
  53. <xsl:apply-templates select="div[@id='contribute']"/>
  54. <!-- Disclaimer -->
  55. <xsl:if test="$language!='de' and $language!='en' and $language!='es' and $language!='it'">
  56. <xsl:if test="$language='el'">
  57. \selectlanguage{english}
  58. </xsl:if>
  59. <xsl:if test="$language!='ru'">
  60. <xsl:text>
  61. \bigskip \scriptsize This is an unofficial translation. Please see
  62. http://www.fsfe.org/about/printable/printable.en.html for the
  63. original text.
  64. </xsl:text>
  65. </xsl:if>
  66. <xsl:if test="$language='ru'">
  67. <xsl:text>
  68. \bigskip \scriptsize Это неофициальный перевод. Оригинальный текст
  69. см. на http://www.fsfe.org/about/printable/printable.en.html
  70. </xsl:text>
  71. </xsl:if>
  72. </xsl:if>
  73. <xsl:text>\end{textblock*}</xsl:text>
  74. <xsl:text>~\pagebreak</xsl:text>
  75. <!-- Second (inner) page -->
  76. <xsl:text>\begin{textblock*}{\paperwidth}(-32pt,0pt)</xsl:text>
  77. <xsl:text>\includegraphics{background-a3-inner.pdf}</xsl:text>
  78. <xsl:text>\end{textblock*}</xsl:text>
  79. <xsl:text>\begin{textblock*}{170mm}(20mm,55mm)</xsl:text>
  80. <xsl:text>\raggedright</xsl:text>
  81. <xsl:apply-templates select="div[@id='fsfe']"/>
  82. <xsl:text>\end{textblock*}</xsl:text>
  83. <xsl:text>\begin{textblock*}{170mm}(230mm,55mm)</xsl:text>
  84. <xsl:text>\raggedright</xsl:text>
  85. <xsl:apply-templates select="div[@id='free_software']"/>
  86. <xsl:text>\end{textblock*}</xsl:text>
  87. <!-- End of document -->
  88. <xsl:text>\end{document}</xsl:text>
  89. </xsl:template>
  90. <xsl:template match="div">
  91. <xsl:apply-templates select="node()"/>
  92. </xsl:template>
  93. <xsl:template match="h1">
  94. <xsl:text>\section{</xsl:text>
  95. <xsl:apply-templates select="node()"/>
  96. <xsl:text>}</xsl:text>
  97. </xsl:template>
  98. <xsl:template match="h2">
  99. <xsl:text>\subsection{</xsl:text>
  100. <xsl:apply-templates select="node()"/>
  101. <xsl:text>}</xsl:text>
  102. </xsl:template>
  103. <xsl:template match="p">
  104. <xsl:apply-templates select="node()"/>
  105. <xsl:text>\par </xsl:text>
  106. </xsl:template>
  107. <xsl:template match="ul">
  108. <xsl:apply-templates select="li"/>
  109. <xsl:text>\bigskip</xsl:text>
  110. </xsl:template>
  111. <xsl:template match="li">
  112. <xsl:apply-templates select="node()"/>
  113. </xsl:template>
  114. <xsl:template match="b">
  115. <xsl:text>\subsection{</xsl:text>
  116. <xsl:apply-templates select="node()"/>
  117. <xsl:text>}</xsl:text>
  118. </xsl:template>
  119. <xsl:template match="latin">
  120. <xsl:text>{\selectlanguage{english}</xsl:text>
  121. <xsl:apply-templates select="node()"/>
  122. <xsl:text>}</xsl:text>
  123. </xsl:template>
  124. <xsl:template match="a">
  125. <xsl:text>{\color{bluedark} </xsl:text>
  126. <xsl:apply-templates select="node()"/>
  127. <xsl:text>}</xsl:text>
  128. </xsl:template>
  129. <xsl:template match="br">\\</xsl:template>
  130. <xsl:template match="timestamp"/>
  131. <xsl:template match="translator"/>
  132. </xsl:stylesheet>