]> mj.ucw.cz Git - diplomky.git/blob - xmp.tex
Gitignore: Update for biblatex
[diplomky.git] / xmp.tex
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.
4
5 {
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.)
9 \catcode`\%=12
10 \global\edef\percenthack{%}
11 }
12
13 {
14 % Override some macros
15 \def\xxx#1{#1}
16 \def\sep{\string\sep\space}
17 \let~=\space
18
19 % Generate *.xmpdata
20 % It is tempting to use LaTeX's filecontents environment, but it does not
21 % expand macros. We need to dive deeper...
22 \newwrite\xmp
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
32 }