Skip to content

Commit

Permalink
Adding feature of selectable color scheme for PDF
Browse files Browse the repository at this point in the history
* Adding pdf.color.scheme variable.
* Switching color scheme according to pdf.color.scheme variable,
  Acceptable values are now "full-color" for PC/Tablet reader
  and "gray-scale" for lulu.com POD service.
  • Loading branch information
AYANOKOUZI, Ryuunosuke committed Feb 28, 2016
1 parent 6b6a92d commit b5b003b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions build/build-pdf
Expand Up @@ -2,6 +2,7 @@

# Interestings options:
# --opts="-P full.bleed=1" => add crop margins for print PDF for Lulu
# --opts="-P pdf.color.scheme=gray-scale" => gray scale PDF for Lulu POD service
# --opts="-V" => verbose mode of dblatex
# --lang=de-DE => build a translation

Expand Down
30 changes: 30 additions & 0 deletions build/dblatex/config.xsl
Expand Up @@ -55,9 +55,39 @@
<xsl:param name="page.margin.top">1.3cm</xsl:param>
<xsl:param name="page.margin.bottom">1.3cm</xsl:param>

<!-- PDF color scheme
Acceptable values are
full-color (default, for PC/Tablet readers),
gray-scale (for lulu.com POD service),
-->
<xsl:param name="pdf.color.scheme">full-color</xsl:param>

<!-- Fonts used -->
<xsl:param name="xetex.font">
<xsl:text>% dblatex template xetex.font starts here.&#10;</xsl:text>

<xsl:text>% $pdf.color.scheme='</xsl:text>
<xsl:value-of select="$pdf.color.scheme"/>
<xsl:text>'&#10;</xsl:text>
<xsl:choose>
<xsl:when test="$pdf.color.scheme='gray-scale'">
<xsl:text>
% pdf.color.scheme gray-scale
\defaultfontfeatures+{
Color = 000000FF,
}
</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>
% pdf.color.scheme default
%
%
%
</xsl:text>
</xsl:otherwise>
</xsl:choose>

<xsl:choose>
<xsl:when test="/book[@lang='ja-JP']">
<xsl:text>
Expand Down

0 comments on commit b5b003b

Please sign in to comment.