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

前端 未结 14 1987
故里飘歌
故里飘歌 2020-12-07 13:17

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\'

相关标签:
14条回答
  • 2020-12-07 13:33

    I've tried LyX and it works pretty well. The only nuance is that if you have a TeX file that is including other TeX files, you will need to export them all separately, unless I'm missing something.

    0 讨论(0)
  • 2020-12-07 13:34

    Another option is to use htlatex to create a web page from the LaTeX sources, then use links to convert to plain text. I used the command line

    links -dump -no-numbering -no-references input.html > output.txt

    in the past which gave a rather nice result. This will of course rather match the view of the rendered HTML than the original PDF, thus maybe not exactly what you want.

    0 讨论(0)
  • 2020-12-07 13:36

    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
    
    0 讨论(0)
  • 2020-12-07 13:39

    You can try some of the programs proposed here:

    TeX to ASCII

    0 讨论(0)
  • 2020-12-07 13:40

    You can also try Pandoc, it can transform latex to many other formats. I suggest reading its documentation, for there may be some tricky cases that you need pass some arguments to handle.

    0 讨论(0)
  • 2020-12-07 13:48

    When I needed to get the plain text from my TEX file for indexing and searching, I found LaTeX2RTF to be a good solution - it has an installer and GUI for windows, and it produced a RTF file of my 50 pages thesis that I could open in Word.

    0 讨论(0)
提交回复
热议问题