我的徽标没有出现在标题页中

我的徽标没有出现在标题页中

我试图将我的徽标添加到我的论文标题页上。但是,它没有出现。我得到的只是一个带有我的日志标题的空框!

\documentclass[12pt,twoside,a4paper,openright]{report}
\usepackage{hyperref}
\hypersetup{
    final,
    colorlinks=true, 
    citecolor=blue,
    filecolor=blue,
    linkcolor=blue,
    urlcolor=blue
    }
\usepackage{fancyhdr}
\usepackage{graphicx} % was missing
\renewcommand{\headrulewidth}{0pt}
\usepackage{titling}

\renewcommand\maketitlehooka{\null\mbox{}\vfill}
\renewcommand\maketitlehookd{\vfill\null}
\usepackage{titlesec}
\begin{document}
\makeatletter
    \begin{titlepage}
    \vfill % better
        \begin{center}
            {\huge \bfseries  \@title }\\[2ex] 
            {\LARGE  \@author}\\ [18ex]
            \includegraphics[width=0.3\linewidth]{logo.jpg}\\[2ex]
            {\large \@date}
        \end{center}
        \vfill % better
    \end{titlepage}
\makeatother
\end{document}

请问有什么帮助吗?

答案1

\documentclass[12pt,twoside,a4paper,openright,
demo % comment out
]{report}
\usepackage{hyperref}
\hypersetup{
    final,
    colorlinks=true, 
    citecolor=blue,
    filecolor=blue,
    linkcolor=blue,
    urlcolor=blue
    }
\usepackage{fancyhdr}
\usepackage{graphicx} % was missing
\renewcommand{\headrulewidth}{0pt}
\usepackage{titling}

\author{My Name}% was missing
\title{My Title}% was missing
\date{\today}% was missing

\renewcommand\maketitlehooka{\null\mbox{}\vfill}
\renewcommand\maketitlehookd{\vfill\null}
\usepackage{titlesec}
\begin{document}
\makeatletter
    \begin{titlepage}
    \vfill % better
        \begin{center}
            {\huge \bfseries  \@title }\\[2ex] 
            {\LARGE  \@author}\\ [18ex]
            \includegraphics[width=0.3\linewidth]{logo.jpg}\\[2ex]
            {\large \@date}
        \end{center}
        \vfill % better
    \end{titlepage}
\makeatother
\end{document}

enter image description here

相关内容