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.

If I copy text to the clipboard from a PDF file, web page, email, or Word document and then paste it to Word or Thunderbird, it is recognized as rich text and converted to Word's or Thunderbird's native format. Does anyone know of a LaTeX GUI (editor) that can do the same?

For example, if I copy "Do this now!!!" from this webpage and paste it into my favorite LaTeX editor, it should become Do \emph{this} \textbf{now!!!}. But all the LaTeX editors I've ever tried will handle pastes as plain text.

Addendum: There's nothing technically difficult about accepting some rich text features from pastes. Applications put objects on the clipboard in multiple formats, and the receiving application can choose a format it can handle. Any editor could request HTML and map all sorts of structured mark-up to LaTeX, from bold or centering to hyperlinks, to section headings and table structure, etc. Is there really no LaTeX editor that goes to the trouble?

share|improve this question
One should be aware that, if there are any, they will probably have difficulty with tables and images and so on. –  cyberSingularity Dec 17 '12 at 13:43
Images, certainly. But tables are unambiguously marked in html, so there's no reason not to turn them into a LaTeX table on pasting. And the clipboard protocol can negotiate HTML format even from Word; it's not like the editor needs to parse raw PDF or whatever. (This is also no reason not to do the really trivial stuff) –  alexis Dec 17 '12 at 13:46
See pandoc for an alternative solution. –  Yiannis Lazarides Dec 17 '12 at 13:47
The table models of html and latex are very different and it is a complicated (and historically error prone) conversion. It is better to make tricky conversions part of an explicit conversion step rather than automatically on paste. I think you have the clipboard model backwards: It is up the pasting application to provide a range of formats. It has more information about the structure of the text and could put latex on the clipboard as one of the formats. That would be more reliable than the pasting application making html or rtf and the latex editor having to guess equivalent latex markup –  David Carlisle Dec 19 '12 at 17:27
If you want to have this property then you can use LyX and probably use a converter rtf2latex2e.sourceforge.net/index.html but otherwise you need to see why people don't implement this. –  percusse Dec 19 '12 at 17:27

1 Answer 1

LaTeX is build upon ASCII. What you are asking is a feature of the WYSIWYG world converted into the ASCII world.

But the ASCII world decided for another approach: There are converters from WYSIWYG to LaTeX. One mighty software is LibreOffice and its addon "writer2latex". You can throw RTF, *.doc or whatever into the writer and export it as LaTeX. If Libreoffice is not capable enough, because the RTF-file uses features not supported by the writer, then you are in trouble. But for italics and the like, this is the easiest way.

Edit 1.

OP comments (see below):

Keks, I am asking for nothing of the sort. I am asking for a standard feature of the GUI world that is sadly missing from LaTeX GUIs. I don't want bold text to look bold in my editor-- but it should become \textbf{text}.

I understand that. But what you ask for is exactly that kind of background changes people very often hate. They copy text from somewhere and don't want the software to imitate sense by providing whatever layout feature. They just want the text. And if they need more, they go for the converter.

One of the best feature of editors is not to behave like Word!

share|improve this answer
Keks, I am asking for nothing of the sort. I am asking for a standard feature of the GUI world that is sadly missing from LaTeX GUIs. I don't want bold text to look bold in my editor-- but it should become \textbf{text}. Converters are stand-alone tools, on par with using latex and pdflatex from the command line. A GUI is a GUI, and accepting pastes is a standard (and simple) feature. –  alexis Dec 19 '12 at 15:48
@alexis This requires knowing how the operating system manages copying and pasting with formatting instructions. It might use RTF so making what you want at least possible; but the editor should know about how the call to different fonts is implemented. I wouldn't even try thinking to implement it. –  egreg Dec 19 '12 at 15:58
@egreg, I don't know your background, but it's really not that hard. The OS doesn't control the format of the rich text. The application makes the text available in multiple formats (typically including plain text), and the application on the receiving end chooses looks for a format it can handle. It's all handled by the clipboard API. Compared to integrating a GUI app with the OS-supplied widgets and window manager(s), it's trivial. –  alexis Dec 19 '12 at 16:05
@alexis Well, RTF uses explicit font changes, IIRC; so how's the TeX front end supposed to react to "choose Times New Roman Italic"? –  egreg Dec 19 '12 at 16:08
@alexis I am 100% sure that there's no such editor. And especially after your comments and explanations here, it seems to me that this is a question for WinAPI/Xserver/... programmers, not for people who do TeX programming. From a LaTeX point of view the situation is clear, you can either use grouping command \textbf{text} or switching commands \bfseries text \mdseries, but I suppose you know this. –  yo' Dec 19 '12 at 20:10

Your Answer


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.