Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I convert LaTeX to plain-text (ASCII)?

Tags:

ascii

latex

Scenario:
I have a document I created using LaTeX (my resume in this case), it's compiling in pdflatex correctly and outputting exactly what I'd like. Now I need the same document to be converted to plain old ASCII.

Example:
I have seen this done (at least once) here, where the author has a PDF version and an ASCII version that matches the PDF version in almost every way, including margins, spacing and bullet points.

I realize this type of conversion cannot be exact due to limitations in the ASCII format, but a very close approximation does seem possible based on what I have found so far. What is the process for doing this?

like image 394
chuckg Avatar asked Feb 09 '09 21:02

chuckg


People also ask

How do I convert text to plain?

On the File tab, choose Options > Mail. Under Compose messages, in the Compose messages in this format list, click HTML, Plain Text, or Rich Text.

Can you convert LaTeX to HTML?

If you are using Windows, it may thus take you some time to find the right tool. Luckily the popular Latex distributions like MikTek and TexLive include an executable of a softwate to convert from Latex to HTML that works on Windows.

How do I convert a TEX file?

Just drag and drop your PDF file on upload form, choose the desired output format and click convert button. Once conversion completed you can download your TEX file. You even can perform more advanced conversions. For example you can convert password protected documents.


1 Answers

Opendetex is available both for Windows and Linux (compiles fine on a Mac as well). It can be downloaded from https://github.com/pkubowicz/opendetex

Usage:

detex project

opens project.tex, reads all files included using \include or \includeonly commands, outputs resulting text to standard output.

detex -n project > out.txt

opens project.tex, does not follow \include or \includeonly commands, outputs resulting text to out.txt

detex --help

shows full help

Extract it to any directory of your choice. Say you extracted it to your Downloads directory.

Create another directory of any name in that (this is optional but recommended). Let's say the directory name is “my_paper”. Put your paper in the “my_paper” directory. Assume your paper name is project.tex.

Navigate to the path

    cd ~/Downloads/opendetex 

Run the command

    detex my_paper/project.tex  > out.txt 

generic form

    detex -n full_path_to_tex_file.tex > output_text_file.txt 
like image 71
Mayank Agarwal Avatar answered Sep 18 '22 21:09

Mayank Agarwal