Getting started#
Installation#
Binary installers for the latest released version are available at the Python Package Index (PyPI): https://pypi.org/project/wdbibtex
You can install wdbibtex package via pip command.
pip install -U wdbibtex
Dependencies#
Windows OS, for pywin32
pywin32>=302, for operating MS Word
regex>=2022.6.2, for converting LaTeX string to text
TeX Live 2022, for building LaTeX file
Usage#
Let target Word file name be file.docx
.
Confirm you can build LaTeX project with basic
latex->bibtex->latex->latex
scheme. (This is out of scope of this project.)Copy your
.bib
and.bst
to same directory withfile.docx
.Write your docx file with LaTeX citations keys of
\cite{key}
and\thebibliography
label.On the shell, change directory to the
file.docx
’s directory.Execute:
$ python -m wdbibtex file.docx
If wdbibtex works correctly, you can see
file_bib.docx
. LaTeX citation keys of\cite{key}
and\thebibliography
will be converted to[1]
and[1] A. Name, "Title", Journal, vol...
(for example).
Command line options#
Module exexution of WdBibTeX accepts one positional argument and five optional arguments as follows.
usage: python -m wdbibtex [-h] [--bst BST] [--bib BIB] [--updatetoc] [--keeptexdir] [--exportpdf] file
Positional Arguments#
- file
File to BibTeX format.
Named Arguments#
- --bst
BibTeX style file. Default: .bst in target file directory
- --bib
Bibliography file. Default: all .bib in target file directory
- --updatetoc
Update table of contents after LaTeX compilation. Default: False
Default: False
- --keeptexdir
Keep LaTeX files and directory after run. Default: False(= clean LaTeX files/directory)
Default: False
- --exportpdf
Export compiled docx to pdf. Default: False
Default: False