Paste text with italics

_johnny7_ger at web.de _johnny7_ger at web.de
Mon Jul 5 14:30:47 UTC 2021


> As Scott pointed out, right now it's not possible on a direct way, but you
> can use LibreOffice's own tools to "tag" text in italic and then use the
> "paste as LaTeX" option on LyX. It goes like this:
>
> - On Writer, make a copy of the document (don't work on the original!)
> - Open the search and replace tool (Ctrl-H)
> - On the Search box, write the following, complete with parenthesis: (.*)
> - With the cursor still on the search box, enable "Regular Expressions"
> and, under Format, select Italics (you'll see the word Italic bellow the
> search box)
> - On the Replace box, write \emph{$1}
> - Replace
>
> You'll see that all the italic text will be surrounded with the \emph{?}
> tag. Now, you can copy the text to the clipboard and go to LyX ? Edit ?
> Paste Special ? Paste as LaTeX.
>
> Of course, for short texts it's not worth doing all that, but for longer
> texts, it works pretty well.
>
> Regards,
> Ricardo
>

Thanks to you both, this method works like a charm. I was thinking about
converting the Libreoffice-HTML to LaTeX but this is much easier. It
really saves me time!


More information about the lyx-users mailing list