在我尝试插入图片之前,它一直运行良好,现在却显示我保存文件的位置,并说 pdf 不存在。我甚至删除了图片的代码,但问题依然存在。有人有什么想法吗?
这是我的代码:
\documentclass{article}
%Graphics stuff
\usepackage{graphicx} %to import images
\usepackage{float} %control of float positions
% Header stuff
\usepackage{fancyhdr}
\pagestyle{fancy}
%
\begin{document}
\begin{titlepage}
\begin{center}
\huge{\bfseries The Collisionless Dynamics of the Milky Way}\\
[12cm]
\end{center}
\begin{flushright}\
\textsc{\large name}
\\130009548\\
\end{flushright}
\end{titlepage}
% table of contents stuff
\tableofcontents
\thispagestyle{empty}
\cleardoublepage
\setcounter{page}{1}
\section{Introduction}\label{sec:intro}
Some text for my intro
\begin{figure}[H]
\centering
\includegraphics[height=3in]{\\cfs\users\sm292\Documents\Pictures\MWmodella.jpg}
\caption[Fig. 1. Structure of the Milky Way]
\end{document}
答案1
请尝试以下更改后的代码:
\documentclass{article}
\usepackage{graphicx} %to import images
\usepackage{float} %control of float positions
\usepackage{fancyhdr}
\pagestyle{fancy}
\begin{document}
\begin{titlepage}
\begin{center}
\huge{\bfseries The Collisionless Dynamics of the Milky Way}\\
[12cm]
\end{center}
\begin{flushright}\
\textsc{\large name}
\\130009548\\
\end{flushright}
\end{titlepage}
% table of contents stuff
\tableofcontents
\thispagestyle{empty}
\cleardoublepage
\setcounter{page}{1}
\section{Introduction}\label{sec:intro}
Some text for my intro
\begin{figure}[H]
\centering
\includegraphics[height=3in]{//cfs/users/sm292/Documents/Pictures/MWmodella.jpg} % <=================
\caption{Structure of the Milky Way} % <==============================
\end{figure} % <================================================ missing
\end{document}
请注意,我更改了标有 的行<=======
。请注意,我添加了缺失的\end{figure}
。
请看我修正了这一行:\caption{Structure of the Milky Way}
。图号由 LaTeX 完成...
因为我没有被调用的文件所以MWmodella.jpg
我得到以下结果:
因为我没有您的图像,所以我使用包 MWE(必须安装,但不能调用)来显示结果example-image-a
:\includegraphics[height=3in]{example-image-a}
。
使用 MWE
\documentclass{article}
\usepackage{graphicx} %to import images
\usepackage{float} %control of float positions
\usepackage{fancyhdr}
\pagestyle{fancy}
\begin{document}
\begin{titlepage}
\begin{center}
\huge{\bfseries The Collisionless Dynamics of the Milky Way}\\
[12cm]
\end{center}
\begin{flushright}\
\textsc{\large name}
\\130009548\\
\end{flushright}
\end{titlepage}
% table of contents stuff
\tableofcontents
\thispagestyle{empty}
\cleardoublepage
\setcounter{page}{1}
\section{Introduction}\label{sec:intro}
Some text for my intro
\begin{figure}[H]
\centering
\includegraphics[height=3in]{example-image-a} % <=================
\caption{Structure of the Milky Way} % <==============================
\end{figure} % <================================================ missing
\end{document}
得到结果: