-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxmp.tex
32 lines (29 loc) · 1.01 KB
/
xmp.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
% Generate XMP metadata file (*.xmpdata) from thesis metadata
% The format of the xmpdata file is described in the documentation
% of the "pdfx" LaTeX package.
{
% Define \percenthack macro that expands to a literal "%" character.
% (We can use neither \char\`% nor \% as they are interpreted by TeX's
% main processor which is too late for our purposes.)
\catcode`\%=12
\global\edef\percenthack{%}
}
{
% Override some macros
\def\xxx#1{#1}
\def\sep{\string\sep\space}
\let~=\space
% Generate *.xmpdata
% It is tempting to use LaTeX's filecontents environment, but it does not
% expand macros. We need to dive deeper...
\newwrite\xmp
\immediate\openout\xmp=\jobname.xmpdata
\immediate\write\xmp{\percenthack\space Generated automatically from metadata.tex, please don't edit here.}
\def\xmpitem#1#2{\immediate\write\xmp{\string#1{#2}}}
\xmpitem\Author\ThesisAuthorXMP
\xmpitem\Title\ThesisTitleXMP
\xmpitem\Keywords\ThesisKeywordsXMP
\xmpitem\Subject\AbstractXMP
\xmpitem\Publisher{Charles University}
\immediate\closeout\xmp
}