我有一个非常奇怪的问题。在我的一篇论文中,根本没有打印对章节的引用。我用 pdflatex 进行编译,它的工作没有任何抱怨,并且它会输出 pdf,但没有任何对部分的引用。
我只是在一个部分之后使用 \label{sec:mysec} ,并在文本中的任何地方使用 \ref{sec:mysec} ,这是典型的用法。我已经使用它很多年了,但是在这个特定的文档中,必须与阻止乳胶显示引用的东西进行交互。
如果有帮助,这些是我要导入的包:
\documentclass[a4paper,man,natbib,floatsintext]{apa6}
\usepackage[utf8]{inputenc}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{rotating}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{color}
\usepackage{array}
Run Code Online (Sandbox Code Playgroud)
我不知道它是从哪里来的。任何提示都将非常受欢迎。
多谢!
请注意,
\ref
由于 APA 样式不使用编号部分,因此无法对部分进行编号。因此,\label
除非您想使用,否则命令是不必要的\refname
。
\refname
仅允许您访问参考文献部分标题(如果您使用它)。文档中的所有部分都apa6
打印时没有数字(源于\setcounter{secnumdepth}{0}
类内部),因此\label
和\ref
没有多大意义:
\documentclass{apa6}
\begin{document}
\section{A section}
\label{sec:section}
\section*{Another section}
See section~\ref{sec:section}.
\end{document}
Run Code Online (Sandbox Code Playgroud)
您可以\label
使用以下\setlabel{<stuff>}{<label>}
选项手动设置应存储和稍后引用的内容:
\documentclass{apa6}
\makeatletter
\newcommand{\setlabel}[1]{\edef\@currentlabel{#1}\label}
\makeatother
\begin{document}
\section{A section}
\setlabel{A section}{sec:section}
\section*{Another section}
See section~\ref{sec:section}.
\end{document}
Run Code Online (Sandbox Code Playgroud)
如果您希望自动化此过程,您可以通过以下方式在LaTeX 内核\@sect
中修补和:\@ssect
\documentclass{apa6}
\usepackage{etoolbox}
\makeatletter
% \pretocmd{<cmd>}{<prefix>}{<success>}{<failure>}
\pretocmd{\@sect}{\def\@currentlabel{#8}}{}{}% Store title of \section
\pretocmd{\@ssect}{\def\@currentlabel{#5}}{}{}% Store title of \section*
\makeatother
\begin{document}
\section{A section}
\label{sec:section}
\section*{Another section}
See section~\ref{sec:section}.
\end{document}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
5943 次 |
最近记录: |