
いくつかの PDF を結合し、それぞれの目次にエントリを追加したいと考えています。スクリプトを使用してこれを実行しようとしているため、ファイル名を変更したくありません。私の LaTeX コードは、簡略化すると次のようになります。
\documentclass{article}
\usepackage{pdfpages}
\usepackage{hyperref}
\usepackage[utf8]{inputenc}
\usepackage{bookmark}
\usepackage{graphicx}
\usepackage[multidot]{grffile}
\title{Graph Theory}
\date{}
\author{}
\begin{document}
\cleardoublepage
\phantomsection
\addcontentsline{toc}{section}{Basics of Graph Theory}
\includepdf[pages=-]{Basics of Graph Theory}
\cleardoublepage
\phantomsection
\addcontentsline{toc}{section}{Spectral Graph Theory 2: Theorems on Matrices. The Laplacian}
\includepdf[pages=-]{"Spectral Graph Theory 2: Theorems on Matrices. The Laplacian"}
\cleardoublepage
\phantomsection
\addcontentsline{toc}{section}{Random walks in graphs. The probabilistic method}
\includepdf[pages=-]{"Random walks in graphs. The probabilistic method"}
\end{document}
最初のケースは正常に動作しますが、次の 2 つのケースは動作しません。どうやら、ファイルにドットが含まれているためです。このページで見つけたさまざまな方法を試しましたが、どれも動作しません。どうすればこの問題を解決できますか?
答え1
Windows では、ファイル名にコロンが含まれるファイルを保存することはできません。ファイル名を移植可能にしたい場合は、これを避けることを強くお勧めします。
コロンなしで現在のラテックス(私はtexlive 2019とを持っていますLaTeX2e <2019-10-01> patch level 3
) 以下は動作するはずです。このラテックスではgrffile
、および\usepackage[utf8]{inputenc}
は不要になりました。
\documentclass{article}
\usepackage{pdfpages}
\usepackage{bookmark}
\begin{document}
\includepdf[pages=-]{Spectral Graph Theory 2 Theorems on Matrices. The Laplacian}
\end{document}