如果路徑和檔案名稱有空格,我可以交叉引用外部文件嗎?

如果路徑和檔案名稱有空格,我可以交叉引用外部文件嗎?

第一部分:路徑中的空格

我是一名技術作家,試圖交叉引用不同資料夾中的文件。我繼承的資料夾名稱和檔案名稱都有一個或多個空格。如果我更改資料夾和/或檔案名,開發人員可能必須更改一些腳本,因此我在走這條路之前正在探索我的選擇。

(1) 在呼叫文件(管理指南)中,我在路徑名兩邊新增了引號。這避免了我的調用文件上的錯誤訊息,但我不確定這是否足以使交叉引用過程正常工作:

\usepackage{xr}  % so can reference Install guide from Admin guide
\externaldocument{"../Installation Guide/SMS Install Guide"}

(2) 以下是\ref管理指南(呼叫文件)中的內容:

\chapter{Document History}
\fancyhead[RE,LO]{Chapter \thechapter: Document History} 
This is a test of referencing the Installation Guide, Section~\ref{InstallCustom}

(3) 該程式碼在安裝指南中被引用:

\section{Configure Custom Reports (Optional)}\label{sec:InstallCustom}
Below are instructions for installing and configuring the software necessary for....

(4) 編譯兩次安裝指南和兩次管理指南後的結果:

這是參考安裝指南第 ?? 節的測試。

第二部分:編譯訂單

上面的程式碼是我對從管理指南到不同資料夾中的安裝指南的直接交叉引用的測試。然而,一旦這種方法發揮作用,我將有更多的機會進行談判。我需要能夠將上面 (2) 中的調用放入一個單獨的文檔 ssrs.tex 中,該文檔以\include.那麼推薦的編譯/建置順序是什麼?

謝謝,奧黛麗

答案1

這裡似乎有效。但因為我喜歡大衛從不在文件名中使用空格,所以我不確定它是否不會在某個地方中斷。

\documentclass[parskip]{scrartcl}
\usepackage{xr}  % so can reference Install guide from Admin guide
\makeatletter
\def\XR@[#1]#2{{%
  \makeatletter
  \def\XR@prefix{#1}%
  \XR@next"#2.aux"\relax\\}} %added quotes
\makeatother
\externaldocument{test with space/test}
\externaldocument{test-ansinew}
\begin{document}

blalb \ref{abc}, \ref{blub}, \ref{x}

\end{document}

相關內容