![다른 tex 파일에서 참고문헌을 사용하지 못했습니다.](https://rvso.com/image/330731/%EB%8B%A4%EB%A5%B8%20tex%20%ED%8C%8C%EC%9D%BC%EC%97%90%EC%84%9C%20%EC%B0%B8%EA%B3%A0%EB%AC%B8%ED%97%8C%EC%9D%84%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%A7%80%20%EB%AA%BB%ED%96%88%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
두 개의 .tex 파일이 있습니다. 참조, 그림, 방정식과 같은 주요 세부 정보가 포함된 reftest.tex입니다. 그리고 cross_ref.tex. cross_ref.tex에서 reftest.tex 파일에 있는 reference 인용을 상호 참조하고 싶습니다. 그러나 인용에는 실패했다. 문제를 해결하도록 도와주실 수 있나요? 이것은 내 코드입니다
reftest.tex에서:
\documentclass[preprint,12pt, sort&compress]{elsarticle}
\def\bibsection{\section*{References}}
\usepackage[draft]{hyperref}
\usepackage{graphicx}
\usepackage{caption,subfig}
\usepackage{amssymb}
\usepackage{amsmath}
\begin{document}
This is ref \cite{S_Goossens}
\begin{figure}
\centering \includegraphics[width=0.5\linewidth]{example-image-a}
\caption{This is caption}
\label{fig:2}
\end{figure}
\begin{equation}
\label{eq:1}
y=x
\end{equation}
\begin{thebibliography}{00}
%% Text of bibliographic item
\bibitem{S_Goossens}SMichel Goossens, Frank Mittelbach, and Alexander Samarin Addison-Wesley, Reading, Massachusetts, 1993.
\end{thebibliography}
\end{document}
cross_ref.tex에서
\documentclass[preprint,12pt, sort&compress]{elsarticle}
\def\bibsection{\section*{References}}
\usepackage[draft]{hyperref}
\usepackage{graphicx}
\usepackage{caption,subfig}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{xr}
\externaldocument{reftest}
\begin{document}
This is ref \cite{S_Goossens} in the reftest file
Figure \ref{fig:1} is figure in the reftest file
The Eq. \eqref{eq:1} is a equation
\end{document}
내 출력에서 cross_ref.tex 파일의 인용 번호를 표시할 수 없습니다.
답변1
그것 으로 xcite
작동하는 것 같습니다. xr-hyper
`xr 및 패키지 로딩 순서 대신 참고하세요 .
reftest.tex
\documentclass[preprint,12pt, sort&compress]{elsarticle}
\def\bibsection{\section*{References}}
\usepackage{graphicx}
\usepackage{caption,subfig}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage[draft]{hyperref}
\begin{document}
This is ref \cite{S_Goossens}
\begin{figure}
\centering \includegraphics[width=0.5\linewidth]{example-image-a}
\caption{This is caption}
\label{fig:1}
\end{figure}
\begin{equation}
\label{eq:1}
y=x
\end{equation}
\begin{thebibliography}{00}
%% Text of bibliographic item
\bibitem{S_Goossens} Michel Goossens, Frank Mittelbach, and Alexander Samarin
Addison-Wesley, Reading, Massachusetts, 1993.
\end{thebibliography}
\end{document}
crossref.tex
\documentclass[preprint,12pt, sort&compress]{elsarticle}
\def\bibsection{\section*{References}}
\usepackage{graphicx}
\usepackage{caption,subfig}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{xcite}
\usepackage{xr-hyper}
\usepackage[draft]{hyperref}
\externaldocument{reftest}
\externalcitedocument{reftest}
\begin{document}
This is ref \cite{S_Goossens} in the reftest file
Figure \ref{fig:1} is figure in the reftest file
The Eq. \eqref{eq:1} is a equation
\end{document}
출력crossref.tex
답변2
좋습니다. 해결책이 있습니다.
외부 참고문헌 파일(literatur.bib)을 사용하는 경우:
@BOOK{S_Goossens,
title = {Some title},
publisher = {Addison-Wesley},
year = {1993},
author = {Goossens, S. Michel and Mittelbach, Frank and Samarin, Alexander},
address = {Reading, Massachusetts},
owner = {polz},
timestamp = {2016.03.24}
}
환경 을 사용하는 대신 외부 참고문헌을 사용하려면 reftest.tex를 변경하기만 하면 됩니다 thebibliography
.
\documentclass[preprint,12pt, sort&compress]{elsarticle}
\def\bibsection{\section*{References}}
\usepackage[draft]{hyperref}
\usepackage{graphicx}
\usepackage{caption,subfig}
\usepackage{amssymb}
\usepackage{amsmath}
\begin{document}
This is ref \cite{S_Goossens}
\begin{figure}
\centering \includegraphics[width=0.5\linewidth]{example-image-a}
\caption{This is caption}
\label{fig:1}
\end{figure}
\begin{equation}
\label{eq:1}
y=x
\end{equation}
\bibliography{literatur}{}
\bibliographystyle{plain}
\end{document}
이제 \usepackage{bibentry}
cross_rex.tex의 서문에 명령을 포함하고 참고 \nobibliography{literatur}{}
문헌 인쇄를 방지하는 literatur.bib를 통해 포함하면 원하는 방식으로 작동합니다.
\documentclass[preprint,12pt, sort&compress]{elsarticle}
\def\bibsection{\section*{References}}
\usepackage[draft]{hyperref}
\usepackage{graphicx}
\usepackage{caption,subfig}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{xr}
\externaldocument{reftest}
\usepackage{bibentry}
\begin{document}
This is ref \cite{S_Goossens} in the reftest file
Figure \ref{fig:1} is figure in the reftest file
The Eq. \eqref{eq:1} is a equation
\nobibliography{literatur}{}
\end{document}