Skip to content

Commit 553ab81

Browse files
committed
hyperref,hyperxmp: support all documented \hypersetup options
1 parent cc12061 commit 553ab81

File tree

4 files changed

+63
-15
lines changed

4 files changed

+63
-15
lines changed

lib/LaTeXML/Engine/Base_Schema.pool.ltxml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ RequireResource('LaTeXML.css');
8181
"ma" => "http://www.w3.org/ns/ma-ont#",
8282
"og" => "http://ogp.me/ns#",
8383
"owl" => "http://www.w3.org/2002/07/owl#",
84+
"prism" => "http://prismstandard.org/namespaces/basic/3.0/",
8485
"rdf" => "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
8586
"rdfa" => "http://www.w3.org/ns/rdfa#",
8687
"rdfs" => "http://www.w3.org/2000/01/rdf-schema#",

lib/LaTeXML/Package/hyperref.sty.ltxml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,18 @@ foreach my $option ( # 3.1 General Options
8787

8888
# \hypersetup{keyvals} configures various parameters,
8989
# for each pdf keyword, provide [property,(content|resource),datatype,langsupport]
90-
our %pdfkey_property = (
91-
baseurl => '', # xmp:BaseURL ??
92-
pdfauthor => ['dcterms:creator', 'content', undef, 1],
93-
pdfkeywords => ['dcterms:subject', 'content'], # & pdf:Keywords
94-
pdflang => ['dcterms:language', 'content'],
95-
pdfproducer => '', # pdf:Producer & xmp:CreatorTool
96-
pdfsubject => ['dcterms:subject', 'content'],
97-
pdftitle => ['dcterms:title', 'content', undef, 1],
98-
# Include hyperxmp's keywords, as well.
99-
pdfauthortitle => '', # photoshop:AuthorsPosition
100-
pdfcaptionwriter => '', # photoshop:CaptionWriter !?!?!?
101-
pdfcopyright => ['dcterms:rights', 'content', undef, 1], # & xmpRights:Marked
102-
pdflicenseurl => ['cc:licence', 'resource'], # xmpRights:WebStatement
103-
pdfmetalang => '', # dcterms:language ??
90+
# %pdfkey_property may have already been populated by hyperxmp
91+
our %pdfkey_property = (%pdfkey_property,
92+
baseurl => '', # xmp:BaseURL ??
93+
pdfauthor => ['dcterms:creator', 'content', undef, 1],
94+
pdfcreationdate => '', # xmp:CreateDate
95+
pdfkeywords => ['dcterms:subject', 'content'], # & pdf:Keywords
96+
pdflang => ['dcterms:language', 'content'],
97+
pdfmoddate => '', # xmp:ModifyDate
98+
pdfproducer => '', # pdf:Producer & xmp:CreatorTool
99+
pdfsubject => ['dcterms:description', 'content', undef, 1],
100+
pdftitle => ['dcterms:title', 'content', undef, 1],
101+
pdftrapped => '', # pdf:Trapped
104102
);
105103
# date=>dcterms:date xmp:CreateDate xmp:ModifyDate xmp:MetadataDate ?
106104
# document identifier => xmlMM:DocumentID

lib/LaTeXML/Package/hyperxmp.sty.ltxml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,53 @@ RequirePackage('ifthen');
2020
# Basically, the effects of hyperxmp are already built
2121
# into the LaTeXML binding for hyperref.
2222

23+
# TODO: implement \XMPLangAlt for metadata in different languages
24+
25+
# %pdfkey_property may have already been populated by hyperref
26+
our %pdfkey_property = (%pdfkey_property,
27+
# Include hyperxmp's keywords, as well.
28+
pdfaconformance => '', # pdfaid:conformance
29+
pdfapart => '', # pdfaid:part
30+
pdfauthortitle => '', # photoshop:AuthorsPosition
31+
pdfbookedition => ['prism:bookEdition', 'content', undef, 1],
32+
pdfbytes => ['prism:byteCount', 'content'],
33+
pdfcaptionwriter => '', # photoshop:CaptionWriter
34+
pdfcontactaddress => '', # Iptc4xmpCore:CiAdrExtadr
35+
pdfcontactcity => '', # Iptc4xmpCore:CiAdrCity
36+
pdfcontactcountry => '', # Iptc4xmpCore:CiAdrCtry
37+
pdfcontactemail => '', # Iptc4xmpCore:CiEmailWork
38+
pdfcontactphone => '', # Iptc4xmpCore:CiTelWork
39+
pdfcontactpostcode => '', # Iptc4xmpCore:CiAdrPcode
40+
pdfcontactregion => '', # Iptc4xmpCore:CiAdrRegion
41+
pdfcontacturl => '', # Iptc4xmpCore:CiUrlWork
42+
pdfcopyright => ['dcterms:rights', 'content', undef, 1], # & xmpRights:Marked, xmpRights:WebStatement
43+
pdfdate => ['dcterms:date', 'content'], # (if missing, hyperxmp uses \date -- we delegate the default choice to postprocessing)
44+
pdfdocumentid => '', # xmpMM:DocumentID
45+
pdfdoi => ['prism:doi', 'content'],
46+
pdfeissn => ['prism:eIssn', 'content'],
47+
pdfidentifier => ['dcterms:identifier', 'content'], # (if missing, hyperxmp uses the first non-empty doi, eissn, issn, isbn with prefix info:doi/ or urn:ISS(B|N): -- we delegate the default choice to postprocessing)
48+
pdfinstanceid => '', # xmpMM:InstanceID
49+
pdfisbn => ['prism:isbn', 'content'],
50+
pdfissn => ['prism:issn', 'content'],
51+
pdfissuenum => ['prism:number', 'content'],
52+
pdflicenseurl => ['cc:licence', 'resource'], # xmpRights:WebStatement
53+
pdfmetadate => '', # xmp:MetadataDate
54+
pdfmetalang => '', # the default language of the metadata entries themselves
55+
pdfnumpages => ['prism:pageCount', 'content'], # xmpTPg:NPages
56+
pdfpagerange => ['prism:pageRange', 'content'],
57+
pdfpublication => ['prism:publicationName', 'content', undef, 1],
58+
pdfpublisher => ['dcterms:publisher', 'content'],
59+
pdfpubstatus => '', # jav:journal_article_version
60+
pdfpubtype => ['prism:aggregationType', 'content'],
61+
pdfrendition => '', # xmpMM:RenditionClass
62+
pdfsource => ['dcterms:source', 'content'],
63+
pdfsubtitle => ['prism:subtitle', 'content', undef, 1],
64+
pdftype => ['dcterms:type', 'content'],
65+
pdfuapart => '', # pdfuaid:part
66+
pdfurl => ['prism:url', 'content'],
67+
pdfversionid => '', # xmpMM:VersionID
68+
pdfvolumenum => ['prism:volume', 'content'],
69+
pdfxstandard => '', # {pdfx,pdfxid}:GTS_PDFXVersion
70+
);
71+
2372
1;

t/complex/hypertest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@
5050
<rdf about="" content="Not subject to copyright" property="dcterms:rights"/>
5151
<rdf about="" content="test,hyperref" property="dcterms:subject"/>
5252
<rdf about="" property="cc:licence" resource="http://creativecommons.org/licenses/by/3.0/"/>
53-
<rdf about="" content="Testing LaTeXML’s processing of hyperref metadata" property="dcterms:subject"/>
53+
<rdf about="" content="Testing LaTeXML’s processing of hyperref metadata" property="dcterms:description"/>
5454
<rdf about="" content="Test Hyperref Metadata" property="dcterms:title"/>
5555
</document>

0 commit comments

Comments
 (0)