Skip to content

Simple conversion from LaTeX to ASCII or Markdown

License

Notifications You must be signed in to change notification settings

edemaine/tex2text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

tex2text

tex2text is a simple converter from LaTeX to ASCII text, Unicode text, or Markdown. It's not intended to be perfect — the output likely requires some human editing — but rather to save a lot of the manual work in conversion. It also doesn't support much LaTeX — feel free to add features via pull requests! But it has nonetheless served me well for two purposes:

  1. Converting a paper's abstract into text for uploading to a submission server (see -a option).
  2. Converting an exam into Markdown for e.g. Gradescope's online assignments (see -g option).
  3. Adding \texorpdfstrings to math in section/chapter headings (see -s option).

Usage

tex2text is a command-line tool. You need Python (2 or 3) installed. Then you can run it as follows:

python tex2text.py [options] filename.tex

Available options:

  -h, --help        show this help message and exit
  -a, --abstract    search for LaTeX abstract and just convert that
  -d, --markdown    enable Markdown formatting (implies -u)
  -u, --unicode     enable Unicode characters (beyond ASCII)
  -m $, --math=$    preserve LaTeX math with specified delimiter e.g. $
  -g, --gradescope  Gradescope mode, equivalent to -d -m $$
  -s, --sections    section mode: add \texorpdfstring to headings (implies -u)

About

Simple conversion from LaTeX to ASCII or Markdown

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages