TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a document that contains formatting macros. That document includes a document that contains the content.

I'd like to be able to create a second document that redefines the formatting macros so that the resulting PDF can be converted to plain text very successfully. I'm using PDFMiner's pdf2text.py (python), but the document itself needs to be properly suited for conversion (no columns, drawing marks, typeface changes, etc.).

The only problem I'm having is with line wrapping. Is there a way to turn off wrapping for (every) paragraph? I think this would solve my problem.

If there's another way to convert a LaTeX document to text (without me having to code the tool to do it), I'm willing to consider alternatives to my current plan.

share|improve this question

closed as unclear what you're asking by egreg, Joseph Wright Jan 2 at 21:30

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Try pandoc. If your document is not overly complicated, it is perhaps better to write in markdown and use pandoc to convert to LaTeX rather than the other way around (though pandoc does work in the direction you're talking about, too). Also line wrapping sounds like an editor 'problem', not a *TeX problem..? – jon Jul 25 '13 at 5:05
    
What do you mean exactly by "line wrapping"? Hyphenation? – Werner Jul 25 '13 at 5:40
    
do you actually want to stop line breaking and just have one very long line? or do you just want to stop hyphenation breaking words and adding - in the latter case just add \raggedright – David Carlisle Jul 25 '13 at 7:06
    
@jon, I don't think the document would count as simple. It's full of custom macros to do formatting/layout. I wish to render it for visual beauty/usefulness and for "export to text" without duplicating the text content. I just want to redefine the formatting macros for the export-to-text version. – Jubjub Bandersnatch Jul 25 '13 at 12:44
    
@Werner, LaTeX's default mode is to wrap lines, which is very sensible. The pdf-to-text conversion tool I'm using preserves those broken lines. For the sake of the exported text, I want all the words in one paragraph to be on a single line. – Jubjub Bandersnatch Jul 25 '13 at 12:45

Browse other questions tagged or ask your own question.