ASL 클래스 파일과 Cleveref 및 Cite 패키지 간의 충돌

ASL 클래스 파일과 Cleveref 및 Cite 패키지 간의 충돌

나는 학회에 논문을 제출하고 싶습니다.기호 논리 저널asl.cls, 이는 Association of Symbolic Logic의 클래스 파일 과 참고문헌 스타일 파일을 사용해야 함을 의미합니다. asl.bst둘 다 사용 가능합니다.여기.

과거에는 및 패키지 hyperref를 및 패키지와 함께 성공적으로 사용했습니다.cleverefcitearticlebook . 그런데 클래스 파일이 asl.cls문제를 일으키고 있습니다. MWE는 다음과 같습니다.

\documentclass{asl}

\usepackage{color}
\usepackage{hyperref}
\hypersetup{colorlinks=true,linkcolor={blue},citecolor={orange}}
%\usepackage[nameinlink]{cleveref} % If this is switched on, then the .tex file fails to compile.
\usepackage{cite} % This package doesn't lead to a catastrophic failure, but the citation appears as [?].

\newtheorem{thm}{Theorem}

\title{A minimal working example}
\author{M.W.\ Example}

\begin{document}
\maketitle

\begin{thm}\label{theorem}
There exists a solution to this \LaTeX{} problem.
\end{thm}

\begin{proof}
See the \TeX{} Stack Exchange.
\end{proof}

A reference to the theorem: \ref{theorem} This is working! :)

A citation: \cite{test} This is not working. :(

\bibliography{MWE}
\bibliographystyle{asl}

\end{document}

MWE.bib 파일은 다음과 같습니다.

 @article{test,
 author           = {Why, Y.O.},
 title            = {Clashes between packages and class files},
 journal          = {Journal of tricky \LaTeX{} problems},
 year             = {2017},
 volume           = {1},
 pages            = {1-101}
 }

지금까지의 몇 가지 관찰과 시도는 다음과 같습니다.

  1. 파일asl.cls 2002년의 것으로, 일부 패키지보다 이전 버전인 것으로 생각되지만 최신 버전을 찾을 수 없습니다.
  2. 파일을 살펴봤지만 asl.clsLaTeX 클래스 파일의 내부 작동에 대한 지식은 다음과 같습니다.매우제한적이며 종속성이 너무 많아서 어디서부터 시작해야 할지 모르겠습니다.
  3. 패키지 를 끄면 cite인용이 [?]가 아닌 [1]로 올바르게 표시되지만 클릭할 수는 없습니다.
  4. 와 같은 일부 표준 패키지는 amsthm파일에 내장되어 있습니다 asl.cls(완전히 이해하지는 못함).

hyperref그래서 제 질문은 이렇습니다. , cleverefcite패키지를 (수정된 버전)과 함께 사용할 수 있는 방법이 있습니까 asl.cls?

답변1

나는 파일을 살펴보고 asl.cls문서 asl.bst클래스의 사용자 가이드( )를 이해하려고 노력했습니다 asldoc.ps.

  • 파일의 복사본을 만들고 asl.cls복사본을 호출합니다 als-mod.cls.

  • 텍스트 편집기에서 파일을 열고 als-mod.cls3332행으로 이동하여 (재)정의가 \bibliographystyle시작됩니다. 이 매크로의 전체 (재)정의(예: 3332~3349행)를 주석 처리합니다.

  • 기본 tex 파일에서 asl-mod의 필수 인수로 지정 \documentclass하고 옵션을 지정합니다 bibother. otherbib예, 둘 다입니다!

  • 기본 tex 파일에서 인수를 \bibliographystylefrom asl으로 변경하십시오 plain. 파일의 코딩은 asl.bst단순히 창백함을 넘어선 것입니다. 그것을 고치려고 노력하는 것은 의미가 없습니다. 문서 클래스 의 사용자 가이드에서는 asl간접적이기는 하지만 해당 스타일을 사용하여 참고문헌을 편집하는 것이 허용된다고 제안합니다 plain. 그것을 위해 가십시오! (사용자 가이드에는 "다른 스타일을 사용할 이유가 없습니다 asl."라고 명시되어 있습니다. 이는 참고문헌 스타일 사용을 지지하는 것처럼 들리지만 asl을 사용해야 한다는 표시는 없습니다 asl.)

이러한 변경으로 인해 \cite지침은 실제로 숫자 인용 설명을 제공합니다. 우후!

  • 출근 하려면 cleveref다음을 실행하세요. (a)\newtheorem{thm}{Theorem} ~ 전에로딩 및 (b) 로딩 후 cleveref지침을 제공합니다 .\crefname{thm}{Theorem}{Theorems}cleveref

여기에 이미지 설명을 입력하세요

\RequirePackage{filecontents}
\begin{filecontents}{MWE.bib}
@article{test,
 author       = {Why, Y. O.},
 title        = {Clashes between packages and class files},
 journal      = {Journal of tricky \LaTeX{} problems},
 year         = {2017},
 volume       = {1},
 pages        = {1-101}
 }
\end{filecontents}

\documentclass[otherbib,bibother]{asl-mod} % not 'asl'
\usepackage{xcolor}
\usepackage{hyperref}
\hypersetup{colorlinks=true,
            linkcolor={blue},
            citecolor={red}}

\newtheorem{thm}{Theorem}

\usepackage[nameinlink]{cleveref} % 'nameinlink' option is optional
\crefname{thm}{Theorem}{Theorems}

\bibliographystyle{plain} % not 'asl'

\begin{document}
%\title{A minimal working example}
%\author{M.W.\ Example}
%\maketitle

\begin{thm}\label{theorem}
There exists a solution to this \LaTeX{} problem.
\end{thm}

\begin{proof}
See the \TeX{} Stack Exchange.
\end{proof}

A \verb+\cref+ cross-reference: \cref{theorem}. This is now working.

A citation call-out: \cite{test}. This now works too.

\bibliography{MWE}
\end{document}

관련 정보