1

I'd like to write a report in French but without a separate title page. I tried geophysics template that does it very well, but it imposes "abstract" that I didn't manage to convert into "résumé" even if I tried all the hacks that I've found here. If I delete "abstract", I lose title and author. Anyway, I don't need to write an abstract, but it doesn't bother me to do it if there's no other way out, but it should be in French. There's my code of the first page from scratch:

\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}
\pagenumbering{arabic}
\usepackage{subcaption}

\usepackage{subcaption}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}


\begin{document}

\centering
\begin{tabular}{@{}c@{}}
    \includegraphics[scale=0.2]{images/logo1.jpg}
\end{tabular}
    \begin{tabular}{@{}c@{}}
        \includegraphics[scale=0.2]{images/logo2.png}
\end{tabular}

\begin{center}
        {\large FirstInstitution \& SecondInstitution}
\end{center}
\title{Rapport\\ 
"The report title"}
\author{Name}
\maketitle
\tableofcontents

\section{Introduction}


\end{document}

The problem is that logos and institution names are on the first page and the following text turns out to be on the second page. I tried to put the institution names into \institute{} and the logos into \titlegraphic{} as in logo in the first page only, but it doesn't help. I also tried to use \usepackage{titling} as in Title, abstract, and text beginning on same page. It changes nothing.

3
  • There are two approaches. 1) don't use \maketitle. 2) modify \maketitle. In both cases you should look for the definition in article.cls (tex/latex/base). Jan 16 at 16:25
  • Welcome to TeX.SX! If the geophysics template does what you want, include a pointer (if it is part of the TeX distribution, its actual name suffices). It shouldn't be too difficult to remove the abstract or change its label.
    – gernot
    Jan 16 at 17:58
  • @gernot, I'm sorry, I don't understand what do you mean by "include a pointer".
    – imaspol
    Jan 17 at 8:54

2 Answers 2

0

As (slightly incorrect) noted in my comment: use \makeatletter, to be able, to work with the internal variables in your document. Than, use the variables, which are filled by the known \title, \author and date-commands, to define the content of your title block.

\documentclass[english,draft]{article}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
%%% Some useful variables . . .
\title{The Report Title}
\author{Name}
\date{19.\ Januar 2022}

\begin{document}

\makeatletter
\begin{center}
    \Huge Report  \\ 
    \@title\\        
    \vspace{.5cm}       
    {\large \@author}\\
    {\large \@date}
\end{center}
\makeatother

\lipsum[1-3]
\end{document}

This will give:

enter image description here

Ideally, you would also define a new command (before `\begin{document}:

\newcommand{\mymaketitle}{
  \begin{center}
      \Huge Report  \\ 
      \@title\\        
      \vspace{.5cm}       
      {\large \@author}\\
      {\large \@date}
  \end{center}
}

So your document could shrink to this:

\documentclass[english,draft]{article}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
%%% Some useful variables . . .
\makeatletter
\newcommand{\mymaketitle}{
  \begin{center}
      \Huge Report  \\ 
      \@title\\        
      \vspace{.5cm}       
      {\large \@author}\\
      {\large \@date}
  \end{center}
}
\title{The Report Title}
\author{Name}
\date{19.\ Januar 2022}

\begin{document}

\mymaketitle

\lipsum[1-3]
\end{document}

and you even might think of writing your own style file (e.g. specialtitle.sty) and loding it in your documents with \usepackage{specialtitle}.

2
  • thank you for your solution! it works, but I had to add a { after {\mymaketitle} to creat a new command: \newcommand{\mymaketitle}{ \begin{center} \Huge Report \\ \@title\\ \vspace{.5cm} {\large \@author}\\ {\large \@date} \end{center} }
    – imaspol
    Jan 19 at 8:53
  • @imaspol thank you for your comment. I missed a { (two times) at the \newcommand. It must read \newcommand{\mycmd}{...}. I edited my answer to fix that. It now should work. Please blame me, as my emacs usually cares for matching braces and nasty stuff like that. :-)
    – Jan
    Jan 19 at 9:52
0

@John Kormylo, thank you for the idea! I finally used the first approach, which is easier: I didn't use \maketitle and I replaced it by:

\begin{center}
    \Huge Report  \\ 
    "The report title"\\        
    \vspace{.5cm}       
    \large {Name}
\end{center}

I've found it in this template: IMPERIAL COLLEGE template

2
  • Welcome to TeX.SE :-)! I think, what @imaspol meant with "include a pointer" is: when you define \title{} it stores the content of the {} internally in the variable \@title. Same to \author{}. So you could write in your document: \MakeAtLetter \begin{center} \Huge Report \\ \@title \\[5cm] {\large \@author} \end{center}. You'll need \MakeAtLetter or otherwise LaTeX will produce an error on the \@... commands.
    – Jan
    Jan 17 at 9:15
  • @Jan, thank you for your answer. I tried to use your line '\MakeAtLetter \begin{center} \Huge Report \\ \@title \[5cm] {\large \@author} \end{center}', but \MakeAtLetter gives "underfind control sequence" error. '\@title' and '\@author' don't use the title and the author name which I've put into '\title{}' and '\author{}'. If I put the title directly either like this '\@title{Title name}' or '\@Title name', there are no spaces between words.
    – imaspol
    Jan 18 at 14:44

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.