Changeset 56167 in vbox for trunk/doc/manual/docbook2latex.xsl
- Timestamp:
- May 31, 2015 8:10:23 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/manual/docbook2latex.xsl
r49487 r56167 284 284 </xsl:when> 285 285 <xsl:when test="name(..)='chapter'"> 286 <xsl:text>

\chapter{</xsl:text> 286 <xsl:call-template name="xsltprocNewlineOutputHack"/> 287 <xsl:text>
\chapter{</xsl:text> 287 288 <xsl:apply-templates /> 288 289 <xsl:text>}</xsl:text> 289 290 </xsl:when> 290 291 <xsl:when test="name(..)='sect1'"> 291 <xsl:text>

\section{</xsl:text> 292 <xsl:call-template name="xsltprocNewlineOutputHack"/> 293 <xsl:text>
\section{</xsl:text> 292 294 <xsl:apply-templates /> 293 295 <xsl:text>}</xsl:text> 294 296 </xsl:when> 295 297 <xsl:when test="name(..)='sect2'"> 296 <xsl:text>

\subsection{</xsl:text> 298 <xsl:call-template name="xsltprocNewlineOutputHack"/> 299 <xsl:text>
\subsection{</xsl:text> 297 300 <xsl:apply-templates /> 298 301 <xsl:text>}</xsl:text> 299 302 </xsl:when> 300 303 <xsl:when test="name(..)='sect3'"> 301 <xsl:text>

\subsubsection{</xsl:text> 302 <xsl:apply-templates /> 303 <xsl:text>}</xsl:text> 304 </xsl:when> 305 <xsl:when test="name(..)='sect4'"> 306 <xsl:text>

\paragraph{</xsl:text> 307 <xsl:apply-templates /> 308 <xsl:text>}</xsl:text> 309 </xsl:when> 310 <xsl:when test="name(..)='sect5'"> 311 <xsl:text>

\subparagraph{</xsl:text> 304 <xsl:call-template name="xsltprocNewlineOutputHack"/> 305 <xsl:text>
\subsubsection{</xsl:text> 306 <xsl:apply-templates /> 307 <xsl:text>}</xsl:text> 308 </xsl:when> 309 <xsl:when test="name(..)='sect4' or name(..)='refsect1'"> 310 <xsl:call-template name="xsltprocNewlineOutputHack"/> 311 <xsl:text>
\paragraph{</xsl:text> 312 <xsl:apply-templates /> 313 <xsl:text>}</xsl:text> 314 </xsl:when> 315 <xsl:when test="name(..)='sect5' or name(..)='refsect2'"> 316 <xsl:call-template name="xsltprocNewlineOutputHack"/> 317 <xsl:text>
\subparagraph{</xsl:text> 312 318 <xsl:apply-templates /> 313 319 <xsl:text>}</xsl:text> 314 320 </xsl:when> 315 321 <xsl:when test="name(..)='appendix'"> 316 <xsl:text>

\chapter{</xsl:text> 322 <xsl:call-template name="xsltprocNewlineOutputHack"/> 323 <xsl:text>
\chapter{</xsl:text> 317 324 <xsl:apply-templates /> 318 325 <xsl:text>}</xsl:text> 319 326 </xsl:when> 320 327 <xsl:when test="name(..)='glossdiv'"> 321 <xsl:text>

\section*{</xsl:text> 328 <xsl:call-template name="xsltprocNewlineOutputHack"/> 329 <xsl:text>
\section*{</xsl:text> 322 330 <xsl:apply-templates /> 323 331 <xsl:text>}</xsl:text> … … 479 487 480 488 <xsl:template match="itemizedlist"> 481 <xsl:text>

\begin{itemize}
</xsl:text> 489 <xsl:call-template name="xsltprocNewlineOutputHack"/> 490 <xsl:text>
\begin{itemize}
</xsl:text> 482 491 <xsl:apply-templates /> 483 492 <xsl:text>
\end{itemize}
</xsl:text> … … 485 494 486 495 <xsl:template match="orderedlist"> 487 <xsl:text>

\begin{enumerate}
</xsl:text> 496 <xsl:call-template name="xsltprocNewlineOutputHack"/> 497 <xsl:text>
\begin{enumerate}
</xsl:text> 488 498 <xsl:apply-templates /> 489 499 <xsl:text>
\end{enumerate}
</xsl:text> 500 </xsl:template> 501 502 <xsl:template match="variablelist"> 503 <xsl:call-template name="xsltprocNewlineOutputHack"/> 504 <xsl:text>
\begin{description}
</xsl:text> 505 <xsl:apply-templates /> 506 <xsl:text>
\end{description}
</xsl:text> 507 </xsl:template> 508 509 <xsl:template match="varlistentry"> 510 <xsl:if test="not(./term)"><xsl:message terminate="yes">Expected term element in varlistentry.</xsl:message></xsl:if> 511 <xsl:text>

\item[</xsl:text> 512 <xsl:apply-templates select="term"/> 513 <xsl:text>] \hfill \\
</xsl:text> 514 <xsl:apply-templates select="listitem/*"/> 490 515 </xsl:template> 491 516 … … 574 599 </xsl:template> 575 600 601 <!-- 602 refentry releated stuff and isn't handled elsewhere... 603 --> 604 <xsl:template match="refsynopsisdiv"> 605 <xsl:call-template name="xsltprocNewlineOutputHack"/> 606 <xsl:text>
\paragraph{Synopsis
}
</xsl:text> 607 <!-- apply templates! --> 608 </xsl:template> 609 610 <xsl:template match="refentry|refnamediv|refentryinfo|refmeta|refsect3|refsect4|refsect5"> 611 <xsl:message terminate="yes"><xsl:value-of select="name()"/> is not supported</xsl:message> 612 </xsl:template> 613 614 <xsl:template match="cmdsynopsis|command"> 615 <xsl:text>\texttt{</xsl:text> 616 <xsl:apply-templates /> 617 <xsl:text>}</xsl:text> 618 </xsl:template> 619 620 621 <!-- --> 576 622 <xsl:template match="//text()"> 577 623 <xsl:variable name="subst1"> … … 739 785 </xsl:choose> 740 786 </xsl:template> 787 788 <!-- 789 xsltprocNewlineOutputHack - emits a single new line. 790 791 Hack Alert! This template helps xsltproc split up the output text elements 792 and avoid reallocating them into the MB range. Calls to this 793 template is made occationally while generating larger output 794 file. It's not necessary for small stuff like header. 795 796 The trick we're playing on xsltproc has to do with CDATA 797 and/or the escape setting of the xsl:text element. It forces 798 xsltproc to allocate a new output element, thus preventing 799 things from growing out of proportions and slowing us down. 800 801 This was successfully employed to reduce a 18+ seconds run to 802 around one second (possibly less due to kmk overhead). 803 --> 804 <xsl:template name="xsltprocNewlineOutputHack"> 805 <xsl:text disable-output-escaping="yes"><![CDATA[ 806 ]]></xsl:text> 807 </xsl:template> 808 741 809 </xsl:stylesheet> 742 810
Note:
See TracChangeset
for help on using the changeset viewer.