wdbibtex.LaTeX.bibliographystyle#

property LaTeX.bibliographystyle#

Bibliographystyle string.

Bibliography string. If None is set, a .bst is automatically selected. The bibliography string is, for example, SomeBST of \bibliographystyle{SomeBST}. While the formatted_bibliographystyle is \bibliographystyle{SomeBST}.

Raises:
ValueError

If bst is None and there is no or multiple .bst files in cwd.

See also

formatted_bibliographystyle

formatted line to be written in preamble

Examples

>>> import wdbibtex
>>> tx = wdbibtex.LaTeX()
>>> tx.bibliographystyle = 'IEEEtran'
>>> tx.bibliographystyle
'IEEEtran'
>>> tx.formatted_bibliographystyle
'\\bibliographystyle{IEEEtran}'

In the case of None and no .bst file is found, raise ValueError.

>>> import wdbibtex
>>> tx = wdbibtex.LaTeX()
>>> tx.bibliographystyle = None
Traceback (most recent call last):
...
ValueError: No .bst files found in working directory.

In the case of None and some .bst file is in the working directory, the .bst file is automatically selected.

>>> import wdbibtex
>>> import pathlib
>>> import shutil
>>> shutil.rmtree('.tmp', ignore_errors=True)
>>> tx = wdbibtex.LaTeX(workdir='.tmp')
>>> pathlib.Path('.tmp/testbst.bst').touch()
>>> tx.bibliographystyle = None
>>> tx.bibliographystyle
'testbst'
>>> tx.formatted_bibliographystyle
'\\bibliographystyle{testbst}'