0

I just start to use elegantbook. But the macro always ask for reference.bib as the source of citation reference, whereas my Medeley always generate library.bib. Both cannot allow file name change. How can I change the reference.bib of elegantbook?

nana
  • 23
  • 1
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Oct 16 '21 at 02:42
  • you could add your resources with a label \addbibresource[label=main]{library.bib} and then start your document with \refsection[main]. But personally I wouldn't recommend such a template. It is better to copy the parts you like and build your own template. https://tex.stackexchange.com/a/391022/2388 – Ulrike Fischer Oct 16 '21 at 19:41

1 Answers1

1

Try changing \addbibresource[location=local]{reference.bib} (found in elegantbook.cls, line 1102) to \addbibresource[location=local]{library.bib}.

There are probably other ways to override this, too, but this should work.

Ingmar
  • 6,690
  • 5
  • 26
  • 47
  • I tried ...no use... – nana Oct 16 '21 at 05:06
  • @nana You will have to rerun the compilation cycle LaTeX, Biber, LaTeX, LaTeX after the change (here "LaTeX" stands for the appropriate flavour of LaTeX and can be pdfLaTeX, LuaLaTeX, XeLaTeX, ...). See https://tex.stackexchange.com/q/154751/35864 for help on configuring your editor for Biber (in case you haven't set it up for Biber and it still runs BibTeX for you). – moewe Oct 16 '21 at 07:42
  • 1
    That said, a class file that hard-codes the .bib file name is quite inflexible and not what I would consider best practice. – moewe Oct 16 '21 at 07:45
  • I have re-run for several times. The error message is still the same "cannot find reference.bib" – nana Oct 16 '21 at 07:49
  • I investigated the source code of elegantbook myself. The reference.bib is added using \addbibresource[location=local]{reference.bib}. There is no way to change or remove this command unless I modify the source code. I have to conclude this package is pretty stupid. – nana Oct 16 '21 at 08:01