Newer
Older
XML / modules / basic-text-formatting.xml
<?xml version="1.0" encoding="utf-8"?>

<!--
	Basic text formatting, like emphasis, bold, etc.
-->

<stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<!-- "Logical" styles. -->

	<!-- Emphasis (normally italic). -->
	<template name="emph" match="emph|em">
		<common formats="/latex/xelatex/">\emph{<xsl:apply-templates />}</common>
		<common formats="/html/xhtml/"><em><xsl:apply-templates /></em></common>
	</template>

	<!--
		Emphasis inside answers needs to be handled specially in HTML, as it doesn't just flip-flop automatically like it does in LaTeX.
	-->
	<template name="emph-in-answer" match="answer//emph|answer//em">
		<common formats="/latex/xelatex/">\emph{<xsl:apply-templates />}</common>
		<common formats="/html/xhtml/"><strong><xsl:apply-templates /></strong></common>
	</template>

	<!-- Strong emphasis (normally bold). -->
	<template name="strong" match="strong">
		<common formats="/latex/xelatex/">\textbf{<xsl:apply-templates />}</common>
		<common formats="/html/xhtml/"><strong><xsl:apply-templates /></strong></common>
	</template>
	
	<!-- A defined term. -->
	<template name="term" match="term">
		<common formats="/latex/xelatex/">\term{<xsl:apply-templates />}</common>
		<common formats="/html/xhtml/"><i class="term"><xsl:apply-templates /></i></common>
	</template>
	
	<!-- A foreign word or phrase. -->
	<template name="foreign" match="foreign">
		<common formats="/latex/xelatex/">\foreign{<xsl:apply-templates />}</common>
		<common formats="/html/xhtml/"><i class="foreign"><xsl:apply-templates /></i></common>
	</template>
	

	<!-- "Physical" styles. -->
	
	<!-- Italics. -->
	<template name="italic" match="italic">
		<common formats="/latex/xelatex/">\textit{<xsl:apply-templates />}</common>
		<common formats="/html/xhtml/"><i><xsl:apply-templates /></i></common>
	</template>
	
	<!-- Bold face. -->
	<template name="bold" match="bold">
		<common formats="/latex/xelatex/">\textbf{<xsl:apply-templates />}</common>
		<common formats="/html/xhtml/"><b><xsl:apply-templates /></b></common>
	</template>
	
	<!-- Underlining. -->
	<template name="underline" match="underline|u">
		<common formats="/latex/xelatex/">\underline{<xsl:apply-templates />}</common>
		<common formats="/html/xhtml/"><span style="text-decoration: underline;"><xsl:apply-templates /></span></common>
	</template>
	
</stylesheet>