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.
\documentclass{article}
\usepackage{lipsum,filecontents}
\begin{filecontents}{mystyle.sty}
%% My package starts here
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mystyle}
\usepackage{titling}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[R]{\thetitle\ \thepage} % Instead of this
% \fancyhead[R]{\theshorttitle\ \thepage} % do something like this
\endinput
%% And ends here
\end{filecontents}
\usepackage{mystyle}
\begin{document}
\title{This is my long title}
%\shorttitle{This is my short title} % This short title should not be printed here - only in the header
\maketitle
\lipsum[1-6]
\end{document}
\usepackage[shorttitle={Yet another sophisticated Title]{mystyle}as class/style option, e.g. created withxkeyvalpackage? – Apr 23 '14 at 15:18