0

Previously I've asked a very similar question to the question I am currently trying to ask. Actually, this question can be thought of as an extension of my previous question.

I am looking for a way to include my company's logo on the first page of a PDF R Markdown output. As stated in the previous question, I've looked for answers online, but most of the solutions resulted in either the logo being on all the pages (not just the first) or in some redundant elements (chapter titles, horizontal lines below them etc.) being added to every page. This has led me to ask the previous question - how to include the logo only at the first page, with no additional elements besides the logo.

I got my answer, which satisfied the criteria that I had posted (for details of the answer, please see the previous post). However, the problem is that if my Markdown doc contains the title, author or some other fields, the logo appears below them, whereas I want it to appear above those fields in the header.

To summarize, my question is: How to print a logo in the Markdown PDF document which satisfies the following criteria:

  • Appears only on the first page
  • Does not result with additional unwanted elements (chapter titles etc.)
  • Appears above the title and all other fields (e.g. author) in the header

Many thanks!

Waylan
  • 37,164
  • 12
  • 83
  • 109
J. Doe
  • 1,544
  • 1
  • 11
  • 26

1 Answers1

2

I was the one that originally answered your first question.

\begin{center}
\includegraphics[width=7cm]{logo.jpg} 
\end{center}

I currently use the code like this after the R Setup and the logo is centered over the title. Unless you mean you want your logo at the extreme top of the page it should work.

You could also use something along those lines if you want to add the title, author and more under the logo :

\title{%
\includegraphics[width=0.1\textwidth]{files/image.jpg}~ 
\\[1cm]
Title
\\more text 
}
\author{Some.Name
\\ where}
\date{August 27, 2019}
\maketitle

EDIT : If you want to have your table of contents under all of this simply add the following code under the previous code :

\pagebreak

\tableofcontents

\pagebreak

\pagebreak will skip a page (the one with the title, logo, author...).

\tableofcontents create/put your table of contents here (you can skip another page after).

Gainz
  • 1,721
  • 9
  • 24
  • Hi, long time no hear! Thank you for your help again! I am using the second chunk of code that you have posted since I need my logo to appear at the extreme top. The logo is now above the title, author and other fields, however, the table of contents still appears above the logo. I would really greatly appreciate it if you have anything on your mind that can help me solve this. – J. Doe Aug 28 '19 at 05:33
  • @J.Doe Hi, see my edited answer! Tell me if its work for you (the code run fine for me). – Gainz Aug 28 '19 at 12:37