cvs commit: BLFS/BOOK/stylesheets blfs-tex.xsl

larry at linuxfromscratch.org larry at linuxfromscratch.org
Tue Apr 13 09:23:43 PDT 2004


larry       04/04/13 10:23:43

  Modified:    BOOK     Makefile
  Added:       BOOK/stylesheets blfs-tex.xsl
  Log:
  add TeX option to Makefile
  
  Revision  Changes    Path
  1.3       +30 -5     BLFS/BOOK/Makefile
  
  Index: Makefile
  ===================================================================
  RCS file: /home/cvsroot/BLFS/BOOK/Makefile,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Makefile	13 Apr 2004 01:59:17 -0000	1.2
  +++ Makefile	13 Apr 2004 16:23:43 -0000	1.3
  @@ -6,6 +6,8 @@
   INSTALL = install
   JADE = openjade
   DOCBOOK = /usr/share/sgml/docbook/dsssl-stylesheets-1.78
  +BASEDIR= $(HOME)/public_html/blfs-book-xsl/
  +TEXBASEDIR= $(HOME)/public_html/blfs-book-tex
   
   SRCDIR = $(PWD)
   
  @@ -14,18 +16,24 @@
   		echo "Envar OUTPUTDIR is not set!" ; \
   		exit 1 ; \
   		fi
  -	@echo "Generating HTML Version of BLFS Book..."
  +	@echo "Generating HTML Version of BLFS Book with $(JADE)..."
   	@echo "  OUTPUTDIR = $(OUTPUTDIR)"
   	@$(INSTALL) -d $(OUTPUTDIR)
   	@cd $(OUTPUTDIR) && $(INSTALL) -d introduction postlfs general \
   		connect basicnet server content x kde gnome xsoft \
   		multimedia pst preface appendices other
  -	@cd $(OUTPUTDIR) && $(JADE) -t sgml -d $(DOCBOOK)/html/lfs.dsl \
  +	@cd $(OUTPUTDIR) && $(JADE) -t sgml -d $(DOCBOOK)/html/blfs.dsl \
   		$(DOCBOOK)/dtds/decls/xml.dcl $(SRCDIR)/index.xml
   
  -BASEDIR=~/blfs-book/
   
   blfs:
  +	@if [ -z $(BASEDIR) ]; then \
  +		echo "Envar BASEDIR is not set!" ; \
  +		exit 1 ; \
  +		fi
  +	@echo "Generating XHTML Version of BLFS Book with xsltproc..."
  +	@echo "  BASEDIR = $(BASEDIR)"
  +	@$(INSTALL) -d $(BASEDIR)
   	xsltproc --xinclude --nonet -stringparam base.dir $(BASEDIR) \
   	  stylesheets/blfs-chunked.xsl index.xml
   
  @@ -45,8 +53,25 @@
   	  index.html 
   
   pdf:
  -	xsltproc --xinclude --nonet --output lfs.fo
  +	xsltproc --xinclude --nonet --output blfs.fo
   	stylesheets/blfs-pdf.xsl \
   	  index.xml
  -	fop.sh lfs.fo lfs.pdf
  +	fop.sh blfs.fo blfs.pdf
   
  +tex:
  +	@if [ -z $(TEXBASEDIR) ]; then \
  +                echo "Envar TEXBASEDIR is not set!" ; \
  +                exit 1 ; \
  +                fi
  +	@echo "Generating TeX Version of BLFS Book with xsltproc..."
  +	@echo "  TEXBASEDIR = $(TEXBASEDIR)"
  +	@$(INSTALL) -d $(TEXBASEDIR)
  +
  +# Using profiles in book source to exclude parts of the book from TeX
  +# i.e. Changelog
  +	xsltproc --nonet --output $(TEXBASEDIR)/index.xml \
  +	--stringparam "profile.role" "book" \
  +	http://docbook.sourceforge.net/release/xsl/current/profiling/profile.xsl \
  +	index.xml
  +	@cd $(TEXBASEDIR) && xsltproc --nonet -o blfs-book.tex \
  +	$(SRCDIR)/stylesheets/blfs-tex.xsl index.xml
  
  
  
  1.1                  BLFS/BOOK/stylesheets/blfs-tex.xsl
  
  Index: blfs-tex.xsl
  ===================================================================
  <?xml version='1.0'?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version='1.0'>
  
  <xsl:import href="/usr/share/xml/docbook/db2latex-xsl-0.8pre1/xsl/docbook.xsl"/>
  <xsl:output method="text" encoding="ISO-8859-1" indent="yes"/>
  <xsl:variable name="latex.override">
  
  \documentclass[12pt]{book}
  
  \usepackage{lfs}
  \usepackage{fancyhdr}
  \usepackage{fancyvrb}
  \usepackage{makeidx}
  \usepackage{hyperref}
  \usepackage{fancybox}
  
  \oddsidemargin -0.5in
  \evensidemargin -0.625in
  \textwidth 7in
  \textheight 8.5in
  
  %\ifx\pdfoutput\undefined
  %\else
  %\pdfpagewidth=7in
  %\pdfpageheight=8.5in
  %\fi
  
  \pagestyle{fancy}
  \newenvironment{admonition}[2] {
   \vspace{8mm}
   \hspace{0mm}\newline
   \noindent
  }
  
  
  \fancyhf{}
  \fancyhead[LE,RO]{\bfseries\thepage}
  \fancyhead[LO]{\bfseries\rightmark}
  \fancyhead[RE]{\bfseries\leftmark}
  \renewcommand{\headrulewidth}{0.5pt}
  \renewcommand{\footrulewidth}{0pt}
  \addtolength{\headheight}{3pt}
  \fancypagestyle{plain}{%
  	\fancyhead{}
  	\renewcommand{\headrulewidth}{0pt}
  }
  
  
  \hyphenation{change-log cpp-flags ctrlaltdel ma-cros chil-ton}
  
  <!-- adds \frontmatter to document -->
  
  </xsl:variable>
  
  <xsl:variable name="toc.section.depth">1</xsl:variable>
  
  <xsl:variable name="latex.book.begindocument">
          <xsl:text>\begin{document}
</xsl:text>
          <xsl:text>\frontmatter
</xsl:text>
  </xsl:variable>
  
  <!-- This put each section on a new page in the preface section -->
  
  <xsl:template match="preface/sect1">
          <xsl:text>
</xsl:text>
          <xsl:text>\newpage
</xsl:text>
          <xsl:text>\section*{</xsl:text><xsl:copy-of
  select="normalize-space(title)"/><xsl:text>}
</xsl:text>
          <xsl:apply-templates/>
  </xsl:template>
  
  
  
  </xsl:stylesheet>
  
  
  



More information about the blfs-book mailing list