4

I have been using LaTeX for some years now, but I've only recently noticed its scripting features. Although, I find it hard to grasp many of the concepts. For example, I want to have a command \docTitle{My Paper Title} which I can call and then this will produce some variable that I can use in my .sty template file.

So in my .tex file, I will call \docTitle{My Paper Title} and then the .sty file should somehow call \title{\docTitle}. How to do this?

6

That is exactly what the standard \title does, it just stores its argument in \@title however

\newcommand\mytitle{}
\newcommand\docTitle[1]{\renewcommand\mytitle{#1}}

..

\docTitle{My Paper Title} 

will initialise an internal macro \mytitle to empty and then define it as My Paper Title

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.