summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pdfx/pdfx.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-03-11 22:01:25 +0000
committerKarl Berry <karl@freefriends.org>2019-03-11 22:01:25 +0000
commit4e23992233ebab05b200a616b19c4347bf2b8ce9 (patch)
tree2bab86271542b70fe5224d0de3792f1351822759 /Master/texmf-dist/tex/latex/pdfx/pdfx.sty
parent0d1fe251af3bfe4a6727482ebb290910f43e4e00 (diff)
pdfx (11mar19)
git-svn-id: svn://tug.org/texlive/trunk@50338 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pdfx/pdfx.sty')
-rw-r--r--Master/texmf-dist/tex/latex/pdfx/pdfx.sty127
1 files changed, 93 insertions, 34 deletions
diff --git a/Master/texmf-dist/tex/latex/pdfx/pdfx.sty b/Master/texmf-dist/tex/latex/pdfx/pdfx.sty
index 2f3f578de01..00b7dcc0f5e 100644
--- a/Master/texmf-dist/tex/latex/pdfx/pdfx.sty
+++ b/Master/texmf-dist/tex/latex/pdfx/pdfx.sty
@@ -6,7 +6,7 @@
%%
%% pdfx.dtx (with options: `package')
%%
-%% Copyright (c) 2018, CV Radhakrishnan <cvr@river-valley.org>,
+%% Copyright (c) 2019, CV Radhakrishnan <cvr@river-valley.org>,
%% Han The Thanh <thanh@river-valley.org>,
%% Ross Moore <ross.moore@mq.edu.au>,
%% Peter Selinger <selinger@mathstat.dal.ca>
@@ -31,7 +31,7 @@
}{}%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{pdfx}
- [2018/12/22 v1.6.1 PDF/X and PDF/A support (CVR/HTH/RRM/PS)]
+ [2019/02/27 v1.6.3 PDF/X and PDF/A support (CVR/HTH/RRM/PS)]
\newif\ifpdfx@noBOM \pdfx@noBOMfalse % use a BOM in the XMP packet
\newif\ifpdfx@x \pdfx@xfalse % PDF/X mode
@@ -40,6 +40,7 @@
\newif\ifpdfx@vt \pdfx@vtfalse % PDF/VT mode, extension of PDF/X
\newif\ifno@iccprofile % used with PDF/X-4p and PDF/X-5pg
\newif\ifpdfx@noerr % error messages become just warnings
+\newif\ifpdfx@omitcharset % used with pdfomitcharset primitive
\DeclareOption{noerr}{\pdfx@noerrtrue}
@@ -67,25 +68,37 @@
{, else continue to build a non-valid document}%
}
+%% support pdfomitcharset primitive, added to pdfTeX in 2019
+\DeclareOption{nocharset}{\pdfx@omitcharsettrue}
+\DeclareOption{usecharset}{\pdfx@omitcharsetfalse}
+
%% PDF/A options
%% default is to create PDF/A-1b
%% options can change this for PDF/X or higher levels of PDF/A
\DeclareOption{a-1a}{\global\pdfx@xfalse\def\xmp@Part{1}%
- \def\xmp@Conformance{A}\def\xmp@ReleaseDate{2005}}
+ \def\xmp@Conformance{A}\def\xmp@ReleaseDate{2005}%
+ \pdfx@omitcharsetfalse}
\DeclareOption{a-1b}{\global\pdfx@xfalse\def\xmp@Part{1}%
- \def\xmp@Conformance{B}\def\xmp@ReleaseDate{2005}}
+ \def\xmp@Conformance{B}\def\xmp@ReleaseDate{2005}%
+ \pdfx@omitcharsetfalse}
\DeclareOption{a-2a}{\global\pdfx@xfalse\def\xmp@Part{2}%
- \def\xmp@Conformance{A}\def\xmp@ReleaseDate{2010}}
+ \def\xmp@Conformance{A}\def\xmp@ReleaseDate{2010}%
+ \pdfx@omitcharsettrue}
\DeclareOption{a-2b}{\global\pdfx@xfalse\def\xmp@Part{2}%
- \def\xmp@Conformance{B}\def\xmp@ReleaseDate{2010}}
+ \def\xmp@Conformance{B}\def\xmp@ReleaseDate{2010}%
+ \pdfx@omitcharsettrue}
\DeclareOption{a-2u}{\global\pdfx@xfalse\def\xmp@Part{2}%
- \def\xmp@Conformance{U}\def\xmp@ReleaseDate{2010}}
+ \def\xmp@Conformance{U}\def\xmp@ReleaseDate{2010}%
+ \pdfx@omitcharsettrue}
\DeclareOption{a-3a}{\global\pdfx@xfalse\def\xmp@Part{3}%
- \def\xmp@Conformance{A}\def\xmp@ReleaseDate{2012}}
+ \def\xmp@Conformance{A}\def\xmp@ReleaseDate{2012}%
+ \pdfx@omitcharsettrue}
\DeclareOption{a-3b}{\global\pdfx@xfalse\def\xmp@Part{3}%
- \def\xmp@Conformance{B}\def\xmp@ReleaseDate{2012}}
+ \def\xmp@Conformance{B}\def\xmp@ReleaseDate{2012}%
+ \pdfx@omitcharsettrue}
\DeclareOption{a-3u}{\global\pdfx@xfalse\def\xmp@Part{3}%
- \def\xmp@Conformance{U}\def\xmp@ReleaseDate{2012}}
+ \def\xmp@Conformance{U}\def\xmp@ReleaseDate{2012}%
+ \pdfx@omitcharsettrue}
%%
%% PDF/X options
%% comments added, using
@@ -345,6 +358,17 @@
\pdfresetpageorigin=0
\fi
+\expandafter\ifx\csname pdfomitcharset\endcsname\relax\else
+ \ifpdfx@omitcharset
+ \pdfomitcharset = 1 %
+ %% do not create /Charset listings of font glyphs;
+ %% optional for PDF/A-2,3 and PDF 2.x
+ \else
+ \pdfomitcharset = 0 %
+ %% create the /Charset listings of font glyphs, required with PDF/A-1
+ \fi
+\fi
+
\newif\ifpdfx@nopdfinfo
\ifmathxmp\pdfx@nopdfinfotrue
\else
@@ -533,26 +557,31 @@
\expandafter\ifx\csname inputencodingname\endcsname\relax
\else
\def\pdfx@restoreencoding#1{%
- \@tempcnta=128
- \loop
- \catcode\@tempcnta=13
- \advance\@tempcnta\@ne
- \ifnum\@tempcnta<256
- \repeat
+ \@tempcnta=128
+ \loop
+ \catcode\@tempcnta=13
+ \advance\@tempcnta\@ne
+ \ifnum\@tempcnta<256
+ \repeat
\inputencoding{#1}%
+ \let\LastDeclaredEncoding\pdfx@LastDeclaredEncoding
+ \let\DeclareFontEncoding@\pdfx@DeclareFontEncoding@
+ \let\DeclareUnicodeCharacter\pdfx@DeclareUnicodeCharacter
}%
\AtEndOfPackage{\pdfx@restoreencoding\pdfx@inputencodingname}%
\let\pdfx@inputencodingname\inputencodingname
- \let\pdfx@DeclareUnicodeCharacter\DeclareUnicodeCharacter
+ \global\let\pdfx@DeclareUnicodeCharacter\DeclareUnicodeCharacter
+ \global\let\pdfx@DeclareFontEncoding@\DeclareFontEncoding@
\UseRawInputEncoding
\fi
\InputIfFileExists{\pdfx@encodingfile}{}{}
\expandafter\ifx\csname pdfx@inputencodingname\endcsname\relax
\else
\let\inputencodingname\pdfx@inputencodingname
- \let\DeclareUnicodeCharacter\pdfx@DeclareUnicodeCharacter
- \let\DeclareFontEncoding@\DeclareFontEncoding@saved
- \inputencoding{\inputencodingname}%
+%% \global\let\DeclareUnicodeCharacter\pdfx@DeclareUnicodeCharacter
+%% \global\let\DeclareFontEncoding@\DeclareFontEncoding@saved
+ \global\let\pdfx@LastDeclaredEncoding\LastDeclaredEncoding
+ \expandafter\inputencoding\expandafter{\inputencodingname}%
\fi
%%----------------------------------------------------------------------
@@ -1667,7 +1696,13 @@
}%
\expandafter\pdfx@tryoldprofilesfalse
\fi
-}{\pdfx@tryoldprofilestrue}
+}{%
+ \PackageWarning{pdfx}{%
+ The 'colorprofiles' package is not installed correctly.^^J
+ File 'colorprofiles.tex' is missing. Proceeding without it.
+ }%
+ \pdfx@tryoldprofilestrue
+}
{\catcode`\| 14 \catcode`\% 12 \catcode`\_ 12 \catcode`\: 12
\catcode`\. 12 \catcode`\- 12 \catcode`\/ 12
@@ -2351,14 +2386,15 @@
\expandafter\ifx\expandafter\relax\xmp@Subject\relax\else
\pdfx@ConvertUTFtoBE{\pdfx@pdfSubject}{\xmp@Subject}%
\fi
-\else %% pdfx@nopdfinfotrue
+\else %% pdfx@nopdfinfofalse
\expandafter\ifx\expandafter\relax\xmp@Title\relax\else
\ifluatex
\pdfx@ConvertUTFtoBE\pdfx@pdfTitle\xmp@Title
\else\ifxetex
\pdfx@ConvertUTFtoBE\pdfx@pdfTitle\xmp@Title
\else
- \pdfx@GeneratePdfString\pdfx@pdfTitle\xmp@Title
+%% \pdfx@GeneratePdfString\pdfx@pdfTitle\xmp@Title % why does this fail ???
+ \pdfx@ConvertUTFtoBE{\pdfx@pdfTitle}{\xmp@Title}% ??? RRM 2019-02-17
\fi\fi
\fi
\expandafter\ifx\expandafter\relax\xmp@Subject\relax\else
@@ -2367,7 +2403,8 @@
\else\ifxetex
\pdfx@ConvertUTFtoBE\pdfx@pdfSubject\xmp@Subject
\else
- \pdfx@GeneratePdfString\pdfx@pdfSubject\xmp@Subject
+%% \pdfx@GeneratePdfString\pdfx@pdfSubject\xmp@Subject % why does this fail ???
+ \pdfx@ConvertUTFtoBE{\pdfx@pdfSubject}{\xmp@Subject}% 2019-02-17
\fi\fi
\fi
\fi % end of \ifpdfx@nopdfinfo
@@ -2436,6 +2473,23 @@
\egroup
\spacefactor\accent@spacefactor
}
+%% same for named accents in math-mode
+\def\pdfx@mathaccentV#1#2#3#4#5{%
+ #5{\mathsurround=\z@\relax
+ \everymath{}%
+ \mathchoice
+ {\setbox\z@\hbox{$\displaystyle #5$}\kern-\wd\z@}%
+ {\setbox\z@\hbox{$\textstyle #5$}\kern-\wd\z@}%
+ {\setbox\z@\hbox{$\scriptstyle #5$}\kern-\wd\z@}%
+ {\setbox\z@\hbox{$\scriptscriptstyle #5$}\kern-\wd\z@}%
+ }%
+ \AMS@mathaccentV{#1}{#2}{#3}{#4}{\phantom{#5}}%
+}
+\AtBeginDocument{%
+ \@ifpackageloaded{amsmath}{%
+ \let\AMS@mathaccentV\mathaccentV
+ \let\mathaccentV\pdfx@mathaccentV}%
+}%
%% How to support XeTeX here ?
%%%%% adjust accent characters to the Unicode Combining variant %%%%
@@ -2479,25 +2533,30 @@
\pdfglyphtounicode{space_uni034D}{034D}%
}
-\AtBeginDocument{%
+\def\pdfx@check@accents{%
\ifx\add@accent\LTX@add@accent
\let\add@accent\PDFX@add@accent
\else
\expandafter\ifx\csname MT@orig@add@accent\endcsname\relax
- \TPDF@error{another package has already patched \string\add@accent }%
- \else
+ \@ifpackageloaded{mmap}{}{%
+ \pdfx@ErrorWarning{another package has patched \string\add@accent }%
+ {Hit <return> to continue}{}{}}%
+ \else
\expandafter\let\csname MT@orig@add@accent\endcsname\PDFX@add@accent
\fi\fi
\ifxetex
\else
\PDFX@combiningchars@unicode
- \@ifpackageloaded{newtxmath}{%
- \pdfglyphtounicode{vec}{20D7}%
- \pdfglyphtounicode{rvec}{20D6}%
- \pdfglyphtounicode{lrvec}{20E1}%
- }{}%
+%% this is now handled by glyphtounicode-ntx.tex
+%% \@ifpackageloaded{newtxmath}{%
+%% \pdfglyphtounicode{vec}{20D7}%
+%% \pdfglyphtounicode{rvec}{20D6}%
+%% \pdfglyphtounicode{lrvec}{20E1}%
+%% }{}%
\fi % end of \ifxetex
+ \let\pdfx@check@accents\unDefiNeD
}
+\AtBeginDocument{\pdfx@check@accents}
%% suppress hyperlinks when generating PDF/X
\def\pdfx@linkfile@pdfX#1#2#3{%
@@ -2863,7 +2922,7 @@
%
% this will have been done already for PDF/X
%
- \PassOptionsToPackage{xcolor}{cmyk,hyperref}
+ \PassOptionsToPackage{cmyk,hyperref}{xcolor}
\def\pdfx@handlexcolor{\def\@@mod{cmyk}\selectcolormodel{cmyk}%
\convertcolorsUtrue\convertcolorsDtrue}
\ifpdfx@x
@@ -2887,7 +2946,7 @@
%% }
\fi
\else
- \PassOptionsToPackage{xcolor}{rgb,hyperref}
+ \PassOptionsToPackage{rgb,hyperref}{xcolor}
\def\pdfx@handlexcolor{\def\@@mod{rgb}\selectcolormodel{rgb}%
\convertcolorsUtrue\convertcolorsDtrue}
\fi