Skip to main content

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)

Metadata

Release files for word2Tex 0.0.17

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for word2Tex 0.0.17
File Size Uploaded
word2Tex-0.0.17.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for word2Tex 0.0.17
File Interpreter ABI Platform
word2Tex-0.0.17-py3-none-any.whl Python 3 none any Details

Total release size: 15.9 kB

Release files / word2Tex-0.0.17.tar.gz

Download URL word2Tex-0.0.17.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cf20f103ca2074358c51bfd7fc1e338e32676aa1402a72f6a026472c11059c7a
BLAKE2b-256 checksum
How to use checksums
7dda124ec73b263262acdbb91724c4f1b245af88ace68cffb4aa82b9502840a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

Release files / word2Tex-0.0.17-py3-none-any.whl

Download URL word2Tex-0.0.17-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d0da326dd71d291eccc6673c860a9ec8c05ccc715e0db2af0201ae9e85e9b80
BLAKE2b-256 checksum
How to use checksums
2b03febdd91f8eb3cbae8d2960f8ef2edd58503e87645cefd60cc02e5b658de0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

Release history Release notifications | RSS feed

This release

0.0.17 This release

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page