“未定义的引用”,但它已定义

“未定义的引用”,但它已定义

编辑:Overleaf

编译器:pdfLatex

如果需要,链接到项目:https://fr.overleaf.com/read/jybgmhkvkzmp

问题 :

Reference `chapterfive' on page 1 undefined on input line 6.
You have referenced something which has not yet been labelled. If you have labelled it already, make sure that what is written inside \ref{...} is the same as what is written inside \label{...}.

Reference `chaptersix' on page 1 undefined on input line 7.
You have referenced something which has not yet been labelled. If you have labelled it already, make sure that what is written inside \ref{...} is the same as what is written inside \label{...}.

There were undefined references.
You have referenced something which has not yet been labelled. If you have labelled it already, make sure that what is written inside \ref{...} is the same as what is written inside \label{...}.

在此处输入图片描述

======================================

上下文 :

我有一个包含以下文件的项目

main.tex
exercices (folder)
⮑  1.tex
⮑  22.tex
⮑  55.tex
⮑  80.tex
⮑  106.tex
⮑  136.tex

在此处输入图片描述

main.tex包含

\documentclass{book}
\usepackage{tikz}
\begin{document}
\foreach \filenumber in {1,2,...,99}{
  \IfFileExists{./exercices/\filenumber}{\input{./exercices/\filenumber}}}
  
\appendix
\chapter{chapterappendix} \label{chapterappendix}
\end{document}

1.tex包含

\chapter{chapterone} \label{chapterone}
\ref{chapterone}
\ref{chaptertwo}
\ref{chapterthree}
\ref{chapterfour}
\ref{chapterfive}
\ref{chaptersix}
\ref{chapterappendix}

22.tex,,,并包含55.tex​​80.tex106.tex136.tex

\chapter{chaptertwo} \label{chaptertwo}

只需将、和 中的“二”替换为三、四、五和六即可55.tex80.tex106.tex136.tex

答案1

106 大于 99,所以你永远不会输入第 5 章

相关内容