I'm creating a style file to use as a template for submissions to a specific journal. That journal requires a short title in the header. I could easily hard-code such a short title in the style file itself, following the answer to Page header alternatively author name and short title, but that's clearly not a good solution in this case, as I would need to change the template .sty file for every document I write. Any suggestions how I can do this? Dummy lines with \shorttitle are commented out in the MWE below.

%% My package starts here
    \fancyhead[R]{\thetitle\ \thepage} % Instead of this
%   \fancyhead[R]{\theshorttitle\ \thepage} % do something like this
%% And ends here

\title{This is my long title}
%\shorttitle{This is my short title} % This short title should not be printed here - only in the header
  • How about using a key-value interface for your command/style file?
    – user31729
    Apr 23, 2014 at 15:14
  • @ChristianHupfer I have no idea what that means.
    – Sverre
    Apr 23, 2014 at 15:15
  • Something like \usepackage[shorttitle={Yet another sophisticated Title]{mystyle} as class/style option, e.g. created with xkeyval package?
    – user31729
    Apr 23, 2014 at 15:18
  • @ChristianHupfer Still way over my head :)
    – Sverre
    Apr 23, 2014 at 15:18

2 Answers 2


It seems you can do what you want by defining a command in the .sty such as

% define \theshorttitle to what is given

You can then use \@shorttitle in the .sty file in place of where you need it (e.g. defining the header; just use \@shorttitle instead of \theshorttitle). You can set the short title from your main document as you suggest, with

\shorttitle{This is my short title}

Hope this helps.

  • Usually, commands beginning with \the... indicate that they are purposed counter output formatting, not for titles itself. And the usage of \def is not necessary here where the safer \newcommand or \renewcommand would suffice.
    – user31729
    Apr 23, 2014 at 15:12
  • @ChristianHupfer If phfaist's suggestion is essentially correct, though, please edit the answer to reflect your objections.
    – Sverre
    Apr 23, 2014 at 15:17
  • @Sverre: They are essentially correct, I wanted to indicate rather a matter of style, not more or less.
    – user31729
    Apr 23, 2014 at 15:19
  • 1
    @ChristianHupfer I understood that. Yet, please edit his answer so that it ends up being a suggestion I (and others who read this) can plug into a preamble or .sty file.
    – Sverre
    Apr 23, 2014 at 15:20
  • @Sverre: I could (possible) edit his answer, but this is not my task.
    – user31729
    Apr 23, 2014 at 15:21

In the amsart class, the command \title has an optional parameter which does exactly that:

\title[This is my short title]{This is my long title}

Maybe copy their implementation?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .