Paste text with italics

Scott Kostyshak skostysh at lyx.org
Sun Jul 4 20:19:16 UTC 2021


On Sun, Jul 04, 2021 at 06:59:27PM +0200, Ricardo Berlasso wrote:
> El dom, 4 jul 2021 a las 17:15, <_johnny7_ger at web.de> escribió:
> 
> > Hello,
> >
> > is there a way to paste text (from a source such as LibreOffice) into
> > LyX and keeping the words in italics emphasized?
> > If not, could such an option be implemented?
> >
> 
> 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.

Cool idea, Ricardo! This way is better than exporting/importing HTML in the sense that you will only get the \emph part formatted. Exporting and importing the HTML might give a bunch of different formatting that is not desired.

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20210704/ceb45988/attachment.asc>


More information about the lyx-users mailing list