fchauvel / flap

Flattening LaTeX projects
https://fchauvel.github.io/flap
GNU General Public License v3.0
17 stars 2 forks source link

handle bibtex #18

Open Ohjeah opened 7 years ago

Ohjeah commented 7 years ago

latexpand has a subcommand to copy the contents of a .bbl and replace the corresponding bibtex command in your .texfile:

latexpand --expand-bbl merged.bbl merged.tex

If you point me in the right direction I am happy to help with this.

fchauvel commented 7 years ago

Thanks for your help.

FLaP (in v0.4.1) should already moves around the .bib files referred by the '\bibliography' directive. From the top of my head, the simplest fix would be the modify the extensions that FLaP searches for in bibliography.py (see lines 37-38). These extensions are ordered by priority.

Note that the source code has diverged from v0.4.1 as I am working on a new version that is not based on regular expressions anymore, but on a LaTeX parser instead.

Ohjeah commented 7 years ago

I do not want to move the bib file.

If the bib file is already compiled, I want to replace the \bibliography and \bibliographystyle with the content of the corresponding bbl file.

fchauvel commented 7 years ago

In that case, I think we must create a new substitution for \bibliography directives, somehow similar to the FileSubstitution ones that match \input or \include for instance (see files.py, line 25).

Then, we must include this new substitution in the "substitution pipeline" so at it gets triggered appropriately (see factory.py, line 27).

Finally, we must update the command line parsing so at it recognises an option and update the pipeline accordingly (see ui.py line 121).

Ohjeah commented 7 years ago

Thank you. I will have a look at this over the weekend.