Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Biblatex and biber support. #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AdamGagorik
Copy link
Contributor

I added biblatex and biber changes based on:

I can't figure out how to run the tests. For my latex projects that are using biblatex and biber, it is working just fine.
Should probably test it to make sure it works still with plain bibtex.

Test

Ubuntu 14.10

Makefile.ini

neverclean      := *.pdf
onlysources.tex := main.tex
BUILD_STRATEGY  := pdflatex
use_biblatex    := 1

main.bib

@Article{Gagorik:2013:36,
  Title   = {{Monte Carlo} Simulations of Charge Transport in {2D} Organic Photovoltaics},
  Author  = {Gagorik, Adam G. and Mohin, Jacob W. and Kowalewski, Tomasz and Hutchison, Geoffrey R.},
  Journal = {J. Phys. Chem. Lett.},
  Year    = {2013},
  Number  = {1},
  Pages   = {36--42},
  Volume  = {4},
  Doi     = {10.1021/jz3016292},
  Eprint  = {http://dx.doi.org/10.1021/jz3016292},
  File    = {:./pdfs/Gagorik_2013_36.pdf:PDF},
}

main.tex

\documentclass{article}

\usepackage[%
    backend      = biber,
    style        = chem-acs,
    autocite     = superscript,
    articletitle = false
]{biblatex}
\addbibresource{./main.bib}
\let\cite\autocite

\begin{document}
%
    \section{Test}
        Here is a citation~\cite{Gagorik:2013:36}.
%
    \printbibliography
%
\end{document}

@shiblon
Copy link
Owner

shiblon commented Jan 21, 2015

Hey, thanks a lot for putting together a patch for this! I have a couple of comments (you can think of them as questions, too, really) that I'd like to discuss before merging this.

  • If you can, it would be really helpful to comment the sed file that you wrote so that others can see what the intent is as they look at it later.
  • The tests are actually fairly hard to run - they mostly just verify that your sed is doing what you expect. Basically I generate all of the golden files and then use git diff to see whether anything changed. It's pedestrian, but it lets me know if I messed something up with my sed scripts. Unfortunately there aren't good tests for the rest of the build process.
  • If you could double-check that your indentation is the same as the surrounding context, that would be great. You may need to expose tabs to see how it is off (you can plainly see some of it in the diffs).
  • I wonder if we could make this selection more automatic. Since the inclusion of biblatex triggers this, it seems like we could devise a way of detecting that without forcing the user to set a variable. If you look at how beamer is triggered, or how paper size is handled, you might get an idea of what I mean. Basically, I have some sed scripts that look through the document for either special comments or common includes, and use that to trigger different behavior. It makes for a nice user experience when it works. I would be interested in hearing your thoughts on that.

@AdamGagorik
Copy link
Contributor Author

I have fixed the tabs and spacing, as well as added comments on the sed commands.

Running [pdf|xe|lua]latex on *.tex that has \usepackage{biblatex} with backend=biber produces a *.bcf file. Maybe you could look for that file to automatically decide to use biber.

If backend=bibtex, then no *.bcf file is produced and normal bibtex toolchain is needed.

@shiblon
Copy link
Owner

shiblon commented Jan 22, 2015

Hmm, that's an interesting idea, looking for the .bcf file. I believe, but would need to do some research to verify this, that you can specify multiple rules for a single target in such a way that any of them would satisfy it. The double-colon rule is not quite what I'm thinking of, but it might be made to work in this way. If you're aware of anything that works that way, that would be helpful. Meanwhile, I'll give it some more thought.

As a general rule, it is not all that easy to make dependencies based on files that will be created, since the dependency tree is a static thing in make (with the exception of pulling in generated .d files and causing make to run again as a result of their creation, which is another mechanism we can probably use for this).

@AdamGagorik
Copy link
Contributor Author

Other ideas that come to mind:

  • attempt to run biber *.bcf and bibtex *.aux no matter what, allowing one of them to fail silently
  • use the same mechanism that decides if bibtex needs to run (if there is one?)

@victoredwardocallaghan
Copy link

Any news on this?

@shiblon
Copy link
Owner

shiblon commented Jun 11, 2015

Sorry to be slow to respond. I have not made any progress on this issue (work and life and death and difficulty intervened), but I'm back into it now.

Which means that I'll be quicker to review things. I still don't know how to solve this particular problem, and would be thrilled if someone proposed something that can automatically work.

@rriemann
Copy link

rriemann commented Dec 8, 2016

Any progress since then?

@shiblon
Copy link
Owner

shiblon commented Dec 9, 2016

I haven't had any promising leads on this, no. Since leaving academia, I only use LaTeX sporadically, so it's often hard for me to get my brain back into the game. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants