I want to pass a command as an option, so that the command is applied to the argument, something like
\PrintSomething{opt = \makebox[5cm]{\textbf{\sffamily #1}}}{Hello}
which should produce the word Hello in a box, sffamily, bold.
I don't know how to do it, so here is M(non-W)E
\documentclass{article}
\usepackage{xparse}
\usepackage{pgfkeys}
\begin{document}
\pgfkeys{
/Section/.is family,
/Section,
%
default/.style = {
opt = {},
},
opt = \Format
}
\NewCommandCommand{\PrintSomething}{ m m }{%
\pgfkeys{/Section, default, #1}
\Format{#2}
}
\PrintSomething{opt = \makebox[5cm]{\textbf{\sffamily #1}}}{Hello}
\end{document}