From the existence of the command \maketitle I believe the title is kept somewhere. So how can I have access to it by a command (for example I want to use it somewhere else). Finding it could be hard because the source code of article isn’t open to public.
Asked
Active
Viewed 48 times
1 Answers
0
I guess you're submitting a paper to some journal that doesn't disclose the code of the document class they'll use to eventually typeset the paper and just provides a generic template.
The problem you have is simple to solve.
\documentclass{generic-publisher-class}
%%% Whatever you need in the preamble
\usepackage{amsmath}
%[...]
%%%
%%% add this for remembering the title
\newcommand{\thisdocumenttitle}{What's the name of this paper?}
\begin{document}
\author{A. Uthor}
\title{\thisdocumenttitle}
\maketitle
This paper is entitled ``\thisdocumenttitle'' and is the
sequel to another paper of mine~\cite{mypreviouspaper}.
\end{document}
egreg
- 1,121,712
documentclass, packages etc,\maketitle's definition is in the public domain within source code. In fact there are questions on here that find and change\maketitlefor thearticleclass so I am not sure what your question is? – JamesT Oct 05 '22 at 12:19\newcommand{\thisdocumenttitle}{The real title goes here}and do\title{\thisdocumenttitle}for typesetting it with\maketitle. You have\thisdocumenttitleavailable whenever you want. – egreg Oct 05 '22 at 12:35