在标题页中插入图片

在标题页中插入图片

我试图在报告的第一页插入一张图片,但它出现在单独的页面上,或者出现在标题上方。我希望它位于作者和日期之间:

\begin{document}


\title{bb}
\author{bb}
\date {bb}

\begin{figure}[]
\centering
\includegraphics[width=3in]{figure1}
\end{figure}
\maketitle
\end{document}

我尝试按如下所示进行操作,但 \titlehead 出现错误:

\titlehead{\centering\includegraphics[width=3in]{figure1}}

答案1

没有要求在包含浮动物体(包括图片)及其标题的环境\includegraphics中。figure

对于您的问题,请使用titling允许\maketitle在需要时自定义命令添加项目的包。

\documentclass{article}
\usepackage{graphicx}
\usepackage{titling}

% set up \maketitle to accept a new item
\predate{\begin{center}\placetitlepicture\large}
\postdate{\par\end{center}}

% commands for including the picture
\newcommand{\titlepicture}[2][]{%
  \renewcommand\placetitlepicture{%
    \includegraphics[#1]{#2}\par\medskip
  }%
}
\newcommand{\placetitlepicture}{} % initialization

\begin{document}

\title{A very important paper}
\author{A. Uthor}
\date{38 July 2014}
\titlepicture[width=3in]{example-image}

\maketitle

\end{document}

只要您\titlepicture之前指定了\maketitle,您就会得到想要的图片。不指定\titlepicture与通常的 没什么不同\maketitle

在此处输入图片描述

答案2

使用允许插入命令补充材料的titling包及其命令最为简单。以下是示例:maketitlehookx\maketitle

\documentclass[11pt,a4paper,twoside]{report}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[osf]{garamondx}
\usepackage[showframe, nomarginpar]{geometry}
\usepackage{graphicx}
\pagestyle{plain}

\usepackage{titling}
\title{About Piero di Cosimo}
\author{The author}

\setlength\droptitle {-38.5mm}
\pretitle{\begin{center}\Huge\itshape\bfseries}
\posttitle{\end{center}\vskip2cm}
\preauthor{\begin{center}\LARGE}
\postauthor{\end{center}\vfill}
\renewcommand{\maketitlehooka}{%
\noindent\includegraphics[width=\linewidth]{Piero_di_Cosimo_1}\par\vskip 3cm}%

\begin{document}

\maketitle

\end{document} 

在此处输入图片描述

答案3

您可以直接将其添加到\author

\documentclass{article}
\usepackage{graphicx}

\begin{document}

\title{A very important paper}
\author{A. Uthor\\[2ex]
        \includegraphics[width=3in]{example-image}\\[1ex]
        \small This is my title picture
        }
\date{38 July 2014}

\maketitle


\end{document}

在此处输入图片描述

答案4

只需在标题中放一张图片即可。很简单 :)

您可以添加 \texttt 来格式化文本。

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\graphicspath{./images/ }

\title{
\includegraphics[scale=0.5]{logo.png} Here is my Title
}
\author{Saurabh Adhikary}
.
.
.
\begin{document}
\maketitle

相关内容