如何解决乳胶章节引用给最后一章最后一节的参考
我在参考章节时遇到问题。我在每个标题下都使用了标签,但是没有提供正确的参考。我尝试了一些修复程序,但没有成功(nameref,varioref,cleveref)
我的乳胶代码如下
\documentclass[12pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[french,arabic,english]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\graphicspath{{images/}}
\usepackage{float}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{arabtex}
\usepackage{multirow}
\usepackage{threeparttable}
\usepackage{utf8}
\usepackage{longtable}
\usepackage{url}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{breakcites}
\usepackage{hhline}
\usepackage{xcolor}
\usepackage{colortbl}
%\usepackage{asect}
\usepackage{tocbibind}
\usepackage{tocloft}
\usepackage{acro}
\input{annexes/abreviations}
\usepackage[colorlinks]{hyperref}
\hypersetup{
colorlinks=true,linkcolor=blue,filecolor=magenta,urlcolor=cyan,citecolor=violet
}
% ref packages
\usepackage{nameref}
% folowing must be in this order
\usepackage{varioref}
\usepackage{hyperref}
\usepackage{cleveref}
\begin{document}
\input{chapters/chap1.tex}
\input{chapters/chap2.tex}
\input{chapters/chap3.tex}
\input{chapters/chap4.tex}
\bibliographystyle{apalike}
\bibliography{bibliography}
\end{document}
在第一章中
\chapter{title1}
\label{chap1}
here is defined the label{chap1}
\section{section1}
this is section1
\section{section1}
this is section1
\section{section1}
this is section1
第3章
\chapter{title3}
\label{chap3}
text reference Chapter \ref{chap1}
但是,参考文献显示了第1章的最后一部分
我正在使用texmaker快速构建来编译代码。这是背面https://www.overleaf.com/read/rxkmhxcbcgqc的完整示例 我们还可以注意到,引用第一章不起作用。
解决方法
一个最小的无效示例是
\documentclass{book}
\usepackage[arabic,english]{babel}
\begin{document}
\chapter{title}\label{key}
test \ref{key}
\end{document}
您可以使用https://tex.stackexchange.com/a/238442/36296
中的方法来解决此问题。\documentclass{book}
\usepackage[arabic,english]{babel}
\makeatletter
\def\@part[#1]#2{%
\addtocontents{toc}{\xstring\select@language{\main@Arabi@language}}%
\if@rl\SAV@@part[\textRL{#1}]{\textRL{#2}}%
\else\SAV@@part[\textLR{#1}]{\textLR{#2}}%
\fi}
\def\@spart#1{%
\addtocontents{toc}{\xstring\select@language{\main@Arabi@language}}%
\if@rl\SAV@spart{\textRL{#1}}%
\else\SAV@spart{\textLR{#1}}%
\fi}
\def\@chapter[#1]#2{%
\addtocontents{toc}{\xstring\select@language{\main@Arabi@language}}%
\if@rl\SAV@@chapter[\textRL{#1}]{\textRL{#2}}%
\else\SAV@@chapter[\textLR{#1}]{\textLR{#2}}%
\fi}
\def\@schapter#1{%
\addtocontents{toc}{\xstring\select@language{\main@Arabi@language}}%
\if@rl\SAV@schapter{\textRL{#1}}%
\else\SAV@schapter{\textLR{#1}}%
\fi}
\makeatother
\begin{document}
\chapter{title}\label{key}
test \ref{key}
\end{document}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。