2

I am producing a LaTeX template for our corporate branding. This requires the university logo on the top right of every page, and the address on the bottom right of every page except the title page.

I want to minimise the need for new packages to be installed on the fragmented systems we use. As such I want to avoid answers that have been given on similar questions - I want to avoid eso-pic and fancyhdr.

Is there anyway to do this without loading any new packages(tikz is allowed)?

adunaic
  • 63
  • 1
  • 5
  • 3
    fancyhdr is just one package and it requires only a few commands. –  Jun 02 '16 at 15:45
  • 1
    fancyhdr is indeed the best solution, in my opinion. – Alenanno Jun 02 '16 at 15:48
  • I guess there is a latex macro that runs on each page that I could edit... Not sure what or where though. – adunaic Jun 02 '16 at 19:04
  • 1
    This question might have been marked as a duplicate but the answers given here are not duplicates of the answers to the referenced question. – Peter Wilson Jun 02 '16 at 19:44
  • As I do not want to use new packages such as fancyhdr and eso-pics, I cannot see how it is a duplicate of previous questions which allowed any answer. – adunaic Jun 02 '16 at 19:55
  • @adunaic: Well, you wrote, that you don't want 'new' packages. This is not really clear (although you have changed your question in between :-( ) –  Jun 02 '16 at 20:05
  • @ChristianHupfer: I was trying to clarify this. I only editted the question, as that was my interpretation to the instructions given "please edit this question to explain how it is different".

    When I changed the headings to be a different style / colour I used the \renewcommand\section{@startsection{section} command so that I did not have to load an additional (new) package such as titlesec. I was hoping for a similar solution.

    – adunaic Jun 02 '16 at 20:24
  • You don't want 'new' package but *TikZ* is allowed??!! You can, of course, avoid the need to load a package by simply duplicating its code in your class or package. However, there are obviously excellent reasons not to do this. – cfr Jun 02 '16 at 22:03
  • You could do this, I guess, by creating a new page style using LaTeX's basic facilities for this. It is harder than using a package, obviously, but should be doable. At least, I'm assuming that the logo is available in a font format (postscript type1 or metafont). Otherwise, I don't see how you can do it without additional packages. But I can't really see why TikZ is OK but not its dependencies. – cfr Jun 02 '16 at 22:07
  • I don't understand what you mean by "not its dependencies". I want to minimise the need for new packages, as getting systems to push new packages out is difficult, and I am not sure what packages are there by default - I know tikz is in all the installs that we have. If there is a way to find out what the default or core packages are, that would be great. – adunaic Jun 03 '16 at 08:29

3 Answers3

4

fancyhdr is one of the possibilities to achieve some header/footer content on every (specific) page.

Use fancyhead[R] and fancyfoot[R] for content that should appear on the right of every page in the fancy pagestyle.

Most likely, the headheight value must be changed to the real settings, this depends on the size of the graphics, for example!

The titlepage is by default plain or empty.

\documentclass{article}

\usepackage[headheight=65pt]{geometry}
\usepackage{graphicx}
\usepackage{fancyhdr}

\fancyhf{}
\renewcommand{\headrulewidth}{0pt}

\fancyhead[R]{\includegraphics[scale=0.2]{ente}} % top graphics
\fancyfoot[R]{\begin{tabular}{l}Ministry of Silly Walks\\ Bakerstreet 150 \\Drop-Box London\end{tabular}} % Address box

\pagestyle{fancy}
\usepackage{blindtext}

\author{Ann Elk}
\title{Theory of Brontosaurs}

\begin{document}

\maketitle

\blindtext[10]
\end{document}

Here's the file ente.jpg

enter image description here

  • Thanks, I will consider this one. I was trying to avoid new packages, even if it means the coding the template is harder. I guess fancyhdr is standard enough these days though. – adunaic Jun 02 '16 at 18:58
3

This uses the everypage package, and introduces the macro

\everyxy{<x-page location>}{<y-page location>}{<content>}

The location is measured with respect to the top left corner of the paper.

\documentclass{article}
\usepackage{everypage}
\usepackage{graphicx}
\usepackage{lipsum}
% THESE ARE LaTeX DEFAULTS; CAN CHANGE IF NEEDED.
\def\PageTopMargin{1in}
\def\PageLeftMargin{1in}
\newcommand\everyxy[3]{%
 \AddEverypageHook{\smash{\hspace*{\dimexpr-\PageLeftMargin-\hoffset+#1\relax}%
  \raisebox{\dimexpr\PageTopMargin+\voffset-#2\relax}{#3}}}}
\begin{document}
\lipsum[1-6]
\everyxy{7in}{1.2in}{\includegraphics[height=1in]{example-image-a}}
\everyxy{7in}{10.5in}{\parbox[b]{1in}{XYZ University\\101 S. Main St.\\Anytown, USA}}
\lipsum[7-10]
\end{document}

enter image description here

Here, I invoke it on page 2, so that is where the images begin.

2

As you want to minimise the number of packages please consider the memoir class which has built in support for headers\footers. For example:

\documentclass{memoir}
\usepackage{lipsum}

\makepagestyle{aduanic} % your page style
\makeevenhead{aduanic}{}{}{Your logo} % specify the contents
\makeoddhead{aduanic}{}{}{Your logo}
\makeevenfoot{aduanic}{}{}{Address}
\makeoddfoot{aduanic}{{}{}{Address}

\pagestyle{aduanic} % use the aduanic pagestyle

\begin{document}
\thispagestyle{empty} % empty pagestyle for the title 

TITLE

\clearpage

\lipsum % the text with the aduanic pagestyle

\end{document}
Peter Wilson
  • 28,066
  • Thanks. I was wanting to find a way to do this so that the users can still choose the document class they want to use. Whilst memoir is a great suggestion, it unfortunately does not let the user choose which class they want. – adunaic Jun 02 '16 at 19:00