summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-02-13 23:21:44 +0000
committerKarl Berry <karl@freefriends.org>2017-02-13 23:21:44 +0000
commitff96a79c7a7cd21eba465d123a37f3824c1e7fbb (patch)
tree6c639801231922efaba97c7ee4c09b9ea17c9078
parent03c75645664be34a27afa8e4e30b0f96d25de53b (diff)
bxdvidriver (13feb17)
git-svn-id: svn://tug.org/texlive/trunk@43219 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/bxdvidriver/LICENSE8
-rw-r--r--Master/texmf-dist/doc/latex/bxdvidriver/README.md4
-rw-r--r--Master/texmf-dist/tex/latex/bxdvidriver/bxdvidriver.sty63
3 files changed, 47 insertions, 28 deletions
diff --git a/Master/texmf-dist/doc/latex/bxdvidriver/LICENSE b/Master/texmf-dist/doc/latex/bxdvidriver/LICENSE
index 49f803e083e..8ada757fbc8 100644
--- a/Master/texmf-dist/doc/latex/bxdvidriver/LICENSE
+++ b/Master/texmf-dist/doc/latex/bxdvidriver/LICENSE
@@ -1,12 +1,6 @@
-$BK\%=%U%H%&%'%"$O(B MIT $B%i%$%;%s%9$N2<$GG[I[$5$l$^$9!#(B
-$BCx:n8"$O:n<T$G$"$k!VH,EP(B $B?rG7!JJLL>(B ZR$B!K!W$KB0$7$^$9!#(B
-$B$^$?K\%=%U%H%&%'%"$OL5J]>Z$G$9!#(B
-
-This software is distributed under the MIT License.
-
The MIT License
-Copyright (c) 2016 Takayuki YATO (aka. "ZR")
+Copyright (c) 2017 Takayuki YATO (aka. "ZR")
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/Master/texmf-dist/doc/latex/bxdvidriver/README.md b/Master/texmf-dist/doc/latex/bxdvidriver/README.md
index 3e85864b83e..bf2fb1f4179 100644
--- a/Master/texmf-dist/doc/latex/bxdvidriver/README.md
+++ b/Master/texmf-dist/doc/latex/bxdvidriver/README.md
@@ -94,9 +94,11 @@ are done by package options.
Revision History
----------------
+ * Version 0.2a ‹2017/02/13›
+ - Bug fix.
* Version 0.2 ‹2016/03/26›
- The first public version.
--------------------
Takayuki YATO (aka. "ZR")
-http://zrbabbler.sp.land.to/
+https://github.com/zr-tex8r
diff --git a/Master/texmf-dist/tex/latex/bxdvidriver/bxdvidriver.sty b/Master/texmf-dist/tex/latex/bxdvidriver/bxdvidriver.sty
index a8ea0748acf..612249d6006 100644
--- a/Master/texmf-dist/tex/latex/bxdvidriver/bxdvidriver.sty
+++ b/Master/texmf-dist/tex/latex/bxdvidriver/bxdvidriver.sty
@@ -2,7 +2,7 @@
%% package declaration
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bxdvidriver}[2016/03/26 v0.2]
+\ProvidesPackage{bxdvidriver}[2017/02/13 v0.2a]
%% preparation
\def\bxdd@pkgname{bxdvidriver}
@@ -29,9 +29,9 @@
%% variables
\newif\ifbxdd@ok
\@onlypreamble\bxdd@driver
-\let\bxdd@driver\relax
+\let\bxdd@driver\relax % driver given to this package
\@onlypreamble\bxdd@pdf@driver
-\let\bxdd@pdf@driver\relax
+\let\bxdd@pdf@driver\relax % actual pdf-mode driver, or \relax
%% \[bxdd@T/<driver>]
\@for\bxdd@x:=\bxdd@dvi@driver@list\do{%
@@ -45,6 +45,12 @@
\def\bxdd@detokenize@a#1>#2\relax#3{%
\def#3{#2}}
+%% switch 'bxdd@in@preamble'
+\newif\ifbxdd@in@preamble
+\ifx\documentclass\@twoclasseserror
+ \bxdd@in@preambletrue
+\fi
+
%--------------------------------------- options
%% 'check'/'nocheck'
@@ -53,26 +59,35 @@
\bxdd@checktrue}
\DeclareOption{nocheck}{%
\bxdd@checkfalse}
-%% drivers
+%% driver options
\DeclareOption*{%
- \expandafter\let\expandafter\bxdd@tmpa
- \csname bxdd@T/\CurrentOption\endcsname
- \ifx\bxdd@tmpa\relax
+ \bxdd@pfxplus\CurrentOption \ifx\bxdd@tmpa\@empty
+ \let\bxdd@tmpa\CurrentOption
+ \else
+ \expandafter\let\csname bxdd@T/\bxdd@tmpa\endcsname=d%
+ \fi
+ \expandafter\let\expandafter\bxdd@tmpb
+ \csname bxdd@T/\bxdd@tmpa\endcsname
+ \ifx\bxdd@tmpb\relax % unknown name
\PackageError\bxdd@pkgname
- {Unknown driver name '\CurrentOption' found}%
+ {Unknown driver name '\bxdd@tmpa' found}%
{The invalid option is ignored.\MessageBreak\@ehc}
- \else\ifx\bxdd@driver\relax
- \let\bxdd@driver\CurrentOption
- \else\ifx\bxdd@driver\CurrentOption
+ \else\ifx\bxdd@driver\relax % first
+ \let\bxdd@driver\bxdd@tmpa
+ \else\ifx\bxdd@driver\bxdd@tmpa % repeated
\PackageInfo\bxdd@pkgname
- {Redundant driver option '\CurrentOption',\MessageBreak
+ {Redundant driver option '\bxdd@tmpa',\MessageBreak
found}%
- \else
+ \else % second
\PackageError\bxdd@pkgname
{Multiple driver options are given\MessageBreak
- ('\bxdd@driver' and '\CurrentOption')}%
- {The extra option '\CurrentOption' is ignored.\MessageBreak\@ehc}
+ ('\bxdd@driver' and '\bxdd@tmpa')}%
+ {The extra option '\bxdd@tmpa' is ignored.\MessageBreak\@ehc}
\fi\fi\fi}
+\def\bxdd@pfxplus#1{%
+ \expandafter\bxdd@pfxplus@a#1\@gobble+\@nil}
+\def\bxdd@pfxplus@a#1+#2\@nil{%
+ \edef\bxdd@tmpa{\ifx\@nil#1\@nil#2\else\fi}}
%%
\ProcessOptions*
@@ -89,7 +104,7 @@
%--------------------------------------- pdf-mode detection
-%% check 'pdfmode'
+%% check 'pdfmode' and set \bxdd@pdf@driver
\bxdd@oktrue
\ifluatex
\let\bxdd@tmpa\m@ne
@@ -113,6 +128,7 @@
\ifbxdd@ok\else
\expandafter\endinput\fi\relax
+% clear \bxdd@driver if pdf-mode
\ifx\bxdd@pdf@driver\relax\else
\PackageInfo\bxdd@pkgname
{Driver option '\bxdd@driver' is ignored, because\MessageBreak
@@ -120,7 +136,7 @@
\let\bxdd@driver\relax
\fi
-%---------------------------------------
+%--------------------------------------- append to global
%% variables
\let\bxdd@gopt\relax
@@ -134,6 +150,10 @@
\@for\bxdd@gopt:=\@classoptionslist\do{%
\let\bxdd@tmpa\bxdd@gopt \bxdd@detokenize\bxdd@tmpa
\expandafter\ifx\csname bxdd@T/\bxdd@tmpa\endcsname\relax\else
+ \ifbxdd@in@preamble
+ \@expandtwoargs\@removeelement\bxdd@gopt
+ \@unusedoptionlist\@unusedoptionlist
+ \fi
\ifx\bxdd@godrv\bxdd@gopt % just redundant
\else\ifx\bxdd@godrv\relax % first
\let\bxdd@godrv\bxdd@gopt
@@ -148,6 +168,7 @@
\let\bxdd@godrv\bxdd@godrv@multiple
\fi\fi\fi
\fi}
+ \global\let\@unusedoptionlist\@unusedoptionlist
\aftergroup\bxdd@okfalse
\ifx\bxdd@godrv\relax
\ifx\bxdd@driver\relax\else
@@ -167,6 +188,8 @@
(see log for detail)}%
{\@ehd}%
\fi
+ \else\ifx\bxdd@driver\relax
+ % nothing to do
\else % inconsistent
\ifbxdd@check
\PackageError\bxdd@pkgname
@@ -179,11 +202,11 @@
because the global option list contains another driver\MessageBreak
'\bxdd@godrv',}
\fi
- \fi\fi\fi
+ \fi\fi\fi\fi
\endgroup}
%% append the specified driver option
-\ifx\documentclass\@twoclasseserror% in preamble
+\ifbxdd@in@preamble
\bxdd@scan@global@options
\ifbxdd@ok
\edef\bxdd@tmpa{%
@@ -211,7 +234,7 @@
\bxdd@tmpa}
\fi
-%---------------------------------------
+%--------------------------------------- check for graphics drivers
%% \bxdd@scan@graphics@drivers
\@onlypreamble\bxdd@scan@graphics@drivers