Quantcast
Viewing all articles
Browse latest Browse all 13

Define variable in a class

I am trying to figure out how to use a variable in a class.

From another question (Macro for Declaring Variables in Class Files) I got started. However, I find myself in need of using four lines or rather unclear code. This is what I have:

\let\@headertitle\relax\def\headertitle#1{\def\@headertitle{#1}}\newcommand{\printheadertitle}{\@headertitle}\printheadertitle{} % This will print the string in the variable

It works, but doesn't look good. I simply want to use \headertitle{string} in my document, and be able to somehow call it (e.g. \headertitle{} within my class. Can I simplify this?


Viewing all articles
Browse latest Browse all 13

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>