Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to put a logo and also a table before a document title. When I add a title, it adds to number of pages and starts the actual document from the next page. I was wondering if there is a way to fix this problem.

Thank you,

I apologize if my MWE is too long, I did not remove any of the packages cause I thought it might have something to do with the packages I use. Thank you

\documentclass[12pt, xcolor=pdftex,x11names,table]{article}

\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{pgf}
\usepackage{geometry}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{natbib}
\usepackage{bm}
\usepackage{booktabs}
\usepackage{microtype}
\usepackage{todonotes}
\usepackage{amsfonts}
\usepackage{footnote}
\usepackage{pdfpages}
\usepackage{setspace}
\usepackage{array}
\usepackage{paralist}
\usepackage{verbatim}
\usepackage{subfig}
\usepackage{csquotes}
\usepackage{multicol}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{pxfonts}
\usepackage{IEEEtrantools}
\usepackage{relsize}
\usepackage{type1cm}
\usepackage[compact,small]{titlesec}
\usepackage[titles,subfigure]{tocloft}
\usepackage[nottoc,notlof,notlot]{tocbibind}
\usepackage{sectsty}
\usepackage{fancyhdr}
\usepackage{url}
\usepackage[pdftex]{hyperref}
\usepackage{bookmark}
\usepackage{comment}
\setcounter{MaxMatrixCols}{10}

\geometry{left=25mm,right=20mm,top=25mm,bottom=25mm}
\geometry{letterpaper} 
\setcounter{secnumdepth}{1}
\clubpenalty = 10000
\widowpenalty = 10000
\onehalfspacing 
\setlength{\parskip}{0ex}

\pagestyle{fancy} 
\lhead{I}
\rhead{}
\lfoot{H}
\cfoot{}
\rfoot{\thepage}
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{1pt}
\hypersetup{ 
pdftitle={F}, 
pdfauthor={G},
bookmarks=true, bookmarksopen=true, pdftoolbar=true, 
pdffitwindow=false,
colorlinks=false,
linkcolor=red, 
citecolor=red,
filecolor=magenta,
urlcolor=black }
%\input{tcilatex}
\title{Test}
\date{}
\begin{document}


\hspace*{-0.35in}%
\begin{tabular}{l}
{%
\includegraphics[
natheight=1.042100in,
natwidth=2.989700in,
height=1.0758in,
]{logo.eps}}%
\end{tabular}
\qquad\qquad\qquad\qquad\quad\quad 
\begin{tabular}{r}
\emph{A} \\ 
\emph{B} \\ 
\emph{C} \\ 
\emph{D}%
\end{tabular}
\title{Test Title}
\maketitle
\end{document}
share|improve this question
1  
Do you really think any of those package are related to the question, please make a minimal example that focusses on the problem that you are asking about, also use demo option or replace includegraphics by a rule so people have a chance of running it locally –  David Carlisle Feb 20 '13 at 22:03
1  
you can test whether the packages are relevant. Just delete packages and if the problem you have is still there leave them out, if removing a package makes the problem come back, that is useful fact that you can include in the question. –  David Carlisle Feb 20 '13 at 22:28

2 Answers 2

up vote 5 down vote accepted

You can use background or tikz (with remember picture and overlay) for this:

An example with tikz

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{lipsum}

\title{Test}
\date{}
\begin{document}
\maketitle
\begin{tikzpicture}[remember picture, overlay]
\node at ($(current page.north west) +(2,-2)$)
{\includegraphics[
width=1in
]{example-image-a}};%
\node at ($(current page.north east) +(-2,-2)$)
{\begin{tabular}{r}
\emph{A} \\
\emph{B} \\
\emph{C} \\
\emph{D}%
\end{tabular}};
\end{tikzpicture}
%
\lipsum
\end{document}

enter image description here

share|improve this answer

The \maketitle command issues a \newpage to ensure that the title appears on the top of a fresh page; somebody may want to have a cover page before it.

So our job is to put the material after this \newpage, which is easy with etoolbox, rather than copying and pasting the complete definition from article.cls and modifying it. The command to patch is actually \@maketitle, that does the typesetting job.

Note that this is just for article.cls and is not guaranteed to work with other classes.

It's also better to store the material in a command, so as to minimize the patching job. Modify at will the amount of negative vertical spacing.

IMPORTANT NOTE: the demo option to graphicx is just for demonstration purpose, don't use it yourself. The only package you need to load (as you already load graphicx) is etoolbox.

\documentclass[12pt]{article}

\usepackage[demo]{graphicx}
\usepackage{etoolbox}

\newcommand{\beforetitle}{%
  \vspace*{-6\baselineskip}
  \noindent\begin{minipage}{\textwidth}
  \begin{tabular}{@{}l@{}}
    \includegraphics[natheight=1.042100in,
      natwidth=2.989700in,height=1.0758in,]{logo.eps}
  \end{tabular}%
  \hspace{10em}%
  \begin{tabular}{r}
  \emph{A} \\ 
  \emph{B} \\ 
  \emph{C} \\ 
  \emph{D}
  \end{tabular}
  \end{minipage}\par
}

\makeatletter
\patchcmd{\@maketitle}
  {\newpage\null}
  {\newpage\beforetitle}
  {}{}
\makeatother

\begin{document}

\title{Test Title}
\author{A. U. Thor}
\date{}
\maketitle

\end{document}

enter image description here


Notes about your preamble:

  • the options xcolor=pdftex,x11names,table don't make sense with the article class; you should do

    \usepackage[x11names,table]{xcolor}
    
  • loading both sectsty and titlesec is wrong; use only one of them.

  • Passing the option pdftex to any package is in general wrong.

  • \usepackage{type1cm} is useless, as you load pxfonts

  • Also setting \clubpenalty=10000 is useless, because LaTeX will restore a different value after the first \section command. If you really want that (and I discourage you from doing it) say

    \makeatletter
    \@clubpenalty=10000 \clubpenalty=10000
    \makeatother
    
share|improve this answer
1  
Woow, this is great! Thank you :) –  N Nik Feb 21 '13 at 0:04
    
Where do the magic -6\baselineskip stem from? –  mafp Feb 21 '13 at 0:45
    
@mafp I just tried a couple of values. –  egreg Feb 21 '13 at 7:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.