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
17 \def\sep{\string\sep\space}
21 % It is tempting to use LaTeX's filecontents environment, but it does not
22 % expand macros. We need to dive deeper...
24 \immediate\openout\xmp=\jobname.xmpdata
25 \immediate\write\xmp{\percenthack\space Generated automatically from metadata.tex, please don't edit here.}
26 \def\xmpitem#1#2{\immediate\write\xmp{\string#1{#2}}}
27 \xmpitem\Author\ThesisAuthorXMP
28 \xmpitem\Title\ThesisTitleXMP
29 \xmpitem\Keywords\ThesisKeywordsXMP
30 \xmpitem\Subject\AbstractXMP
31 \xmpitem\Publisher{Charles University}
32 \immediate\closeout\xmp