我有一些布局,想将其变成可以用动态文本参数化的东西:
\documentclass{article}
\usepackage{tikz}
\definecolor{spotcolor}{cmyk}{.40,0,.70,0}
\begin{document}
\begin{tikzpicture}
\node [ white, fill=spotcolor, rounded corners=4pt, inner sep=4pt, font=\sffamily] at (-1.1in,-.7in){\tiny\uppercase { starter }};
\end{tikzpicture}
\end{document}
但是,当我使用宏制作标签动态文本时......
\documentclass{article}
\usepackage{tikz}
\definecolor{spotcolor}{cmyk}{.40,0,.70,0}
\newcommand{\level}{starter}
\begin{document}
\begin{tikzpicture}
\node [ white, fill=spotcolor, rounded corners=4pt, inner sep=4pt, font=\sffamily] at (-1.1in,-.7in){\tiny\uppercase { \level }};
\end{tikzpicture}
\end{document}
\uppercase 命令似乎没有效果
答案1
使用\MakeUppercase
:
\documentclass{article}
\usepackage{tikz}
\definecolor{spotcolor}{cmyk}{.40,0,.70,0}
\newcommand\level{starter}
\begin{document}
\begin{tikzpicture}
\node [ white, fill=spotcolor, rounded corners=4pt, inner sep=4pt, font=\sffamily] at (-1.1in,-.7in){\tiny\MakeUppercase { \level }};
\end{tikzpicture}
\end{document}