ref2tex


Nameref2tex JSON
Version 0.0.2 PyPI version JSON
download
home_page
SummaryA package that converts inline citation (i.e. (Sahraoui et al. 2023), or [1]) to latex cite command: \cite(bibkeyname)
upload_time2023-03-25 14:28:45
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT License
keywords references biblography latex citation bib
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ref2tex: Covert Inline Citations to Latex Cite Command
## Introduction
Converting inline citations in a Word document to Latex is not an easy task. Even if you have all the references in bibtex, you still need to replace each citation, which requires searching for each reference in the list of bibliography then finding that reference's bibtex entry and getting its key, then finally replacing the citation i.e. [1] to \cite{bibkey}.

This repository contains the code of ref2tex package that automatically  converts inline citations (e.g. [1] or (Sahraoui et al. 2023)) to latex cite command (e.g. \cite{refkey2023}).

Input:
1. File that contains original text with inline citations (.txt or .tex, __NOT__ in .doc or .docx)
2. Text file that contains list of references (bibliography)
3. Bibtex file that contains all bib entries of the references listed in bibliography file

Output:
The original text where inline citations are replaced with \cite commands

## Supported styles
The following styles are supported:

- APA (which uses (AuthorName Year) format)
- IEEE (which uses ([number]) format)

If your source documents is in difference style, converting it to APA or IEEE styles should be straightforward using reference management software such as Mendeley or Endnote.

## Usage
You can directly run the script corresponding to the source citation style, for example, if the source document is using APA style:
```
python ieee2tex.py -i sourceFile -r refsFile -b bibtexFile [-o OutputFile]

-i input file that contains orginal text with inline citations (e.g. [1] for IEEE or (Sahraoui et al. 2023) for APA)
-r txt file that contains a list of references (bibliography)
-b bib file that contains all bib entries of the references listed in bibliography file
-o [optional] the output tex file that will contain the converted inline citations (e.g. \cite{keyX2023}). If not specified, the output file is named output_cited.tex
```
Example:
```
python ieee2tex.py -i myFile.tex -r myRefs.txt -b mybib.bib
```

## Instalation
```
pip install ref2tex
```
```
import ref2tex.ieee2tex as ieee2tex
ieee2tex.ieee2tex('inputRefs.txt','inputFile.tex','bibFile.bib','my_out_file.tex')

```

## Ongoing improvements
- bibtex entry generation, in case it is missing in the provided bibtex library.
- Deep learning based reference identification (author,year,journal/conference ...etc.) rather than parsing
- provide a web-based service for online citation converting

## Licence
Licensed under the MIT license.


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "ref2tex",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "references,biblography,latex,citation,bib",
    "author": "",
    "author_email": "Sahraoui Dhelim <sahraoui.dhelim@hotmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/7a/d4/d079b55a06b0ed3335497a97d753511cc924f32cf4923d9bb64fd4eb3985/ref2tex-0.0.2.tar.gz",
    "platform": null,
    "description": "# ref2tex: Covert Inline Citations to Latex Cite Command\r\n## Introduction\r\nConverting inline citations in a Word document to Latex is not an easy task. Even if you have all the references in bibtex, you still need to replace each citation, which requires searching for each reference in the list of bibliography then finding that reference's bibtex entry and getting its key, then finally replacing the citation i.e. [1] to \\cite{bibkey}.\r\n\r\nThis repository contains the code of ref2tex package that automatically  converts inline citations (e.g. [1] or (Sahraoui et al. 2023)) to latex cite command (e.g. \\cite{refkey2023}).\r\n\r\nInput:\r\n1. File that contains original text with inline citations (.txt or .tex, __NOT__ in .doc or .docx)\r\n2. Text file that contains list of references (bibliography)\r\n3. Bibtex file that contains all bib entries of the references listed in bibliography file\r\n\r\nOutput:\r\nThe original text where inline citations are replaced with \\cite commands\r\n\r\n## Supported styles\r\nThe following styles are supported:\r\n\r\n- APA (which uses (AuthorName Year) format)\r\n- IEEE (which uses ([number]) format)\r\n\r\nIf your source documents is in difference style, converting it to APA or IEEE styles should be straightforward using reference management software such as Mendeley or Endnote.\r\n\r\n## Usage\r\nYou can directly run the script corresponding to the source citation style, for example, if the source document is using APA style:\r\n```\r\npython ieee2tex.py -i sourceFile -r refsFile -b bibtexFile [-o OutputFile]\r\n\r\n-i input file that contains orginal text with inline citations (e.g. [1] for IEEE or (Sahraoui et al. 2023) for APA)\r\n-r txt file that contains a list of references (bibliography)\r\n-b bib file that contains all bib entries of the references listed in bibliography file\r\n-o [optional] the output tex file that will contain the converted inline citations (e.g. \\cite{keyX2023}). If not specified, the output file is named output_cited.tex\r\n```\r\nExample:\r\n```\r\npython ieee2tex.py -i myFile.tex -r myRefs.txt -b mybib.bib\r\n```\r\n\r\n## Instalation\r\n```\r\npip install ref2tex\r\n```\r\n```\r\nimport ref2tex.ieee2tex as ieee2tex\r\nieee2tex.ieee2tex('inputRefs.txt','inputFile.tex','bibFile.bib','my_out_file.tex')\r\n\r\n```\r\n\r\n## Ongoing improvements\r\n- bibtex entry generation, in case it is missing in the provided bibtex library.\r\n- Deep learning based reference identification (author,year,journal/conference ...etc.) rather than parsing\r\n- provide a web-based service for online citation converting\r\n\r\n## Licence\r\nLicensed under the MIT license.\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "A package that converts inline citation (i.e. (Sahraoui et al. 2023), or [1]) to latex cite command: \\cite(bibkeyname)",
    "version": "0.0.2",
    "split_keywords": [
        "references",
        "biblography",
        "latex",
        "citation",
        "bib"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "367f0d1cf237ea5add68386547fb4e95748d491c27887787660e14e85dc9f305",
                "md5": "9a70d532edb1d294d4591807e062b519",
                "sha256": "02c30df8f389d7ea3f3ecdca9c47c88436530e0c561fadd8b4079aee3a0068a2"
            },
            "downloads": -1,
            "filename": "ref2tex-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9a70d532edb1d294d4591807e062b519",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 6098,
            "upload_time": "2023-03-25T14:28:43",
            "upload_time_iso_8601": "2023-03-25T14:28:43.296483Z",
            "url": "https://files.pythonhosted.org/packages/36/7f/0d1cf237ea5add68386547fb4e95748d491c27887787660e14e85dc9f305/ref2tex-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7ad4d079b55a06b0ed3335497a97d753511cc924f32cf4923d9bb64fd4eb3985",
                "md5": "abb318dfb8047b82af2ea7194b215f08",
                "sha256": "0492681c2765d50f9482c5c5c91a35a070178013c313149206266a6a96213b0b"
            },
            "downloads": -1,
            "filename": "ref2tex-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "abb318dfb8047b82af2ea7194b215f08",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 4759,
            "upload_time": "2023-03-25T14:28:45",
            "upload_time_iso_8601": "2023-03-25T14:28:45.860424Z",
            "url": "https://files.pythonhosted.org/packages/7a/d4/d079b55a06b0ed3335497a97d753511cc924f32cf4923d9bb64fd4eb3985/ref2tex-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-25 14:28:45",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "ref2tex"
}
        
Elapsed time: 0.04710s