检索存储在网络文件夹中的图像?

检索存储在网络文件夹中的图像?

我正在尝试为包含图像的 TeX 文件创建标头。有问题的图像位于网络目录“\\FileStore1\Forms\IT Info\Apps\pdfTex\images\”中,我很难让 pdflatex.exe 不抛出错误。

附件是我的代码,如能得到任何帮助我将不胜感激。

\documentclass[letterpaper]{article}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{lipsum}
%\usepackage[space]{grffile}
\pagestyle{fancy}
\graphicspath{//FileStore1/Forms/IT Info/Apps/pdfTex/images}
%\graphicspath{{./../../images/}}
\setlength{\topmargin}{-.5in}
\setlength{\textheight}{8in}
\setlength{\headheight}{51.1pt}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\begin{document}
\lhead{\includegraphics[keepaspectratio=true]{head.png}}
\rhead{Company Name\\
Street Address\\
City, State ZIP\\
phone number}
\lfoot{This is an auto-generated report}
blah blah blah\\
foo bar\\
\begin{center}
\begin{tabular}{l c}
Key & Data\\
1 & 2
%<TableData>
\end{tabular}
\end{center}
\lipsum[1-10]
\end{document}

编辑 1:根据 Oberdiek 先生的建议,我更改/添加了以下两行

\usepackage{grffile}
\graphicspath{{\\FileStore1\Forms\IT Info\Apps\pdfTex\images\}}

答案1

  • \usepackage{grffile}增加了对空间的支持。
  • 中的路径条目\graphicspath被括号括起来。因此,如果使用一个路径,则需要两对括号,例如:\graphicspath{{images/}}
  • 中的路径条目\graphicspath应以目录分隔符结尾,因为graphics包只是简单地将路径和图像名称连接起来。它不考虑目录分隔符,...
  • TeX 将反斜杠解释为 TeX 命令的开始,因此使用正斜杠代替(Windows 除了在命令行上支持它们)。

概括:

\usepackage{grffile}% option space is the default for the supported drivers
\graphicspath{{//FileStore1/Forms/IT Info/Apps/pdfTex/images/}}

相关内容