Title

reftex -- Enhanced bibliography processor with LaTeX escaping and mixed language support

Syntax

reftex using filename, outfile(filename)
[debug replace lang(language)]

Options

Required
outfile(filename) output LaTeX bibliography file

Optional
lang(language) processing language: chn, eng, or mix

debug display detailed processing information

replace overwrite existing output file

Description

reftex converts plain text bibliographies into formatted LaTeX bibliographies with proper escaping of special characters.
It supports Chinese, English, and mixed-language bibliographies with intelligent formatting rules for each language.

The generated .tex file contains only the thebibliography environment and is compatible with natbib package.
You can use \cite, \citet, \citep and other citation commands in your main document.

Key features:

• Automatic LaTeX character escaping (e.g., &, %, $, #)

• Chinese format: Authors (Year). Title...

• English format: Authors (Year) Title, Journal, Volume(Issue), Pages

• Mixed language auto-detection (Chinese characters)

• Double period prevention system

• natbib-compatible output with citation keys

Options

outfile(filename) specifies the output LaTeX bibliography file path. This option is required.

lang(language) sets the processing language:

chn: Chinese format (default)

eng: English format

mix: Auto-detect language per entry

debug displays detailed processing information for debugging.

replace overwrites the output file if it already exists.

Input Format Requirements

Input files must follow these specifications:

1. Each entry starts with [number] at beginning of line

2. Entry content continues on subsequent lines

3. Chinese format: Authors Year. Title...

4. English format: Authors, Year, Title, Journal, Volume, Pages

Output Format

The generated .tex file contains only the thebibliography environment with properly formatted entries.
Each entry includes a citation key based on first author and year (e.g., "Chen2021"), allowing you to use:

\citet for textual citations (e.g., Chen et al., 2021)

\citep for parenthetical citations (e.g., (Chen et al., 2021))

To use the generated bibliography in your LaTeX document:

1. Add to preamble: \usepackage[round]

2. Set bibliography style: \bibliographystyle

3. Add to the end of the document: \input

Examples

. reftex using "references.txt", outfile("bib.tex") lang(chn) replace

Convert Chinese bibliography

. reftex using "mixed_refs.txt", outfile("output.tex") lang(mix) debug

Convert mixed bibliography with debug mode

. reftex using "english_bib.txt", outfile("eng.tex") lang(eng) replace

Convert English bibliography

Version History

v9.6 (25aug2025)

- Added natbib compatibility with citation keys

- Removed full document structure from output

- Updated help file with usage instructions

v9.5 (17aug2025)

- Fixed double period issue by cleaning field endings

- Enhanced trailing punctuation removal

- Improved end punctuation detection

v9.4 (15aug2025)

- Fixed double period issue with temporary file approach

v9.3 (12aug2025)

- Fixed double period issue at end of English entries

v9.2 (10aug2025)

- Added mixed language support (chn/eng/mix)

v9.1 (05aug2025)

- Added LaTeX special character escaping

Authors

Wu Lianghai

School of Business

Anhui University of Technology

Ma'anshan, China

agd2010@yeah.net

Wu Hanyan

School of Economics and Management

Nanjing University of Aeronautics and Astronautics

Nanjing, China

2325476320@qq.com

Chen Liwen

School of Business

Anhui University of Technology

Ma'anshan, China

2184844526@qq.com