Skip to main content

package for moving manuscripts from Word to LaTeX

Project description

word2Tex: Citation handling and fixing application

The modules included in this package are cite2Tex and fixBibTex which help with citations when migrating a manuscript into LaTeX.

Installation

pip install word2Tex

cite2Tex

This module can be used as a command-line tool or in python. It goes through a text file and converts citations into LaTeX format (e.g. Viena et al. 2018 --> \cite{Viena2018}). If a bibtex bibliography file is provided then citations will be looked up by author and year and the correct citation key will be used. Additionally, if a bib is provided, citations not found in the bib will be left alone and you will be notified which citations are missing from the bib.

Usage

To use in the command line:

cite2Tex path_to_file.txt -b path_to_bib.bib -o path_to_output_file.txt

the -b and -o flags are optional.

To use in python:

from word2Tex import cite2Tex as c2t
fn = 'path_to_file.txt'
bib_fn = 'path_to_bib.bib' # optional
save_file = 'path_to_save_edited_text.txt' # optional, regardless will always write to a new file

# This will allow you to view all citations in the document and see what they will become
with open(fn) as f:
    matches = c2t.find_matches(f.read(), bib=bib_fn)
#This creates the dataframe matches which you cna view and check

# To convert a file
w2t.citations2Tex(fn, bib=bib, save_file=save_file)

fixBibTex

This module allows correction of citation ID in bibtex files when exported from applications such as EndNote. Citation IDs will be set to AuthorYear using the first authors last name. If there are duplicates with this method then the article's journal initials will be tacked onto the end or an index number to ensure unique IDs.

Usage

To use from command-line:

fixBibTex path_to_bib_file.bib -o output_file.bib

The output file is optional. Regardless this will always save to a new file to avoid dataloss.

In python:

from word2Tex import fixBibTex as fbt
fn = 'path_to_bib_file.bib'
out_fn = 'out_file_path.bib' # optional
fbt.fix_bibtexDB(fn, save_file=out_fn)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

word2Tex-0.0.11.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

word2Tex-0.0.11-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file word2Tex-0.0.11.tar.gz.

File metadata

  • Download URL: word2Tex-0.0.11.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.3.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for word2Tex-0.0.11.tar.gz
Algorithm Hash digest
SHA256 096dcc19486b5339f36a37bac92f15f82a439f7aa7a0bc8c141ea9d1a02e20f7
MD5 76963b50bacb0834075f1287fbe37399
BLAKE2b-256 1c4d4cba0f131d1b45c223e393b6aba04c6fd3c7ad48ccd39a24b45d60877444

See more details on using hashes here.

File details

Details for the file word2Tex-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: word2Tex-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.3.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for word2Tex-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 4c7cb0addbc6db154e96925c54297b587e280389a15c6e3a29bd55c7b8832c5c
MD5 b5bc4f3269b5d6a10971c9a3f14f89a7
BLAKE2b-256 a7fdf99aa0fe8a5101c31615ffd14057c0b4199244dbba6f06779050cdd157fd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page