texlive[71967] Master/texmf-dist: bxpdfver (3aug24)
commits+karl at tug.org
commits+karl at tug.org
Sat Aug 3 22:29:03 CEST 2024
Revision: 71967
https://tug.org/svn/texlive?view=revision&revision=71967
Author: karl
Date: 2024-08-03 22:29:03 +0200 (Sat, 03 Aug 2024)
Log Message:
-----------
bxpdfver (3aug24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/bxpdfver/README-ja.md
trunk/Master/texmf-dist/doc/latex/bxpdfver/README.md
trunk/Master/texmf-dist/tex/latex/bxpdfver/bxpdfver.sty
Modified: trunk/Master/texmf-dist/doc/latex/bxpdfver/README-ja.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxpdfver/README-ja.md 2024-08-03 20:28:55 UTC (rev 71966)
+++ trunk/Master/texmf-dist/doc/latex/bxpdfver/README-ja.md 2024-08-03 20:29:03 UTC (rev 71967)
@@ -43,11 +43,14 @@
* `objcompress`(既定): オブジェクトストリームの使用を抑止しない。
* ドライバオプション: 以下の通り。なお、後述の「ドライバ指定」の
節も参照されたい。
- + PDF 出力のエンジンの場合は、既定で適切なドライバが選択される
+ + LaTeX の新 PDF マネジメントが有効化されている場合は、自動的に
+ “latex-pdf”モードに切り替わる。ドライバオプションは不要である。
+ + PDF 出力のエンジンの場合は、自動的に適切なドライバが選択される
のでドライバオプションは不要である。
+ `dvipdfmx`: dvipdfmx 用のドライバを指定する。
+ `nodvidriver`/`disabled`: 全ての機能を無効化する。
※この場合 `lenient+` が既定になる。
+ + `ignorepdfmanagement`: “latex-pdf”モードへの切替を抑止する。
* `lenient`: サポートしない機能に対するエラーを警告に格下げする。
* `lenient+`: サポートしない機能に対するエラーを完全に抑止する。
* `nolenient`(既定): `lenient(+)` の否定。
@@ -79,11 +82,11 @@
### ドライバ指定に関する補足
\ Drivers (engines) pdfTeX dvipdfmx
- Features / LuaTeX / XeTeX others
- --------------------------- --------- --------- ------
- \setpdfversion Yes Yes No
- \suppresspdfcompression Yes Maybe(*2) No
- \suppresspdfobjcompression Yes Maybe(*2) No
+ Features / LuaTeX / XeTeX latex-pdf
+ --------------------------- --------- --------- ---------
+ \setpdfversion Yes Yes Yes
+ \suppresspdfcompression Yes Maybe(*2) Yes(*4)
+ \suppresspdfobjcompression Yes Maybe(*2) Yes(*4)
\setpdfdecimaldigits Yes Maybe(*2) No
\preservepdfdestinations No-op(*1) Maybe(*2) No
\setpdfpkresolution Yes Maybe(*3) No
@@ -92,6 +95,9 @@
`\preservepdfdestinations` は常に有効になっていると見なせる。
2. (x)dvipdfmx のバージョンが 20160307 以上である必要がある。
3. (x)dvipdfmx のバージョンが 20211016 以上である必要がある。
+ 4. `\suppresspdfcompression` と `\suppresspdfobjcompression` については
+ 一方を実行すると他方も自動的に有効になる。l3pdf モジュールで片方のみ
+ を有効化することはサポートされないからである。
dvipdfmx のバージョン判定について:
@@ -119,6 +125,9 @@
更新履歴
--------
+ * Version 0.8 ‹2024/08/03›
+ - カーネルの新 PDF マネジメントが有効な場合にも一部の機能が使える
+ ようにする(“latex-pdf”モード)。
* Version 0.7 ‹2024/07/24›
- `\setpdfpkresolution` を(正式に)サポート。(dvipdfmx/XeTeX
でも使用可能になった。)
Modified: trunk/Master/texmf-dist/doc/latex/bxpdfver/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxpdfver/README.md 2024-08-03 20:28:55 UTC (rev 71966)
+++ trunk/Master/texmf-dist/doc/latex/bxpdfver/README.md 2024-08-03 20:29:03 UTC (rev 71967)
@@ -44,11 +44,16 @@
* `noobjcompress`: Suppresses use of object streams.
* `objcompress` (default): Does not suppress use of object streams.
* Driver options: As below:
+ + When the new PDF management of LaTeX is activated, the package
+ will automatically switch to “latex-pdf” mode. You need not
+ give driver options.
+ When using a PDF-output engine, you need not give driver options
since the appropriate one is auto-detected.
+ `dvipdfmx`: Uses dvipdfmx driver.
+ `nodvidriver`/`disabled`: Disables all functions of the package.
NB. This option sets `lenient+` by default.
+ * `ignorepdfmanagement`: Avoids switching to “latex-pdf” mode, even
+ when the new PDF management of LaTeX is activated.
* `lenient`: Turns the errors for unsupported features into warnings.
* `lenient+`: Suppreseses the errors for unsupported features.
* `nolenient`: Negation of `lenient(+)`.
@@ -78,11 +83,11 @@
### NOTE ON DRIVERS
\ Drivers (engines) pdfTeX dvipdfmx
- Features / LuaTeX / XeTeX others
- --------------------------- --------- --------- ------
- \setpdfversion Yes Yes No
- \suppresspdfcompression Yes Maybe(*2) No
- \suppresspdfobjcompression Yes Maybe(*2) No
+ Features / LuaTeX / XeTeX latex-pdf
+ --------------------------- --------- --------- ---------
+ \setpdfversion Yes Yes Yes
+ \suppresspdfcompression Yes Maybe(*2) Yes(*4)
+ \suppresspdfobjcompression Yes Maybe(*2) Yes(*4)
\setpdfdecimaldigits Yes Maybe(*2) No
\preservepdfdestinations No-op(*1) Maybe(*2) No
\setpdfpkresolution Yes Maybe(*3) No
@@ -92,8 +97,11 @@
always in effect.
2. These features are available only when the version of (x)dvipdfmx
is 20160307 or later.
- 2. These features are available only when the version of (x)dvipdfmx
+ 3. These features are available only when the version of (x)dvipdfmx
is 20211016 or later.
+ 4. As for '\suppresspdfcompression' and '\suppresspdfobjcompression',
+ when one of them is executed, the other will be activated. It is
+ because l3pdf module does not support activating only one of them.
On the detection of dvipdfmx version:
@@ -119,6 +127,9 @@
REVISION HISTORY
----------------
+ * Version 0.8 ‹2024/08/03›
+ - Support some features even when the new PDF management of the
+ LaTeX kernel is activated (“latex-pdf” mode).
* Version 0.7 ‹2024/07/24›
- Support (officialy) `\setpdfpkresolution`.
* Version 0.6 ‹2022/04/28›
Modified: trunk/Master/texmf-dist/tex/latex/bxpdfver/bxpdfver.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bxpdfver/bxpdfver.sty 2024-08-03 20:28:55 UTC (rev 71966)
+++ trunk/Master/texmf-dist/tex/latex/bxpdfver/bxpdfver.sty 2024-08-03 20:29:03 UTC (rev 71967)
@@ -10,12 +10,8 @@
%% package declaration
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bxpdfver}[2024/07/24 v0.7]
+\ProvidesPackage{bxpdfver}[2024/08/03 v0.8]
\def\bxpv at pkgname{bxpdfver}
-
-%% preparations
-\RequirePackage{ifthen}[]% for \newboolean
-\newif\ifbxpv at ok
\providecommand\bxDebug[1]{}
%--------------------------------------- package options
@@ -124,13 +120,23 @@
\fi
\fi
-%--------------------------------------- helpers
+%--------------------------------------- general
+%% packages
+\RequirePackage{ifthen}[]% for \newboolean
+
+%% variables
+\newif\ifbxpv at ok
+
%% unique tokens
\def\bxpv at end{\bxpv at end@}
\def\bxpv at mt{\bxpv at mt@}
\let\bxpv at mk\noindent
+%% \ifbxpv at read@file at ok
+% Whether or not the last \bxpv at read@file succeeded.
+\newif\ifbxpv at read@file at ok
+
%% \bxpv at csletcs
\def\bxpv at csletcs#1#2{%
\expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname
@@ -187,10 +193,51 @@
\bxpv at csletcs{ifbxpv at defined}{%
if\ifx\ifdefined\@undefined false\else defined\fi}
+%% \bxpv at begin@document at hook
+% The begin-document hook.
+\@onlypreamble\bxpv at begin@document at hook
+\let\bxpv at begin@document at hook\@empty
+\AtBeginDocument{\bxpv at begin@document at hook}
+
+%--------------------------------------- environment check
+
%% \ifbxpv at old@hook at system
\newif\ifbxpv at old@hook at system
\@ifl at t@r\fmtversion{2020/10/01}{}{\bxpv at old@hook at systemtrue}
+%% \ifbxpv at pdfmanagement@ok
+% Whether this package is supporting the LaTeX PDF management
+% of the current kernel.
+% (If the PDF management is active but this switch is off,
+% then this package will switch to no-op mode.)
+\newif\ifbxpv at pdfmanagement@ok
+
+%% check for new PDF management
+\if t\bxpv at ignore@pdfmanagement\else
+ \ifx\IfPDFManagementActiveTF\@undefined\else
+ \IfPDFManagementActiveTF{%
+ \let\bxpv at drv@type=m%
+ \def\bxpv at drv@name{latex-pdf}%
+ \@ifl at t@r\fmtversion{2022/06/01}{%
+ \bxpv at pdfmanagement@oktrue
+ }{}
+ }{}
+ \fi
+\fi
+\ifx m\bxpv at drv@type
+ \ifbxpv at pdfmanagement@ok
+ \bxpv at warn
+ {New PDF management is active.\MessageBreak
+ The driver is set to '\bxpv at drv@name'}%
+ % Here \ExplSyntaxOn should be available.
+ \else
+ \bxpv at warn
+ {New PDF management is active, but\MessageBreak
+ the kernel is too old (before 2022/06/01).\MessageBreak
+ Thus this package will not work}%
+ \fi
+\fi
+
%--------------------------------------- internal dispatchers
% Initially all dispatchers are "unavailable".
@@ -234,24 +281,10 @@
\@onlypreamble\bxpv at cancel@obj at compress
\let\bxpv at cancel@obj at compress\relax
-%% \bxpv at begin@document at hook
-% The begin-document hook.
-\@onlypreamble\bxpv at begin@document at hook
-\let\bxpv at begin@document at hook\@empty
-\AtBeginDocument{\bxpv at begin@document at hook}
\g at addto@macro\bxpv at begin@document at hook{%
\bxpv at check@hyperref % must come first
}
-%% check for new PDF management
-\if t\bxpv at ignore@pdfmanagement\else
- \ifx\IfPDFManagementActiveTF\@undefined\else
- \IfPDFManagementActiveTF{%
- \global\let\bxpv at drv@type=m%
- }{}
- \fi
-\fi
-
%% Redefine internal dispatchers.
\ifx 0\bxpv at drv@type\else %--------
\begingroup
@@ -274,9 +307,31 @@
%% switch
\if m\bxpv at drv@type
- %% when in new PDF management
- \bxpv at warn
- {New PDF management is active}%
+ \ifbxpv at pdfmanagement@ok
+ % Here all l3pdf function is assumed to be available.
+ \gdef\bxpv at check@version{\bxpv at oktrue}
+ \ExplSyntaxOn %!!!!!!
+ \tl_new:N \g__bxpv_org_version
+ \exp_args:NNe \tl_gset:Nn \g__bxpv_org_version { \pdf_version: }
+ \cs_gset:Npn \bxpv at set@version
+ {
+ \token_if_eq_meaning:NNTF \bxpdfverMinorVersion \relax
+ { \pdf_version_gset:n { \g__bxpv_org_version } }
+ {
+ \pdf_version_gset:n
+ {
+ \int_use:N \bxpdfverMajorVersion
+ . \int_use:N \bxpdfverMinorVersion
+ }
+ }
+ }
+ % \pdf_uncompress: does both.
+ \cs_gset:Npn \bxpv at suppress@compress
+ { \pdf_uncompress: }
+ \cs_gset:Npn \bxpv at suppress@obj at compress
+ { \pdf_uncompress: }
+ \ExplSyntaxOff %!!!!!!
+ \fi
\else\ifnum\bxpv at pdfoutput>\z@
%% when in PDF mode
\global\let\bxpv at drv@type=p
@@ -683,7 +738,7 @@
\fi
%% variables
-\let\bxpv at dvipdfmx@known at min\relax
+\let\bxpv at dvipdfmx@known at min\relax % minimum known dviodfmx version
\let\bxpv at C@value\relax
%% \bxpv at C@bits
@@ -765,7 +820,7 @@
% C option value
\ifx\bxpv at C@bits\@empty\else
% When C option is used, its value is automatically OR'ed with
- % the current value, so we need read the config for that.
+ % the current value, so we need not read the config for that.
\def\bxpv at C@value{0}%
\def\do##1{%
\bxpv at rc@bitset{\bxpv at C@value}{##1}%
@@ -792,18 +847,27 @@
}
%% \bxpv at get@dvipdfmx at known@min
+% Gathers the information and sets \bxpv at dvipdfmx@known at min,
+% without actually spawning extractbb.
+% (Called in the begin-document hook.)
\@onlypreamble\bxpv at get@dvipdfmx at known@min
\def\bxpv at get@dvipdfmx at known@min{%
+ % initially no information
\def\bxpv at dvipdfmx@known at min{0}%
+ % l3backend-dvipdfmx of revision 2022-04-10 or later requires
+ % dvipdfmx of version 20201111 or later.
\def\bxpv at tmpa{def}%
\let\bxpv at tmpb\@gobbletwo
\@ifl at aded\bxpv at tmpa{l3backend-dvipdfmx}{%
\def\bxpv at tmpb{\@ifl at ter\bxpv at tmpa{l3backend-dvipdfmx}}%
}{}%
+ % Just in case....
\@ifl at aded\bxpv at tmpa{l3backend-dvips}{%
\def\bxpv at tmpb{\@ifl at ter\bxpv at tmpa{l3backend-dvips}}%
}{}%
\bxpv at tmpb{2022/04/10}{%
+ % Now the version is known to be 20201111 or later.
+ % This information can save much need for spawning extractbb.
\def\bxpv at dvipdfmx@known at min{20201111}%
}{}%
\bxDebug{dvipdfmx-known-min:\bxpv at dvipdfmx@known at min}%
@@ -998,10 +1062,6 @@
\let\bxpv at rf@line\relax % line content
\let\bxpv at rf@cont\relax % continue to read?
-%% \ifbxpv at read@file at ok
-% Whether or not the last \bxpv at read@file succeeded.
-\newboolean{bxpv at read@file at ok}
-
%% \bxpv at read@file{<file-name>}{<line-parser-code>}
% Reads from a text file. The line parser takes as #1 the
% content of each line.
More information about the tex-live-commits
mailing list.