Take the 2-minute tour ×
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.

When I produce the PDF, open it and copy the paragraph into notepad, there is a forced line break at the end of every line in the PDF. Is there a way to get over this, so that I can copy the paragraph as continuous text?

(Of course, I can just copy the paragraph from my .tex file. But the point is that I want other people to be able to copy text from my pdf.)

My MWE:

\documentclass[11pt,a4paper]{article}
\usepackage[cp1250]{inputenc}
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{document}
share|improve this question
1  
You shouldn't use an input encoding in MWEs. The encoding depends on the OS/editor the user uses and therefore the setting will not be correct for other users which copy the MWEs. –  Martin Scharrer Jan 13 '13 at 11:00
    
Does using pdftotext help? –  Seamus Jan 13 '13 at 11:02
1  
In addition you might also want to disable ligatures and hyphens, see Can we make ligatures copy-and-pastable?. –  Martin Scharrer Jan 13 '13 at 11:08
2  
@MartinScharrer Fortunately, the answer in your link does not disable ligatures, but makes them copyable. –  mafp Jan 13 '13 at 11:25
    
@mafp: I meant disable ligatures when copy-and-pasting, not disabling them completely –  Martin Scharrer Jan 13 '13 at 11:30

1 Answer 1

I can imagine a couple of possible solutions to this problem.

One would be that since latex knows what's a paragraph and what isn't, it could output some kind of metadata to the pdf file to mark paragraphs as such. This would have to be done in such a way as to make the pdf still a well-formed pdf that could be read by applications written according to Adobe's specs. Or the metadata could be somehow bundled along with the PDF, e.g., by zipping a PDF file and the metadata into the same file.

Another solution would be to use some kind of artificial intelligence algorithm to try to detect what's a paragraph ending and what's not. I don't think this is an easy problem to solve with good accuracy. E.g., Distributed Proofreaders uses human volunteers all over the planet to do this kind of thing for OCR'd texts. However, it might be possible to do it with some kind of decent precision. If there is such a heuristic algorithm, I'd imagine that you would find it by looking at OCR software.

The lack of a good solution to this problem (assuming I'm right) is basically due to Adobe's design decision to make PDF a presentation format, in which there is no importance attached to separation of formatting from content. Also, PDF is a handmaiden to Adobe. There is little likelihood of any solution gaining traction unless it's blessed by Adobe as the standard way to do it -- and it's not clear that Adobe has any economic interest in this issue.

share|improve this answer
    
PDF is an ISO standard now. –  Martin Schröder Feb 2 '13 at 21:05
    
Adding the "metadata" could be done with PDF/A. –  Martin Schröder Feb 2 '13 at 21:06
    
The first option seems more reasonable in this context. Do you have any idea if there some package to do it? If everything else fails one could have some Javascript code (for Acrobat) to copy each paragraph or at least the raw code for it. That would be really nice (e.g. to stream line, writing new documents from the PDF of old ones). –  alfC Apr 19 '13 at 0:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.