当我将所有文本和图片都放在 main.tex 中时,我的论文写得很好。但是,现在我使用 subfiles 包来组织我的论文,在编译 main.tex 时,我收到以下消息:
! TeX capacity exceeded, sorry [input stack size=5000].
\graphicspath #1->\def \Ginput@path
{#1}
l.73 \subfile{sections/method1}
当我将 method1.tex 编译为独立文件时,它起作用了。
我的main.tex:
\documentclass[12pt, a4paper, oneside]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts,amsmath,amssymb}
\usepackage[none]{hyphenat}
\usepackage[margin=1in]{geometry}
\setlength{\parskip}{1em}
\parindent 0ex
\renewcommand{\baselinestretch}{1}
\usepackage{caption}
\usepackage{float}
\usepackage{tocloft}
\usepackage{tikz}
\usepackage{anyfontsize}
\usetikzlibrary{bending}
\usetikzlibrary{arrows.meta}
\usepackage{graphicx}
\graphicspath{\graphicspath{{images/}{../images/}}}
\usepackage[
backend=biber,
style=numeric,
sorting=none]{biblatex}
\addbibresource{references.bib}
\usepackage{url}
\setcounter{biburllcpenalty}{7000}
\setcounter{biburlucpenalty}{8000}
\usepackage{subfiles}
\begin{document}
\begin{titlepage}
\begin{center}
\end{center}
\end{titlepage}
\newpage
\setcounter{page}{2}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
\tableofcontents
\newpage
\section*{Introduction}
\addcontentsline{toc}{section}{Introduction}
\section*{Method 1: Geometric approach}
\addcontentsline{toc}{section}{Method 1: Geometric approach}
\subfile{sections/method1}
\printbibliography[
heading=bibintoc,
title={References}
]
\end{document}