1

I recently started learning LaTeX for the sheer beauty of it. As much as my document looks pretty my code is ugly as hell. I'm using Kile on Windows 10, and BiblateX with BibteX backend (dropped the idea of using biber after it didn't work; I tried everything suggested here).

Here's what happend; I added another bibliography entry (had 8 before, even one in another footnote and it worked fine) in a footnote and pdfLatex gave error "finished with exit code1". After working on the problem for a while, found out that if I suppress \printbibliography (by adding %) it works fine again and even prints correct citation number [9] in the footnote. I use the pdfLaTex>BibTex>pdfLaTex sequence. I can't figure out what's wrong or even where the problem is (footnote? citation? \printbibliography command? or the .bib file?)

Here's my MWE;

\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage{courier}
\usepackage[bottom]{footmisc}
\usepackage{xcolor,xfrac,lmodern,graphicx,mathtools}
\usepackage{etoolbox,fancyhdr,float,wrapfig,amsmath}
\everymath{\displaystyle}
\apptocmd{\thebibliography}{\csname phantomsection\endcsname\addcontentsline{toc}{chapter}{\bibname}}{}{}
\graphicspath{{images/}}
\usepackage[font={rm,footnotesize,sl,color={darkgray}},labelfont={bf,color=black}]{caption}
\usepackage[font={rm,footnotesize,it}]{subcaption}
 \usepackage[a4paper,width=150mm,top=25mm,bottom=25mm]{geometry}
 \usepackage[style=nature,sorting=none,bibencoding=ascii,backend=bibtex]{biblatex}
 \addbibresource{refer.bib}
 \usepackage[nottoc]{tocbibind}
 \setlength{\parskip}{1em}
 \renewcommand{\thefootnote}{\alph{footnote}}
 \emergencystretch=1em
 \pagestyle{plain}
 \begin{document}
 \frontmatter 
\tableofcontents
\mainmatter
This is a test sentence.
\footnote{Obviously fake footnote.\protect\cite{tape}}
\renewcommand\bibname{References}
\printbibliography[heading=bibintoc]
\end{document}

I would appreciate any help. For sake of brevity I'm adding four entries of refer.bib file. I just noticed that first three @Article entries appear blue while the rest are red. What does this mean?

@Article{g,
author = {Jonas Gienger and Nikolai Severin and J\"{u}rgen P. Rabe and  Igor M. Sokolov},
title = {Reconstructing Interaction Potentials in Thin Films from   Real-Space Images},
journal = {arxiv},
year = {2015},
  }
@Article{sev,
author = {Nikolai Severin and Jonas Gienger and V. Scenev and P. Lange and Igor M. Sokolov and J\"{u}rgen P. Rabe},
title = {Nanophase Separation in Monomolecularly Thin Water-Ethanol Films Controlled by Graphene},
journal = {Nano Letters},
year = {2015},
}
 @Article{NG,
  author = {K. S. Novoselov and A. K. Geim and S. V. Morozov and D. Jiang and Y. Zhang and S. V. Dubonos and I. V. Grigorieva and A. A. Firsov},
 title = {Electric Field Effect in Atomically Thin Carbon Films},
 journal = {Sceince},
  year = {2004},
}
 @Article{tape,
 author = {Carlos G. Camara and Juan V. Escobar and Jonathan R. Hird1 and Seth J. Putterman},
 title = {Correlation between nanosecond X-ray flashes and stick–slip friction in peeling tape},
  journal = {Nature Letters},
 year = {2008},
  }
Kamoka
  • 11
  • 2
    your "MWE" did not work, missing documentclass and missing } in \usepackage, I fixed that (this time:-) but it still can not be used to reproduce the problem as you have not supplied a refer,bib file so just gives errors. Please add a bib file to your question that causes the error – David Carlisle Jan 14 '16 at 00:52
  • 1
    from the description, it seems that the problem is the last bib record you have inserted (the 9th). – Guido Jan 14 '16 at 02:10
  • I just checked with a .bib file on my machine (biblatex-examples.bib, I cited sigfridsson) and everything worked just fine, so either the issue is with something not in the MWE, or your .bib entry is the culprit. What does it look like? Anyway, I'm not sure the \protect is even needed (it works just fine without), also the \apptocmd{\thebibliography} part is probably unnecessary if you use the right options. – moewe Jan 14 '16 at 09:00
  • Okay, I added a short version of my .bib file. the fourth item is the 9th reference I added in original file. Thanks for the quick response. I noticed after first three entries the color changed from blue to red. Is this idication of some problem? – Kamoka Jan 14 '16 at 15:34
  • I can't reproduce any error with the new .bib file. Does the exact code above with the exact same .bib file reproduce the error for you (please check in a clean directory)? I'm not sure what colours you are talking about, but an unexpected (and apparently unexplained) change in colour would certainly make me suspicious of what is going on. – moewe Jan 14 '16 at 18:25
  • @moewe: I made a new project in a different directory and copied the exact same code for new .tex and .bib files. And it required vertex package, which the original file does not. I didn't download the package; repository is not online at the moment. I tried to compile the new files anyway and it completed compilation with "undefined reference" warnings as if it cannot read the .bib file. – Kamoka Jan 14 '16 at 21:53
  • @moewe: Ok, there's more to the story. Once I get this error "pdflatex exit code1" I need to supress \printbibliograhy command with % in order to generate the document without error again(and without bibliography of course). However, once I remove % and compile again, it gives the error again but also generates the document correctly with references and bibliography in place. Strange. But I hope it helps to solve the problem. – Kamoka Jan 14 '16 at 22:06
  • 1
    @moewe: I transferred all my project to ShareLaTex without changes, and it compiled flawlessly. Also found this link, it addresses same (or similar) problem. I guess the issue is with Kile; my code is okay. Still would love to hear your thoughts on this. – Kamoka Jan 14 '16 at 22:32
  • Mhhh, I don't see why the code above would need the vertex package. It has some generically named files though, and it could be that you need a file with the same name in your example which is not found, and then TeX initiates the package download sequence. Maybe your TeX distribution is too old, update it (see here for MikTeX). Unfortunately, your link above goes to example.com ... – moewe Jan 15 '16 at 07:05
  • @moewe I'll try to update MikTeX installation, thanks. Here's the link again http://tex.stackexchange.com/questions/165112/why-does-the-pdf-file-is-successfully-generated-while-the-compilation-ends-with – Kamoka Jan 15 '16 at 11:21
  • The problem persists even after I updated MikTex. Compilation successfully completes if I remove \printbibliography; after this I put \printbibliography command again and compile. This generates the correct pdf file (with references and everything) but Kile shows there's an error. I have moved my project to ShareLatex now. But still, would love to work with Kile – Kamoka Jan 21 '16 at 10:55
  • Then please give more information about the problem. Try and narrow down the error even more, make sure it is not about old aux files (.aux, .bcf, .bbl). Check the actual error message you get (.log) file etc. It is really hard to debug the problem if the code does not throw an error at your end, this really suggests something is wrong with your installation (it is too old, packages are missing, etc.) or there is other code that we cannot see. – moewe Jan 22 '16 at 07:22
  • Are there any news here? As stated before, the MWE does not reproduce the error, so there is something else going on. We need additional information to help here. Currently the question is very unclear. – moewe Feb 14 '16 at 09:58
  • 1
    I voted to close as "unclear what you are asking" since the code does not reproduce any problems and works just fine. – moewe Feb 22 '16 at 18:28

0 Answers0