Anki Forums

Control the formatting when you paste text

Hello, when I paste text from pdf it doesn’t keep any formatting even if I use ctrl+shift+v, while it works fine if I paste in Microsoft word.
I’ve been using Anki since 2.0 and it used to keep more formatting. I know that keeping too much HTML can lead to troubles, but would it be possible to have an option to keep more formatting or an additional button for this function or some other way to control this? Sometimes it can be very useful, even if it was only bold, italic, etc.
I tried various addons and no one worked as I wanted, so here I am asking if it was possible to integrate this function in Anki!
Have a nice day and Merry Christmas!

When you say “any”, what exactly is it you are missing? You might have more luck opening the document in LibreOffice and pasting it from there.

Sorry if i reply just now. What i meant was that if I try to copy this from a pdf:

If I paste it in word this is what i get:

While if i paste it in anki (ctrl+v or ctrl+shift+v doesn’t change anything) this is what i get:

Is there any way to keep more formatting while i copy-paste, as it is in word?

Microsoft use a lot of fancy styling which gets filtered out. What do you see when you paste from LibreOffice?

Sorry if i reply just now but it was a crazy week. I apologize. Anyway, i just installed libreoffice and this is what i get:

This is the original text that I’m trying to copy-paste

Please note that the result is the same regardless of the pdf i tried. Anki just doesn’t keep any formatting.

This is what i get when i paste in libreoffice

This is what i get when i paste in anki

What I’m asking if there is any way to have something similar to what i get with ms word or libreoffice when i copy-paste from a pdf, instead of stripping everything like anki do now.

What if you open the file directly in LibreOffice and then paste from it, instead of pasting into LibreOffice first?

If the source content is coming from a PDF, that could be a complicating factor. At least with standard .doc files, I seem to recall they look better when opened+pasted from LibreOffice.

Please also make sure you try pasting with and without holding down the shift key, as your settings may be set to strip formatting on paste.

Unfortunately the source is a PDF… i tried to open it with libreoffice but it really mess up the content.
But if the problem was the pdf source, wouldn’t copy-paste to libreoffice and from libreoffice to anki solve this issue? But this isn’t the case, and pasting from libreoffice still doesn’t work, even though in libreoffice it looks fine.
Pasting with or without ctrl+shift+v changes nothing…

I know that i’m asking a lot, but is there any chance to fix this problem?
My thoughts are that a lot of people like me is using anki to study from pdf, as those are the most common sources, so i think it would be a big improvement for everyone.
I really have no idea if this would be a simple fix or a big hassle

This is another example, this time not from a pdf but from a famous website among medical students (AMBOSS)
This is the source text

This is what i get if i copy it in MS word.

This is what i get if i copy it in anki (i tried both ctrl+shift+v and ctrl+v, nothing changes)

I can’t reproduce the issue. Bold text, lists, hyperlinks are all preserved.
Did you try with add-ons disabled? Maybe it’s a shortcut issue. Did you try toggling the format stripping option?

Paste:

Shift paste:

I just tried without the addons, and while this way it works when i paste from amboss or other websites (so i’ll try to figure out which addon generate the error), it still doesn’t change anything when i try to paste from a pdf (both ctrl+v and ctrl+shift+v)… it just doesn’t keep the formatting

That may depend on the PDF. Do you have one you can share? Then I would try it.

1 Like

Sorry if i reply just now but i had a very hard test in the past days and i didn’t have a chance to reply. Anyway, it would be awesome if you could test it too!

I tried to copy from this pdf that i randomly found on the internet (to show that this isn’t an isolated problem).


http://hackmed.org/web/contenuti/download/send/28-immunologia/665-immunologia-2014-15-canale-a
I tried to copy the third page in word and the result was perfect.

Instead, this i what i got when i tried to paste it in anki.

Another example from the same pdf
This is word


This is anki