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?

1 Answer 1


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



\docTitle{My Paper Title} 

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


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.