I've set up some pgfkeys
keys and I'm trying to load the settings from an external file. The only way I know in LaTeX to load files is \input
, but it seems to not be the right choice.
\begin{filecontents}{keys.def}
key = Hellò
\end{filecontents}
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{pgfkeys}
\pgfkeys{
/mykeys/key/.initial = {}
}
\pgfqkeys{/mykeys}{
\input{keys.def}
}
\begin{document}
Values: \pgfkeysvalueof{/mykeys/key}
\end{document}
This code fails to compile with awful messages about undefined control sequences.
What's the right way to give the contents of a file to \pgfkeys
?
Note: I've included inputenc
and an accented letter in the MWE because in the real use case, the keys will be localized strings and I need to be sure there are no encoding issues.
\pgfkeys{}
in the file, too?