将图像与新模板集成时出现问题

将图像与新模板集成时出现问题

我在提交论文的新模板中无法显示图表。所有图表都与 tex 文件位于同一文件夹中,我没有收到任何错误消息。在其他文档中一切都运行正常。

有人能指出哪里出了问题吗?抱歉,前言太长了。

\documentclass[twoside]{article}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{lipsum} 
\usepackage[english]{babel}
\usepackage[sc]{mathpazo} % Use the Palatino font
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\linespread{1.05} 
\usepackage{microtype} 
\usepackage[left=30mm, right=30mm, top=1.5in, bottom=1.0in, columnsep=20pt]{geometry}

\usepackage{multicol} 
\usepackage[hang, small,labelfont=bf,up,textfont=it,up]{caption} 
\usepackage{booktabs} % Horizontal rules in tables
\usepackage{float}
\restylefloat{figure}
\usepackage{subfig}
\usepackage{caption}
\usepackage{tikz}
\usepackage{tabu}
\usetikzlibrary{arrows}
\usepackage{hyperref} % For hyperlinks in the PDF

\usepackage{lettrine} 
\usepackage{paralist} 
\usepackage{abstract} 
\renewcommand{\abstractnamefont}{\normalfont\bfseries} 
\renewcommand{\abstracttextfont}{\normalfont\small\itshape} 

\usepackage{titlesec} % Allows customization of titles
\renewcommand\thesection{\Roman{section}} 
\renewcommand\thesubsection{\Roman{subsection}} 
\titleformat{\section}[block]{\large\scshape\centering}{\thesection.}{1em}{} 
\titleformat{\subsection}[block]{\large}{\thesubsection.}{1em}{} 

\usepackage{fancyhdr} % Headers and footers
\pagestyle{fancy} % All pages have headers and footers
\fancyhead{} % Blank out the default header
\fancyfoot{} % Blank out the default footer
\fancyhead[C]{running title} % Custom header text
\fancyfoot[RO,LE]{\thepage} % Custom footer text


\title{\vspace{-15mm}\fontsize{24pt}{10pt}\selectfont\textbf{Article Title}} % Article title

\author{
\large
\textsc{Name}\thanks{A thank you or further information}\\[2mm] % Your name
\normalsize Bla Uni. \\ % Your institution
\normalsize \href{mailto:[email protected]}{[email protected]} % Your email address
\vspace{-5mm}
\date{}


\begin{document}

\maketitle % Insert title
\thispagestyle{fancy} % All pages have headers and footers


\begin{figure}[h]
\includegraphics[scale=0.1]{myPlot1}
\includegraphics[scale=0.1]{myPlot2}
\includegraphics[scale=0.1]{myPlot3}
\caption{my caption}
\label{fig:dataplot}
\end{figure}


\end{document}

答案1

看起来你只是忘记用花括号来关闭该\author字段。

\documentclass[twoside]{article}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{lipsum} 
\usepackage[english]{babel}
\usepackage[sc]{mathpazo} % Use the Palatino font
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\linespread{1.05} 
\usepackage{microtype} 
\usepackage[left=30mm, right=30mm, top=1.5in, bottom=1.0in, columnsep=20pt]{geometry}

\usepackage{multicol} 
\usepackage[hang, small,labelfont=bf,up,textfont=it,up]{caption} 
\usepackage{booktabs} % Horizontal rules in tables
\usepackage{float}
\restylefloat{figure}
\usepackage{subfig}
\usepackage{tikz}
\usepackage{tabu}
\usetikzlibrary{arrows}

\usepackage{lettrine} 
\usepackage{paralist} 
\usepackage{abstract} 
\renewcommand{\abstractnamefont}{\normalfont\bfseries} 
\renewcommand{\abstracttextfont}{\normalfont\small\itshape} 

\usepackage{titlesec} % Allows customization of titles
\renewcommand\thesection{\Roman{section}} 
\renewcommand\thesubsection{\Roman{subsection}} 
\titleformat{\section}[block]{\large\scshape\centering}{\thesection.}{1em}{} 
\titleformat{\subsection}[block]{\large}{\thesubsection.}{1em}{} 

\usepackage{hyperref} % For hyperlinks in the PDF

\usepackage{fancyhdr} % Headers and footers
\pagestyle{fancy} % All pages have headers and footers
\fancyhead{} % Blank out the default header
\fancyfoot{} % Blank out the default footer
\fancyhead[C]{running title} % Custom header text
\fancyfoot[RO,LE]{\thepage} % Custom footer text


\title{\vspace{-15mm}\fontsize{24pt}{10pt}\selectfont
       \textbf{Article Title}} % Article title

\author{
\large
\textsc{Name}\thanks{A thank you or further information}\\[2mm] % Your name
\normalsize Bla Uni. \\ % Your institution
\normalsize \href{mailto:[email protected]}{[email protected]} % Your email address
}
\date{}

\begin{document}

\maketitle % Insert title
\thispagestyle{fancy} % All pages have headers and footers
\begin{twocolumn}[
\maketitle % Insert title
                    ]
\section{Introduction}
\lipsum[1]
    \begin{figure}[h]
\includegraphics[scale=0.1]{example-image-a}\\[1ex]
\includegraphics[scale=0.1]{example-image-b}\\[1ex]
\includegraphics[scale=0.1]{example-image-c}
    \caption{my caption}
\label{fig:dataplot}
   \end{figure}
\lipsum[2-5]

\end{document}

编辑:我只删除了两次加载包caption,移动hyperref到末尾,将图片选项从 twocolumn lipsum 更改为 twocolumn [h]lipsum [htb], and useand以模拟两栏文章。作为证明,这项工作是第一页的图片。

在此处输入图片描述

笔记:如果您的真实图片没有出现在第一页,则意味着它们比所呈现的更大,并且将显示在下一页。

相关内容