2

I try add a figure in the titlepage

\begin{titlepage}
    \begin{center}
        \begin{figure}[h]
                \includegraphics[scale=0.15]{images/logo.jpg}
        \end{figure}                                                                                                                        
        Univ...\\
        fac ... 
    \end{center}
    \begin{center}
        {\large Title}\\
    \end{center}
\end{titlepage}

but text [univ...] is down of figure

the idea is get some similar to this

[figure][univ ...]

[title]
Moriambar
  • 11,466
JuanPablo
  • 2,689

2 Answers2

4

Don't use a figure but only \includegraphics:

\begin{titlepage}
  \raisebox{\dimexpr\ht\strutbox-\height\relax}{\includegraphics[width=.2\linewidth]{images/logo}}\hfill
  \begin{minipage}[t]{.79\linewidth}
    Univers\dots
  \end{minipage}
  \vskip 2\baselineskip
  {\Large Titel\par}
\end{titlepage}

Here, if top aligned the text and the image, because using multi line text this is common and mostly asked. If you want the text beside the image be vertical centered to the image, you may use one more minipage and adjustes vertical alignment options:

\documentclass{article}
\usepackage[demo]{graphicx}% remove option demo if you have images/logo

\begin{document}
\begin{titlepage}
  \begin{minipage}[c]{.2\linewidth}
    \includegraphics[width=\linewidth]{images/logo}
  \end{minipage}\hfill
  \begin{minipage}[c]{.7\linewidth}
    Univers\dots\\
    at somewhere\\
    under controll of someone
  \end{minipage}

  \vspace{2\baselineskip}
  \begin{center}
    \Large Titel
  \end{center}
\end{titlepage}

\end{document}

Here I've used a horizontal centered title, to show more alternatives.

Alternative you may simply change vertikal alignment of images changing the first argument of \raisebox and the alignment option of the minipage with the text.

Another solution would be to use package adjustbox to add the vertical alignment option valign to the \includegraphics options. See the excellent manual of package adjustbox for more information. Some lines below you may even find an example of using the package.

One more alternative: If you are using a KOMA-Script class like scrartcl, it's very easy to do it, using \titlehead:

\documentclass{scrartcl}
\usepackage[demo]{graphicx}% remove option demo if you have images/logo
\begin{document}
\titlehead{%
  \raisebox{\dimexpr\ht\strutbox-\height\relax}{\includegraphics[width=.2\linewidth]{images/logo}}\hfill
  \begin{minipage}[t]{.78\linewidth}\raggedright
    Univers\dots\\
    at here\\
    with there
  \end{minipage}
}
\title{Title}
\author{Author}
\maketitle
\end{document}

And if you don't use a KOMA-Script class but like that title, you may install package titlepage (link destination in German!).

The \raisebox in these examples is used to move the baseline of the graphics from the bottom to almost the top of the graphics. An alternative solution for this would be using package adjustbox and add option valign=t to \includegraphics, if your adjustbox is up to date:

\documentclass{scrartcl}
\usepackage[demo]{graphicx}% remove option demo if you have images/logo
\usepackage[export]{adjustbox}
\begin{document}
\titlehead{%
  \includegraphics[width=.2\linewidth,valign=t]{images/logo}\hfill
  \begin{minipage}[t]{.78\linewidth}\raggedright
    Univers\dots\\
    at here\\
    with there
  \end{minipage}
}
\title{Title}
\author{Author}
\maketitle
\end{document}

If you want the titles of the KOMA-Script classes with, e.g., a standard class and installation of package titlepage is to difficult, you may try package scrextend. This package is part of KOMA-Script, which may be installed via package manager of almost every TeX distribution and often is already installed.

Here's the example above with standard class article but KOMA-Script title:

\documentclass{article}
\usepackage[extendedfeature=title]{scrextend}
\usepackage[demo]{graphicx}% remove option demo if you have images/logo

\begin{document}
\titlehead{%
  \begin{minipage}[c]{.2\linewidth}
    \includegraphics[width=\linewidth]{images/logo}
  \end{minipage}\hfill
  \begin{minipage}[c]{.7\linewidth}
    Univers\dots\\
    at somewhere\\
    under controll of someone
  \end{minipage}
}
\title{Title}
\author{Author}
\maketitle

\end{document}

To show one more alternative, I've changed the vertical alignment of image text beside the image:

Visualization of the example of Standard class with KOMA-Script title

David Carlisle
  • 757,742
Schweinebacke
  • 26,336
  • 2
    You can do it simpler: \usepackage[export]{adjustbox} and then \includegraphics[width=.2\linewidth,valign=t]{images/logo}. – Martin Scharrer Nov 07 '11 at 15:35
  • Simpler? Other. – Schweinebacke Nov 07 '11 at 15:55
  • Well, you save yourself a \raisebox and a calculation. valign=t does basically the exact same thing as the \raisebox you have it. – Martin Scharrer Nov 07 '11 at 16:32
  • Yes, but what's simpler? To install the newest release of a package and remember it with all it's options or to use a well known LaTeX kernel macro? Never the less: I've voted for your comment, added your suggestion already to my answer and updated TeX Live at my (very old and slow) notebook. – Schweinebacke Nov 07 '11 at 17:02
  • 1
    It's simpler when you already have it installed and know about it :-) I wasn't saying your original code is bad or anything, or that you had to edit it. I just wanted to point out that there is a simpler solution for it now. Many beginners won't know about \raisebox or how to exactly calculate the correct shift. Using a package which provides a simple key for that is in fact simpler. That's all. – Martin Scharrer Nov 07 '11 at 17:24
  • @Schweinebacke 1) when I use \raisebox the top of image is distorsionate. 2) with the text in {minipage}[t]{.78\linewidth} never is centered (I change the .78 to other values) – JuanPablo Nov 08 '11 at 00:21
  • @Martin Scharrer: I've tried to use valign=m to center a image using vadjustbox. But this results in a -.5 at the output instead changed vertical alignment. So I've used one more minipage to vertically center image and text. Please have look. – Schweinebacke Nov 08 '11 at 08:18
  • @JuanPablo: Should it be centered vertical or horizontal. I've added examples with vertical centering to my answer. Horizontal centering is more simple: Add \centering after the begin of the minipage but before the text. – Schweinebacke Nov 08 '11 at 08:24
  • valign=m does works fine with current version. Which version are you using? – Martin Scharrer Nov 08 '11 at 09:08
  • @Martin Scharrer: 2011/10/30 v0.7, the version from my new TeX Live installation yesterday. If I simply change the valign=t to valign=m at my example above, I get the described wrong result. Hm, and know even \documentclass{article}\usepackage[export]{adjustbox}\begin{document}\includegraphics[valign=top]{tost}\end{document} results in ! Illegal unit of measure (pt inserted). after <tost.pdf, id=1, 597.50829pt x 845.0471pt> <use tost.pdf>. Using additional \adjustbox instead of option to \includegraphics does work. – Schweinebacke Nov 08 '11 at 10:06
  • @Martin Scharrer: Sorry not valign=top but valign=t results in the error. I'll ask my good friend Markus. Maybe he`ll find the problem ... – Schweinebacke Nov 08 '11 at 10:14
  • @Schweinebacke: I fixed that now in the develop version. There was an issue that math expressions aren't handled correctly when \includegraphics is used directly. There is also \adjustimage{<keys>}{<image>} which can be used instead of \adjustbox{<keys>}{\includegraphics{<image>}}. – Martin Scharrer Nov 08 '11 at 20:25
-1

I solved with \vspace

\begin{titlepage}
    \includegraphics[scale=0.15]{images/logo.jpg}    
    \vspace{-2cm}
    \begin{center}
        Univer...\\
        fac ...
    \end{center}
    \vspace{4cm}                                                                                                                            
    \begin{center}
        {\large Title}\\
    \end{center}
\end{titlepage}
Moriambar
  • 11,466
JuanPablo
  • 2,689