[OS X TeX] TeXShop syntax highlighting for expl3

Richard Koch koch at uoregon.edu
Sat Jan 27 21:52:49 CET 2024


Alan,

There is no "user-level" way to modify syntax coloring in TeXShop. By working with the code directly, syntax coloring can certainly be modified. When I added an html preview window, I modified syntax coloring to syntax color html code if the source file has extension .html rather than .tex.

It would be an interesting project for someone to add to TeXShop the ability to design-your-own syntax coloring scheme. That might not be too difficult because the syntax coloring code is isolated to a small portion of the code base. I'm not a syntax coloring expert, and another advantage of such a project would be making syntax coloring more efficient at the same time that it is extended.

I can imagine two forms of such a project. Both forms would introduce a pulldown menu allowing the user to select the syntax coloring scheme, with the current method being one of the choices. Perhaps this menu would associate new schemes with particular extensions, so the current extension could be used for .tex but a different one for .ltx or .html or whatever. One possible design would allow users to design a new scheme which would work without recompiling. Another might be a template to design a new scheme, but TeXShop would need to be recompiled to make it work.

As TeXShop matures, I get suggestions for additional features that would affect fewer and fewer users. At the same time, I'm maturing and want to finish projects having nothing to do with TeXShop (!!). So it is useful to find features which can be broken off and done by an ambitious new contributor to the project.

Dick

On Jan 27, 2024, at 10:39 AM, Alan Munn via MacOSX-TeX <macosx-tex at email.esm.psu.edu> wrote:

On 2024-01-27 at 12:37 PM, Herbert Schulz via MacOSX-TeX wrote:



On Jan 27, 2024, at 10:37 AM, Alan Munn via MacOSX-TeX <macosx-tex at email.esm.psu.edu> wrote:

I suspect this has been asked before, but how extensible (if at all) is TeXShop's syntax highlighting code? As more of us who develop packages are using expl3 syntax, it would be really nice if TeXShop could highlight such code well.
 Alan

 --
Alan Munn
amunn at gmx.com

Howdy,

I'm sure Dick Koch will enter the conversation but AFAIK the only control or changes you can make are to the colors of many items (which cannot be re-defined) on the Themes tab of TeXShop->Settings/Preferences.

Yes, I’m aware of the user level functionality within the editor. I was really asking about how easy it would be to add expl3 functionality to the code itself. It looks like there’s been some attempt to recognize _ as a relevant character, but at least in the current mode, expl3 macros don’t get coloured correctly. It would also be nice to be able to colour selectively on functions (which contain a colon) and variables, (which don’t), or even more control over different variable types, which in expl3 syntax are by convention explicitly marked, _clist, _bool, _int, etc.

Alan

Alan


Good Luck,

Herb Schulz
herbs2 at mac.com


----------- Please Consult the Following Before Posting -----------
TeX FAQ: https://www.tug.org/mactex/faq/index.html
List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/TeX/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
               https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: https://www.tug.org/mactex/index.html
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex


----------- Please Consult the Following Before Posting -----------
TeX FAQ: https://www.tug.org/mactex/faq/index.html
List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/TeX/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
               https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: https://www.tug.org/mactex/index.html
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/macostex-archives/attachments/20240127/f6dbf49c/attachment-0001.htm>
-------------- next part --------------
----------- Please Consult the Following Before Posting -----------
TeX FAQ: https://www.tug.org/mactex/faq/index.html
List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/TeX/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
                https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: https://www.tug.org/mactex/index.html
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex


More information about the macostex-archives mailing list.