lfs-tex.xsl 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?xml version='1.0' encoding='ISO-8859-1'?>
  2. <!-- Created by Larry Lawrence <larry@linuxfromscratch.org> -->
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4. version='1.0'>
  5. <xsl:import href="http://db2latex.sourceforge.net/xsl/docbook.xsl"/>
  6. <xsl:output method="text" encoding="ISO-8859-1" indent="yes"/>
  7. <xsl:variable name="latex.override">
  8. \documentclass[12pt]{book}
  9. \usepackage{lfs}
  10. \usepackage{fancyhdr}
  11. \usepackage{fancyvrb}
  12. \usepackage{makeidx}
  13. \usepackage{hyperref}
  14. \usepackage{fancybox}
  15. \oddsidemargin -0.5in
  16. \evensidemargin -0.625in
  17. \textwidth 7in
  18. \textheight 8.5in
  19. %\ifx\pdfoutput\undefined
  20. %\else
  21. %\pdfpagewidth=7in
  22. %\pdfpageheight=8.5in
  23. %\fi
  24. \pagestyle{fancy}
  25. \newenvironment{admonition}[2] {
  26. \vspace{8mm}
  27. \hspace{0mm}\newline
  28. \noindent
  29. }
  30. \fancyhf{}
  31. \fancyhead[LE,RO]{\bfseries\thepage}
  32. \fancyhead[LO]{\bfseries\rightmark}
  33. \fancyhead[RE]{\bfseries\leftmark}
  34. \renewcommand{\headrulewidth}{0.5pt}
  35. \renewcommand{\footrulewidth}{0pt}
  36. \addtolength{\headheight}{3pt}
  37. \fancypagestyle{plain}{%
  38. \fancyhead{}
  39. \renewcommand{\headrulewidth}{0pt}
  40. }
  41. \hyphenation{change-log cpp-flags ctrlaltdel ma-cros chil-ton}
  42. <!-- adds \frontmatter to document -->
  43. </xsl:variable>
  44. <xsl:variable name="toc.section.depth">1</xsl:variable>
  45. <xsl:variable name="latex.book.begindocument">
  46. <xsl:text>\begin{document}&#10;</xsl:text>
  47. <xsl:text>\frontmatter&#10;</xsl:text>
  48. </xsl:variable>
  49. <!-- This put each section on a new page in the preface section -->
  50. <xsl:template match="preface/sect1">
  51. <xsl:text>&#10;</xsl:text>
  52. <xsl:text>\newpage&#10;</xsl:text>
  53. <xsl:text>\section*{</xsl:text><xsl:copy-of
  54. select="normalize-space(title)"/><xsl:text>}&#10;</xsl:text>
  55. <xsl:apply-templates/>
  56. </xsl:template>
  57. </xsl:stylesheet>