[texshop] Text styling in the editor window

Bruno Voisin bvoisin at icloud.com
Tue Jan 29 19:49:43 CET 2019


Something I just realized is that, when you copy text in TeXShop's editor window and paste it into a word processor (MS Word here), the text is pasted with the color it had in the editor window (and the font, and the size). So it seems what's pasted is not pure ASCII, some styling is included.

A screenshot is attached below, with the copied text in TeXShop on the left, and the pasted output in Word on the right.

There's always the possibility of pasting the text in TextEdit say, in Plain text mode, then copy it from there and paste it into the word processor. This is what I usually do to get rid of any formatting the clipboard may include, before pasting into any app. But it's a bit sad to have to do that for TeXShop. I don't remember it used to be like that.

My impression is that this is related to the change in LaTeX-aware spell checking in TeXShop 4.18. Changes.pdf says

> What is the mechanism used to turn off spell checking? I wish I had thought of Sims' idea. The text in the TeXShop source window is an "attributed string." This means it is an ordinary (often very long) string, with an additional data structure associated with the string that lists attributes like "text color" and "background color" for selected ranges of the string. Sims noticed that one of the available attributes is "do not spell check this selection." So Sims added lines to TeXShop's syntax coloring code which prevent the Mac from spell checking TeX commands or comments. This means in particular that the feature only works if syntax coloring is turned on.

So this seems to say that, when the new spell-checking method is in effect, styling is applied to the text in the editor window, it's not just the presentation of the window that is affected, the window content itself is affected too.

What's odd is that I have all three Spell Checking options unchecked in the Source Preferences window:

Do not check TeX commands
Do not check selected parameters
Do not check commands

I thought having them unchecked meant the new spell checking code wasn't used, and good old CocoAspell was used instead.

I'm probably messing things up. Any idea?

Bruno

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/texshop/attachments/20190129/bebe4383/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2019-01-29 at 19.43.35.png
Type: image/png
Size: 280333 bytes
Desc: not available
URL: <https://tug.org/pipermail/texshop/attachments/20190129/bebe4383/attachment-0001.png>


More information about the texshop mailing list