biblatex biber 到 \bibitem

biblatex biber 到 \bibitem

我是一个对 LaTeX 非常热衷的新手。因此,我使用这个出色的工具撰写所有报告和文章。不幸的是,科学评论的编辑们对 LaTeX 的热情并不相同。我计划将我未来的论文提交给 ICES 科学杂志,该杂志(幸运的是)有一种在线可用的 LaTeX 模板(http://www.oxfordjournals.org/our_journals/icesjms/ices.zip) 以及此处提供的指南 (http://www.oxfordjournals.org/for_authors/latex.html)。

我的主要问题与参考书目有关。在我所有的写作中,我biblatex在序言中使用了:

\usepackage[style=authoryear,
firstinits=true,
uniquename=false,
uniquelist=false,
maxcitenames=2,
maxbibnames=7,
backend=biber]{biblatex}.

在文中我使用\autocite\textcite\citeauthor来引用\citeyear

根据期刊的要求,我尝试将我的参考书目转换为列表\bibitem。我按照网上的建议检查了.bbl文件,但结构似乎非常复杂,而且没有\bibitem提到任何内容。我在网上找到了一些方法,通过创建一个虚拟文件,我设法使该方法适用于我的情况.tex

\documentclass{article}
\begin{document}
\nocite{*}
sdryfj
\bibliography{BIB.testbib.bib}
\bibliographystyle{plain}
\cite{NumR}
\end{document}

我运行了一些编译,得到了一个.bbl包含 s 列表的文件\bibitem。我以为我看到了它的结尾,并将此列表粘贴到thebibliography文档末尾的环境中。

不幸的是,我的所有引用参考文献(\autocite等等)似乎都与这种不同的参考书目输入方式不兼容。此外,所有参考文献都打印出来了,有的没有引用……

我想知道是否有办法直接从中获得相同的结果,biber biblatex这样我就不必过多地修改我的文档......

感谢您的帮助,

Xochitl C.

PS:我也尝试过重新定义这样的命令,但是没有用:

\renewcommand{\autocite}{\cite}

\renewcommand{\citeauthor}{\cite}

\renewcommand{\citeyear}{\cite}

\renewcommand{\textcite}{\cite}

答案1

我找到了一个或多或少复杂的解决方法,希望至少能帮到你一点。考虑一下这个 MWE,我会称之为main.tex

\begin{filecontents}{\jobname.bib}
@BOOK{testA,
author = {A. Uthor},
title = {A title},
year = {2014},
publisher = {A Company}
}
@BOOK{testB,
author = {B. Uthor},
title = {B title},
year = {2014},
publisher = {B Company}
}
@BOOK{testC,
author = {C. Uthor},
title = {C title},
year = {2014},
publisher = {C Company}
}
@BOOK{testD,
author = {D. Uthor},
title = {D title},
year = {2014},
publisher = {D Company}
}
\end{filecontents}

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[style=authoryear,
            firstinits=true,
            uniquename=false,
            uniquelist=false,
            maxcitenames=2,
            maxbibnames=7,
            backend=biber]{biblatex}
\addbibresource{\jobname.bib}

\begin{document}
Initial order in the bib file was A, B, C and D.

We will cite D\cite{testD} first, then A\cite{testA} and B\cite{testB} and C not at all.

You can refer to A\cite{testA} again.

    \printbibliography
\end{document}

这将导致

main.tex 的输出

我假设您的文档可以顺利编译,因此您可以运行以下命令:

biber --output_format=bibtex main[.bcf]

这将创建一个文件main_biber.bib,其中所有参考文献都按照您选择的 biblatex 样式进行排序。比较这里

然后创建以下dummy.tex文件:

\documentclass{article}
\begin{document}
\nocite{*}
\bibliography{main_biber.bib}
\bibliographystyle{unsrt}
\end{document}

注意:main_biber.bib是自动创建的。用于unsrt保持 biber 创建的顺序。请参阅这里

运行以下命令:pdflatex dummy;bibtex dummy

另请参阅这里

dummy.bbl这将创建一个bibitem 格式的文件。清除main.tex所有 biblatex 内容的初始值并附加dummy.bbl。为方便起见,它将被调用newmain.tex并应如下所示:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\begin{document}
Initial order in the bib file was A, B, C and D.

We will cite D\cite{testD} first, then A\cite{testA} and B\cite{testB} and C not at all.

You can refer to A\cite{testA} again.

\begin{thebibliography}{1}

\bibitem{testD}
D.~Uthor.
\newblock {\em D title}.
\newblock D Company, 2014.

\bibitem{testA}
A.~Uthor.
\newblock {\em A title}.
\newblock A Company, 2014.

\bibitem{testB}
B.~Uthor.
\newblock {\em B title}.
\newblock B Company, 2014.

\end{thebibliography}

\end{document}

然后它将变为数字引用顺序,但我认为这将由期刊编辑处理。运行 pdflatex(至少两次),您将获得:

newmain.tex 的输出

然后您的文件就可以提交了。

答案2

为了支持接受的答案,我只想添加一个测试文件以供参考。

bibtex基本上,可以使用“纯文本” 、biblatex使用bibtex后端或biblatex使用后端来编译参考书目biber。 在这三种情况下.bbl都会生成一个文件 - 但在这三种情况下,文件的格式.bbl不同!

\bibitem仅当使用.bbl“plain”时才会出现在文件中。(使用、等)bibtexbiblatex\entry\strng\field

在这个特定的测试文件中,当biblatex- 但有轻微的差异(例如标题中的引号和大写字母,“在:”...)在“普通” bibtex(左)和biblatex输出(右,单击可获得完整分辨率)之间:

bibtest_01_plainbibtex bibtext_02_biblatex

测试文件是这样的,我们称之为bibtest.tex

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}

@book{smith1,
  author={John Smith and Mike Someone},
  title={The book with a very very very very very long title},
  year={2006},
  location={New York},
  publisher={Publisher},
}

@article{audactor2005pflanzen,
  title = {Wie Pflanzen hören... die Geheimnisse der Sonobotanik},
  author = {Prof. Dr. Hortensia Audactor},
  journal = {Draft: \url{http://www.inventionen.de/2005/sonobotanik.html}},
  year = {2005}
}

\end{filecontents*}

\usepackage[utf8]{inputenx}
\usepackage[T1]{fontenc}
\usepackage{hyperref}

% btype: 1: bibtex ; 2: biblatex+bibtex ; 3: biblatex+biber
\ifx\btype\undefined %
  \def\btype{1} %
\fi
\ifnum\btype=2 %
  \usepackage[url=true,backend=bibtex]{biblatex} %
  \bibliography{\jobname} %
\fi
\ifnum\btype=3 %
  \usepackage[url=true,backend=biber]{biblatex} %
  \bibliography{\jobname} %
\fi

\begin{document}

Just testing the bibliography: the book \cite{smith1}, and the article \cite{audactor2005pflanzen}.

\ifnum\btype=1 %
  \bibliographystyle{plain}         % Style BST file
  \bibliography{\jobname}           % Bibliography file ('*.bib' )
\else % \btype=2 or 3
  %\bibliography{\jobname}           % for biblatex, only in preamble!
  \printbibliography %
\fi

\end{document}

% clean: rm $(ls --hide=*.tex)

以下是编译的步骤和结果:

平原bibtex

# \btype=1
pdflatex bibtest.tex  # creates: .aux, .bib, .log, .out, .pdf
bibtex bibtest        # creates: .bbl, .blg
pdflatex bibtest.tex
pdflatex bibtest.tex

生成的bibtest.bbl文件为:

\begin{thebibliography}{1}

\bibitem{audactor2005pflanzen}
Prof. Dr.~Hortensia Audactor.
\newblock Wie pflanzen hören... die geheimnisse der sonobotanik.
\newblock {\em Draft: \url{http://www.inventionen.de/2005/sonobotanik.html}},
  2005.

\bibitem{smith1}
John Smith and Mike Someone.
\newblock {\em The book with a very very very very very long title}.
\newblock Publisher, 2006.

\end{thebibliography}

2.biblatex后端bibtex

pdflatex "\def\btype{2}\input{bibtest.tex}" # creates: .aux, .bib, -blx.bib, .log, .out, .pdf, .run.xml
bibtex bibtest                              # creates: .bbl, .blg
pdflatex "\def\btype{2}\input{bibtest.tex}" # biblatex Warning: Data encoding is 'utf8'. Use backend=biber.

生成的bibtest.bbl文件为:

% $ biblatex auxiliary file $
% $ biblatex version 1.7 $
% Do not modify the above lines!
%
% This is an auxiliary file used by the 'biblatex' package.
% This file may safely be deleted. It will be recreated as
% required.
%
\begingroup
\makeatletter
\@ifundefined{[email protected]}
  {\@latex@error
     {Missing 'biblatex' package}
     {The bibliography requires the 'biblatex' package.}
      \aftergroup\endinput}
  {}
\endgroup

\entry{audactor2005pflanzen}{article}{}
  \name{author}{1}{}{%
    {{}%
     {Audactor}{A.}%
     {Prof. Dr.~Hortensia}{P.~D.~H.}%
     {}{}%
     {}{}}%
  }
  \strng{namehash}{APDH1}
  \strng{fullhash}{APDH1}
  \field{sortinit}{A}
  \field{title}{Wie Pflanzen hören... die Geheimnisse der Sonobotanik}
  \field{journaltitle}{Draft:
  \url{http://www.inventionen.de/2005/sonobotanik.html}}
  \field{year}{2005}
\endentry

\entry{smith1}{book}{}
  \name{author}{2}{}{%
    {{}%
     {Smith}{S.}%
     {John}{J.}%
     {}{}%
     {}{}}%
    {{}%
     {Someone}{S.}%
     {Mike}{M.}%
     {}{}%
     {}{}}%
  }
  \list{publisher}{1}{%
    {Publisher}%
  }
  \strng{namehash}{SJSM1}
  \strng{fullhash}{SJSM1}
  \field{sortinit}{S}
  \field{title}{The book with a very very very very very long title}
  \list{location}{1}{%
    {New York}%
  }
  \field{year}{2006}
\endentry

\lossort
\endlossort

\endinput

2.biblatex后端biber

pdflatex "\def\btype{3}\input{bibtest.tex}" # creates: .aux, .bcf, .bib, .log, .out, .pdf, .run.xml
LANG=en_US.UTF-8 biber bibtest              # creates: .bbl, .blg
pdflatex "\def\btype{3}\input{bibtest.tex}"

生成的bibtest.bbl文件为:

% $ biblatex auxiliary file $
% $ biblatex version 1.7 $
% $ biber version 0.9.9 $
% Do not modify the above lines!
%
% This is an auxiliary file used by the 'biblatex' package.
% This file may safely be deleted. It will be recreated by
% biber or bibtex as required.
%
\begingroup
\makeatletter
\@ifundefined{[email protected]}
  {\@latex@error
     {Missing 'biblatex' package}
     {The bibliography requires the 'biblatex' package.}
      \aftergroup\endinput}
  {}
\endgroup


\refsection{0}
  \entry{audactor2005pflanzen}{article}{}
    \name{labelname}{1}{}{%
      {{hash=1d15dc798dec1fd384ab9a796ebab9f5}{Audactor}{A\bibinitperiod}{Prof.\bibnamedelimi Dr.\bibnamedelimi Hortensia}{P\bibinitperiod\bibinitdelim D\bibinitperiod\bibinitdelim H\bibinitperiod}{}{}{}{}}%
    }
    \name{author}{1}{}{%
      {{hash=1d15dc798dec1fd384ab9a796ebab9f5}{Audactor}{A\bibinitperiod}{Prof.\bibnamedelimi Dr.\bibnamedelimi Hortensia}{P\bibinitperiod\bibinitdelim D\bibinitperiod\bibinitdelim H\bibinitperiod}{}{}{}{}}%
    }
    \strng{namehash}{1d15dc798dec1fd384ab9a796ebab9f5}
    \strng{fullhash}{1d15dc798dec1fd384ab9a796ebab9f5}
    \field{sortinit}{A}
    \field{journaltitle}{Draft: \url{http://www.inventionen.de/2005/sonobotanik.html}}
    \field{title}{Wie Pflanzen hören... die Geheimnisse der Sonobotanik}
    \field{year}{2005}
  \endentry

  \entry{smith1}{book}{}
    \name{labelname}{2}{}{%
      {{hash=5d0ddda3a367ceb26fbaeca02e391c22}{Smith}{S\bibinitperiod}{John}{J\bibinitperiod}{}{}{}{}}%
      {{hash=51e9bdc59ecfdbdb5cf9ee7ecd37d83f}{Someone}{S\bibinitperiod}{Mike}{M\bibinitperiod}{}{}{}{}}%
    }
    \name{author}{2}{}{%
      {{hash=5d0ddda3a367ceb26fbaeca02e391c22}{Smith}{S\bibinitperiod}{John}{J\bibinitperiod}{}{}{}{}}%
      {{hash=51e9bdc59ecfdbdb5cf9ee7ecd37d83f}{Someone}{S\bibinitperiod}{Mike}{M\bibinitperiod}{}{}{}{}}%
    }
    \list{location}{1}{%
      {New York}%
    }
    \list{publisher}{1}{%
      {Publisher}%
    }
    \strng{namehash}{bdb6caeb721d71d176dbc1db99a48c69}
    \strng{fullhash}{bdb6caeb721d71d176dbc1db99a48c69}
    \field{sortinit}{S}
    \field{title}{The book with a very very very very very long title}
    \field{year}{2006}
  \endentry

\endrefsection
\endinput

相关内容