4

Is it possible in a Lyx article document, to put an image under the title in the front page? I tried inserting an image but it goes in the second page

Due comments that says that I have to put hands on .tex code, I upload the first piece of tex file exported by LyX.

%% LyX 2.0.6 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[italian]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{geometry}
\geometry{verbose,lmargin=2cm,rmargin=2cm}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{1}
\usepackage{float}
\usepackage{textcomp}
\usepackage{graphicx}
\PassOptionsToPackage{normalem}{ulem}
\usepackage{ulem}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\newenvironment{lyxcode}
{\par\begin{list}{}{
\setlength{\rightmargin}{\leftmargin}
\setlength{\listparindent}{0pt}% needed for AMS classes
\raggedright
\setlength{\itemsep}{0pt}
\setlength{\parsep}{0pt}
\normalfont\ttfamily}%
 \item[]}
{\end{list}}

\makeatother

\usepackage{babel}
\begin{document}

\title{Linee guida utilizzo}


\author{Caterpillar}

\maketitle
5
  • 1
    Yes, but you most certainly have to manipulate the (La)TeX internals to achieve this. Alternatively, why don't you just set the title page manually (then you can do what you want with it)?
    – Werner
    Commented Dec 5, 2013 at 20:33
  • 1
    Well you need to create your own titlepage using the enviroment titlepage before the \maketitle command. Also you need to use the ^grapicxpackage for insert the image. Few useful commands for this would be \hspace{size}, \hspace*{size}, \vspace{size}, \vspace*{size}, \hfill, \vfill, \stretch{factor}` etc. I think it's easier instead of tunning the class directly.
    – Aradnix
    Commented Dec 5, 2013 at 21:39
  • @Aradnix I uploaded the first piece of code, if you fill an answer I can give you the green mark :-) Commented Dec 6, 2013 at 16:07
  • You say article, but the code says report (KOMA). (In the default settings with the article class the title is not placed on a separate page.) Where exactly do you want the image? (Between title and author, between author and date, ...) @Werner Well, you can cheat a bit, and stick an \includegraphics in e.g the \title{}. Commented Dec 6, 2013 at 17:02
  • @TorbjørnT. yes you are right, the document is "report (Koma Script). I would like to have: TITLE IMAGE AUTHOR Commented Dec 6, 2013 at 21:01

2 Answers 2

7

One could of course create a custom titlepage from scratch, rather than using the Title, Author, etc. layouts from the dropdown menu. A quick alternative workaround/hack is to place the image as part of the title. If you don't need any vertical space between title and image, hit Ctrl + Enter just after the title, and insert the image with Insert --> Graphics, as usual.

If you need some vertical space, rather than Ctrl + Enter insert an ERT with Ctrl + L, write \\[1cm] (modify the length to suit your need), and insert the image right after this, as in this screenshot:

enter image description here

2

Well my suggestion was a little bit more LaTeX option. Useful in LyX I think, but perhaps not so easy as the solution suggested by @TorbjørnT.

Well you can use the environment \titlepage for create your own frontpage. By example:

%% LyX 2.0.6 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[italian]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{geometry}
\geometry{verbose,lmargin=2cm,rmargin=2cm}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{1}
\usepackage{float}
\usepackage{textcomp}
\usepackage{graphicx}
\PassOptionsToPackage{normalem}{ulem}
\usepackage{ulem}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\newenvironment{lyxcode}
{\par\begin{list}{}{
\setlength{\rightmargin}{\leftmargin}
\setlength{\listparindent}{0pt}% needed for AMS classes
\raggedright
\setlength{\itemsep}{0pt}
\setlength{\parsep}{0pt}
\normalfont\ttfamily}%
\item[]}
{\end{list}}

\makeatother

\usepackage{babel}

\begin{document}

\begin{titlepage}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}
\vspace*{\stretch{1}}
%\rule{\linewidth}{1pt}
\begin{flushright}
{\Huge Linee guida utilizzo} %\\ [14pt]
\end{flushright}
\begin{center}
\includegraphics[width=\textwidth]{your_image.jpg}
\end{center}
\begin{flushright}
\huge Caterpillar
\end{flushright}
\vspace*{\stretch{2}}
\begin{center}
\textsc{7 decembre 2013}
\end{center}
\end{titlepage}

\end{document}

You can check an example here. I hope this will be helpful.

Regards

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .