# Biblatex for Nature Publishing Group submission: folding everything into a single tex file

This is a follow up question to Biblatex: submitting to a journal and to Biblatex: include bbl, problem with "verb" field.

I am using the biblatex nature style, which uses \verb a lot, resulting in compilation errors when using this solution. I tried Ulrike's solution, but the code generates no bibliography whatsoever with pdfLaTeX/Biber (TeXLive 2016). It does, beautifully, if references are stored in bib files and included via \addbibresource{}. A MWE is appended to illustrate this problem.

I am not sure if the "all tex" failure is caused by some of the biblatex options I use; most of them seem necessary to meet the journal's specifications, but maybe not all. I have >700 references so @Herbert's manual formatting fix is impractical.

I'd be grateful for any insight on how to make this work. The journal, unfortunately, won't accept any bibtex or biblatex auxiliary files.

\documentclass[english]{article}
\usepackage{babel}
\usepackage{amsmath,url}
\usepackage{graphicx,fancyhdr,lineno}
\usepackage{filecontents}

\usepackage[style=nature,date=year,backend=biber,natbib=true,doi=false,defernumbers=true]{biblatex}

\AtEveryBibitem{\clearfield{issue}}
\AtEveryBibitem{\clearfield{issn}}
\AtEveryCitekey{\clearfield{issn}}
\AtEveryBibitem{\clearfield{isbn}}
\AtEveryCitekey{\clearfield{isbn}}
\DeclareCiteCommand{\citenum}
{}
{\printfield{labelnumber}}
{}
{}

% define bib resources
\begin{filecontents}{mybib.bbl}
\refsection{0}
\sortlist{entry}{nty}
\entry{A1}{article}{}
\name{author}{1}{}{%
{{hash=6336f16c9082808449bbd32fdb646d7e}{%
family={{\relax PAGES2k Consortium}},
familyi={{\relax PAGES2k Consortium}\bibinitperiod}}}%
}
\list{publisher}{1}{%
}
\strng{namehash}{6336f16c9082808449bbd32fdb646d7e}
\strng{fullhash}{6336f16c9082808449bbd32fdb646d7e}
\strng{authornamehash}{6336f16c9082808449bbd32fdb646d7e}
\strng{authorfullhash}{6336f16c9082808449bbd32fdb646d7e}
\field{sortinit}{5}
\field{sortinithash}{c9df3c9fb8f555dd9201cedc5e343021}
\field{labelnamesource}{author}
\field{labeltitlesource}{title}
\field{isbn}{1752-0894}
\field{journaltitle}{Nature Geoscience}
\field{month}{05}
\field{number}{5}
\field{title}{Continental-scale temperature variability during the past two millennia}
\field{volume}{6}
\field{year}{2013}
\field{pages}{339\bibrangedash 346}
\range{pages}{8}
\verb{doi}
\verb 10.1038/ngeo1797
\endverb
\verb{url}
\verb http://dx.doi.org/10.1038/ngeo1797
\endverb
\endentry
\entry{A2}{online}{}
\name{author}{1}{}{%
{{hash=6190cb5961651414f637857f879c5cb3}{%
family={{\relax PAGES 2k Consortium}},
familyi={{\relax PAGES 2k Consortium}\bibinitperiod}}}%
}
\strng{namehash}{6190cb5961651414f637857f879c5cb3}
\strng{fullhash}{6190cb5961651414f637857f879c5cb3}
\strng{authornamehash}{6190cb5961651414f637857f879c5cb3}
\strng{authorfullhash}{6190cb5961651414f637857f879c5cb3}
\field{sortinit}{6}
\field{sortinithash}{02bbed3ed82f61ae046619460488516d}
\field{labelnamesource}{author}
\field{labeltitlesource}{title}
\field{howpublished}{FigShare}
\field{title}{A really nice data citation}
\field{urlyear}{2017}
\field{urldateera}{ce}
\verb{doi}
\verb 10.6084/123.456mwe
\endverb
\verb{url}
\verb https://figshare.com/s/12345678
\endverb
\endentry
\endsortlist
\endrefsection
\end{filecontents}

%-------------- start insert modified commands ------------------
\makeatletter
\def\blx@bblfile@biber{%
\blx@secinit
\begingroup
\blx@bblstart
\input{mybib.bbl}%<------------
\blx@bblend
\endgroup
\csnumgdef{blx@labelnumber@\the\c@refsection}{0}}
\makeatother
%-------------- end insert modified commands ------------------
\begin{document}
In this paper, we have regular citations \cite{A1} and data citations \cite{A2}. Both are important.

% %%%%%%%%%   Citations %%%%%%%%%%%%%%%%%
\printbibliography[title={References},nottype=online,resetnumbers=true]
\printbibliography[title={Data citations},type=online,resetnumbers=true]
\end{document}


The internal command of biblatex have changed. \blx@bblfile@biber no longer exists. You could try the following instead.

1. Use the filecontents* environment instead of filecontents.
3. Use the following redefinition

\makeatletter
\def\blx@bblinput{%
\begingroup
\blx@blxinit
\blx@bblfile
\endgroup}
\makeatother

• Thanks @Ulrike. I'm getting "LaTeX Error: File filecontents*.sty' not found." @moewe's solution works great, however. – El Niño Apr 6 '17 at 20:22
• I didn't wrote use the filecontents* package but the environment so change \begin{filecontents}. – Ulrike Fischer Apr 6 '17 at 20:30
• That's what I did, and it produced the aforementioned error. – El Niño Apr 6 '17 at 23:10
• No your error message cleary shows that you tried \usepackage{filecontents*} . That's wrong the package name is still filecontents. Only the environment should change and use a star (to avoid that LaTeX adds a comment at the begin). And while @moewe's solution work, I prefer mine as it will also do the necessary version checks and warn you if the bbl has not the format needed by the biblatax version. – Ulrike Fischer Apr 7 '17 at 6:56
• I edited my old answer to show a complete example. – Ulrike Fischer Apr 7 '17 at 7:24

You want

\makeatletter
\def\blx@bblfile{%
\blx@secinit
\begingroup
\blx@bblstart
\input{mybib.bbl}%
\blx@bblend
\endgroup
% global sorting as this is called at BeginDocument
\csnumgdef{blx@labelnumber@\the\c@refsection}{0}}
\makeatother


Note that the internal command has been renamed.

You also want to copy a .bbl file in the proper format. For biblatex 3.7/Biber 2.7 with your settings that is

\documentclass[english]{article}
\usepackage{babel}
\usepackage{amsmath,url}
\usepackage{graphicx,fancyhdr,lineno}
\usepackage{filecontents}

\usepackage[style=nature,date=year,backend=biber,natbib=true,doi=false,defernumbers=true]{biblatex}

\AtEveryBibitem{\clearfield{issue}}
\AtEveryBibitem{\clearfield{issn}}
\AtEveryCitekey{\clearfield{issn}}
\AtEveryBibitem{\clearfield{isbn}}
\AtEveryCitekey{\clearfield{isbn}}
\DeclareCiteCommand{\citenum}
{}
{\printfield{labelnumber}}
{}
{}

% define bib resources
\begin{filecontents}{mybib.bbl}
\refsection{0}
\sortlist[entry]{none/global/}
\entry{A1}{article}{}
\name{author}{1}{}{%
{{hash=6336f16c9082808449bbd32fdb646d7e}{%
family={{\relax PAGES2k Consortium}},
familyi={{\relax PAGES2k Consortium}\bibinitperiod}}}%
}
\list{publisher}{1}{%
}
\strng{namehash}{6336f16c9082808449bbd32fdb646d7e}
\strng{fullhash}{6336f16c9082808449bbd32fdb646d7e}
\strng{authornamehash}{6336f16c9082808449bbd32fdb646d7e}
\strng{authorfullhash}{6336f16c9082808449bbd32fdb646d7e}
\field{sortinit}{5}
\field{sortinithash}{c9df3c9fb8f555dd9201cedc5e343021}
\field{labelnamesource}{author}
\field{labeltitlesource}{title}
\field{isbn}{1752-0894}
\field{journaltitle}{Nature Geoscience}
\field{month}{05}
\field{number}{5}
\field{title}{Continental-scale temperature variability during the past two millennia}
\field{volume}{6}
\field{year}{2013}
\field{pages}{339\bibrangedash 346}
\range{pages}{8}
\verb{doi}
\verb 10.1038/ngeo1797
\endverb
\verb{url}
\verb http://dx.doi.org/10.1038/ngeo1797
\endverb
\endentry
\entry{A2}{online}{}
\name{author}{1}{}{%
{{hash=6190cb5961651414f637857f879c5cb3}{%
family={{\relax PAGES 2k Consortium}},
familyi={{\relax PAGES 2k Consortium}\bibinitperiod}}}%
}
\strng{namehash}{6190cb5961651414f637857f879c5cb3}
\strng{fullhash}{6190cb5961651414f637857f879c5cb3}
\strng{authornamehash}{6190cb5961651414f637857f879c5cb3}
\strng{authorfullhash}{6190cb5961651414f637857f879c5cb3}
\field{sortinit}{6}
\field{sortinithash}{02bbed3ed82f61ae046619460488516d}
\field{labelnamesource}{author}
\field{labeltitlesource}{title}
\field{howpublished}{FigShare}
\field{title}{A really nice data citation}
\field{urlyear}{2017}
\field{urldateera}{ce}
\verb{doi}
\verb 10.6084/123.456mwe
\endverb
\verb{url}
\verb https://figshare.com/s/12345678
\endverb
\endentry
\endsortlist
\endrefsection
\endinput
\end{filecontents}

%-------------- start insert modified commands ------------------
\makeatletter
\def\blx@bblfile{%
\blx@secinit
\begingroup
\blx@bblstart
\input{mybib.bbl}%
\blx@bblend
\endgroup
% global sorting as this is called at BeginDocument
\csnumgdef{blx@labelnumber@\the\c@refsection}{0}}
\makeatother
%-------------- end insert modified commands ------------------
\begin{document}
In this paper, we have regular citations \cite{A1} and data citations \cite{A2}. Both are important.

% %%%%%%%%%   Citations %%%%%%%%%%%%%%%%%
\printbibliography[title={References},nottype=online,resetnumbers=true]
\printbibliography[title={Data citations},type=online,resetnumbers=true]
\end{document}


Note the \sortlist[entry]{none/global/}.

• Thanks much @moewe. The example compiles perfectly on my system. One quick question: what did mean by "formatted correctly"? In other words, what was incorrect about my formatting? I ask because the bbl I have is >20,000 lines, so reformatting manually isn't practical. Automated solutions, however, would work. – El Niño Apr 6 '17 at 20:18
• @ElNiño Compare the \sortlist[entry]{none/global/} from my .bbl to the \sortlist{entry}{nty} of your .bbl. There are two things here: (1) the .bbl format changes from version to version, in my version (the most recent 3.7) entry is optional, in your example it was not. That caused errors on my machine. biblatex can only accept .bbl versions that were created by a compatible Biber version. (2) was the sorting, your example specified nty in the .bbl, but the style you uses requests none, so things only work of the sorting in the .bbl is none` as well. – moewe Apr 7 '17 at 6:39
• Thanks for the clarifications, @moewe. I got your solution to work with 700 references, copying & pasting from a bbl file generated with the same version of biber. Thanks again for getting me out of this bind. – El Niño Apr 9 '17 at 5:56

I have posted another technique that requires less black magic as an answer in Biblatex: submitting to a journal