Paste text with italics
Dr Eberhard Lisse
nospam at lisse.NA
Mon Jul 5 19:19:01 UTC 2021
Install the Writer-to-Latex module/package or whatever it is called.
That exports the whole file to LaTeX keeping more than just Italic.
Then you tex2lyx it and copy/paste from the document resulting.
When exporting switch to "Ultra Clean" and experiment with the other
option.
el
On 2021-07-04 22:19 , Scott Kostyshak wrote:
> 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
>
>
More information about the lyx-users
mailing list