Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 6 down vote accepted

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

share|improve this answer
    
Worked, thanks! –  Viktor Jan 29 '13 at 21:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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