\ifstandalone 命令无法被识别

\ifstandalone 命令无法被识别

我有几个子文件和一个主文件如下:

%子文件1

\documentclass[alpha-refs]{wiley-article}
\usepackage{standalone} 
.... 
\begin{document} 
some text
\bibliographystyle{plain} 
\bibliography{mybib} 
\end{document}

%子文件2

\documentclass[alpha-refs]{wiley-article}
\usepackage{standalone} 
.... 
\begin{document} 
some text
\bibliographystyle{plain} 
\bibliography{mybib} 
\end{document}

%主要的

\documentclass[alpha-refs]{wiley-article}
\usepackage[subpreambles=false]{standalone}
\usepackage{import}
.... 
\begin{document} 
some text
\section{1}
\subimport{sections/}{subfile1}
\section{2}
\subimport{sections/}{subfile2}
\bibliographystyle{plain} 
\bibliography{mybib}
\end{document}

当我编译子文件时,我得到了参考文献,因为我在子文件中包含了参考书目,而当我编译主文件时,我也会得到每个部分的参考文献。我想在子文件中看到参考文献,但我在主文件的每个部分中忽略了它们,只在主文件末尾显示参考文献。在子文件中使用\ifstandalone ... \fi不起作用bibliography{},因为它无法识别命令\ifstandalone,并给出以下错误:

This is BibTeX, Version 0.99d (TeX Live 2015)
The top-level auxiliary file: example.aux
The style file: rss.bst
I found no \bibdata command---while reading file subfile1.aux
Warning--I didn't find a database entry for "cite1"
Warning--I didn't find a database entry for "cite2"
Warning--I didn't find a database entry for "cite3"
(There was 1 error message)

有人知道这是什么问题吗?

答案1

\ifstandalone设置为 true 的standalone 班级(用于子文件)但standalone 包裹(在主文档中使用)。您的用例standalone也在子文件中使用该包。尝试在子文件中更改\documentclass[alpha-refs]{wiley-article} \usepackage{standalone}为。\documentclass[alpha-refs,class=wiley-article]{standalone}

相关内容