1 % Generate XMP metadata file (*.xmpdata) from thesis metadata
2 % The format of the xmpdata file is described in the documentation
3 % of the "pdfx" LaTeX package.
6 % Define \percenthack macro that expands to a literal "%" character.
7 % (We can use neither \char\`% nor \% as they are interpreted by TeX's
8 % main processor which is too late for our purposes.)
10 \global\edef\percenthack{%}
14 % Override some macros
16 \def\sep{\string\sep\space}
20 % It is tempting to use LaTeX's filecontents environment, but it does not
21 % expand macros. We need to dive deeper...
23 \immediate\openout\xmp=\jobname.xmpdata
24 \immediate\write\xmp{\percenthack\space Generated automatically from metadata.tex, please don't edit here.}
25 \def\xmpitem#1#2{\immediate\write\xmp{\string#1{#2}}}
26 \xmpitem\Author\ThesisAuthorXMP
27 \xmpitem\Title\ThesisTitleXMP
28 \xmpitem\Keywords\ThesisKeywordsXMP
29 \xmpitem\Subject\AbstractXMP
30 \xmpitem\Publisher{Charles University}
31 \immediate\closeout\xmp