I am defining options using the pgfkeys
command.
\newcommand{\subtitlefont}{}
\pgfkeys{
/titleblock/.is family, /titleblock,
default/.style =
{titlesize = 48, titlelineskip = 52,
subtitlesize = 36, subtitlelineskip = 39, subtitlefont=\itshape,
},
titlesize/.estore in = \titlesize,
titlelineskip/.estore in = \titlelineskip,
subtitlesize/.estore in = \subtitlesize,
subtitlelineskip/.estore in = \subtitlelineskip,
subtitlefont/.add code={}{\subtitlefont},
}
Them I want to use this options in a node font option.
\node[align=left, inner sep=0mm, outer sep=0mm,
font={\fontsize{\subtitlesize}{\subtitlelineskip}\subtitlefont\selectfont},
text=\titleblockcolor,
below= 0.1cm of title.south west, anchor=north west] (subtitle) {
\thesubtitle%
};
The document compiles but the \itshape
is not selected for the subtitle.
What is the best way to define an option that consist in macros that can be passed to a node option?
Complete MWE
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfkeys}
\newcommand{\subtitlefont}{}
\pgfkeys{
/titleblock/.is family, /titleblock,
default/.style =
{
subtitlesize = 36, subtitlelineskip = 39, subtitlefont=\itshape,
},
subtitlesize/.estore in = \subtitlesize,
subtitlelineskip/.estore in = \subtitlelineskip,
subtitlefont/.add code={}{\subtitlefont},
}
\newcommand{\titleblock}[1][]{%
\pgfkeys{/titleblock, default, #1}%
\begin{tikzpicture}
\node[align=left, inner sep=0mm, outer sep=0mm,
font={\fontsize{\subtitlesize}{\subtitlelineskip}\subtitlefont\selectfont},
text=black] (subtitle) {A nice title};
\end{tikzpicture}
}
\begin{document}
\titleblock
\end{document}
/.estore
them.subtitlefont/.store in=\subtitlefont,
and\usepackage{lmodern}
.estore in
. That didn't work, butstore in
is working. If you make the comment an asnwer I can select it.