2

I want to add a picture a text and I have the following code:

\title{\foreignlanguage{english}{Ackermann's function}}

\date{ }

\begin{document}

\begin{frame}
  \titlepage
 \begin{figure}[h!]
 \central
\includegraphics[scale=0.35]{ackermann.jpg}
\end{figure}


 Name: ...

 Prof.: ...

 Subject: ... 

 University: ... 


\end{frame} 

Can we move the picture more upwards?

Is there such a command?

EDIT:

Does the command

\raisebox{4mm}[0pt][0pt]{ 
\parbox[t]{\textwidth}{\centering\includegraphics[scale=0.35]{ackermann.jpg}\par 
\foreignlanguage{english}{Wilhelm Ackermann,1896-1962}} 
} 

also work for the template "article" instead of the article "beamer" ??

When I write this command it only appears the following:

[scale=0.35]ackermann.jpg

Wilhelm Ackermann,1896-1962

but the picture doesn't appear.

I have written the following commands:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english,greek]{babel}
\usepackage{amsmath}
\usepackage{amsthm}
\newtheorem{mylemma}{Λήμμα}

\title{\foreignlanguage{english}{Ackermann's function}}
%\author{ }
\date{ } 

\begin{document}

\maketitle
\raisebox{4mm}[0pt][0pt]{
\parbox[t]{\textwidth}{\centering\includegraphics[scale=0.35]{ackermann.jpg}\par
\foreignlanguage{english}{Wilhelm Ackermann,1896-1962}}
}
  • 3
    It seems like you might be using beamer. Could you update your code to reflect a minimal example we can copy-and-paste-and-compile? Code snippets are sometimes misleading since they don't provide a complete scope of the problem. – Werner Apr 15 '15 at 14:22
  • 1
    What 'recent changes' have there been in the last 10 days which have invalidated Harish Kumar's answer? This strikes me as prima facie unlikely but I'm not a MiKTeX user. (I assume you must be since TeX Live is currently frozen and is not currently changing in any way at all.) – cfr Apr 28 '15 at 0:57
  • Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – adn Apr 28 '15 at 17:31
  • See the edit to my answer. You are missing \usepackage{graphicx}. – user11232 Apr 30 '15 at 17:16
12

You can use \raisebox

\documentclass{beamer}

\title{Ackermann's function}

\date{}

\begin{document}

\begin{frame}[t]
  \titlepage
 \raisebox{2mm}[0pt][0pt]{%
\makebox[\textwidth][c]{\includegraphics[scale=0.35]{example-image-a}}
}

%% \raisebox{distance}[height][depth]{text}


 Name: ...

 Prof.: ...

 Subject: ...

 University: ...


\end{frame}
\end{document}

enter image description here

Adjust 2mm as suitable.

Or you can also use \vspace{length}

\begin{frame}[t]
  \titlepage
 \vspace{-3cm}
 {\centering
 \includegraphics[scale=0.35]{example-image-a}\par
}


 Name: ...

 Prof.: ...

 Subject: ...

 University: ...


\end{frame}

To add a name, use a \parbox instead of \makebox like this:

\titlepage
 \raisebox{2mm}[0pt][0pt]{%
\parbox[t]{\textwidth}{\centering\includegraphics[scale=0.35]{example-image-a}\par
Some name}
}

or

\titlepage
 \vspace{-3cm}
 {\centering
 \includegraphics[scale=0.35]{example-image-a}\par Some name \par
}

Edit for the edited question

You are missing the \usepackage{graphicx}. The following works for me with miktex 2.9 updated 4 days ago.

\documentclass{article}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage[english,greek]{babel}
\usepackage{amsmath}
\usepackage{amsthm}
\newtheorem{mylemma}{Λήμμα}

\title{\foreignlanguage{english}{Ackermann's function}}
%\author{ }
\date{ }

\begin{document}

\maketitle
\noindent
\raisebox{4mm}[0pt][0pt]{%
\parbox[t]{\textwidth}{\centering\includegraphics[scale=0.05]{example-image}\par
\foreignlanguage{english}{Wilhelm Ackermann,1896-1962}}
}
\end{document}

enter image description here

  • Thank you!! Also how could we write under the picture a description of it?? I want to write the name of the person of the picture... Which is the command?? @HarishKumar – Mary Star Apr 15 '15 at 18:25
  • @MaryStar Please see the edit. – user11232 Apr 15 '15 at 23:11
  • Now I use an other template, an article... Do I have to use the same command to add a picture and a name under the picture?? @HarishKumar When I write the command above it appears only the name of the image (ackermann.jpg) – Mary Star Apr 26 '15 at 20:25
  • @MaryStar Same method works. Make sure that you don't have draft as the option to graphicx. – user11232 Apr 27 '15 at 22:50
  • Do you mean at an usepackage ?? @HarishKumar – Mary Star Apr 27 '15 at 23:24
2
+50

It is not at all clear from your question what code you are using so it is almost impossible to say what the problem might be. Perhaps you have not loaded the graphicx package. Perhaps you are using beamer commands in a document which uses the article class. Perhaps something else.

This is an example of a custom title in the article class which emulates the layout on your slide. It uses titling and some custom commands to do this.

Note that \institute and \subject are defined in beamer, I think, but certainly not in article. Here we define them and use them in a customised \maketitle via hooks provided by the titling package.

\instructor is another command defined here and used by the same mechanism, but I don't think this exists in beamer so there is less potential, I hope, for confusion.

\documentclass[american,british]{article}
\usepackage{graphicx,babel,titling}

\makeatletter
\newcommand*\my@instructor{}
\newcommand*\instructor[1]{\renewcommand*\my@instructor{#1}}
\newcommand*\my@uni{}
\newcommand*\institute[1]{\renewcommand*\my@uni{#1}}
\newcommand*\my@subject{}
\newcommand*\subject[1]{\renewcommand*\my@subject{#1}}
\renewcommand\maketitlehookb{%
    \centering
    \includegraphics[scale=0.35]{example-image-a}\par
    \foreignlanguage{american}{Wilhelm Ackermann,1896-1962}\bigskip\par}
\preauthor{\begin{flushleft}\large Name: }
\postauthor{%
  \bigskip\par
  Instructor: \my@instructor\bigskip\par
  Subject: \my@subject\bigskip\par
  Institution: \my@uni\par
\end{flushleft}}
\makeatother

\begin{document}
\title{My Title}
\author{A. N. Author}
\instructor{Dr.~Seuss}
\subject{Astrozoology}
\institute{Martian Institute of Aardvarks}
\date{}
\maketitle
\end{document}

custom title

  • Now the picture appears!! Do you maybe know if we can make the picture bigger?? @cfr – Mary Star Apr 28 '15 at 17:43
  • 1
    @MaryStar Well, you have scale=0.35 which makes it only 35% the size of the original. If you used, say, scale=.5 it would be 50% the size of the original. – cfr Apr 28 '15 at 22:56

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.