# How to refuse color changing?

I started to assimilate TeXMacs and I have some questions. As for me, it is a very important tool is to convert to Latex. I’m familiar with Latex since 1995, I use TexMaker and TexWorks, but I found TeXMacs very useful. To assimilate TeXMacs I started to write a new paper by using TeXMacs.
I created a sample to explain my question. I started a simple file and converted it to Latex:

\documentclass{article}
\usepackage[english]{babel}
\begin{document}
blah bla $\omega$ and $\Omega$
\end{document}


Then I changed color (format->color) to red and converted to Latex and obtained:

\documentclass{article}
\usepackage[english]{babel}
\usepackage{xcolor}
%%%%%%%%%% Start TeXmacs macros
\newcommand{\tmcolor}[2]{{\color{#1}{#2}}}
%%%%%%%%%% End TeXmacs macros
\begin{document}
blah bla \tmcolor{red}{$\omega$} and $\Omega$
\end{document}


Then I decided to return to the initial black color changed color to black (format->color) and converted to Latex:

\documentclass{article}
\usepackage[english]{babel}
\usepackage{xcolor}
%%%%%%%%%% Start TeXmacs macros
\newcommand{\tmcolor}[2]{{\color{#1}{#2}}}
%%%%%%%%%% End TeXmacs macros
\begin{document}
blah bla \tmcolor{red}{$\tmcolor{black}{\omega}$} and $\Omega$
\end{document}


In Latex file some long structure appears: \tmcolor{red}{$\tmcolor{black}{\omega}$} instead of simple $\omega$ as in the initial file. Maybe there is some special menu to refuse modification? If I change color once more, the more long structure appears.

You need to remove the red color tag before you apply a new color. Move your cursor into the color tag and press Ctrl-Backspace or click the red cross in the toolbar.

Thanks. It works. But if there is a single letter in math mode, then the math mode refused first and then color.

Ctrl+Backspace remove the innermost environment. You see in the bottom bar the sequence of enclosing environments, so you always know what will happen when you act on the current focus. Remember that TeXmacs is a ‘structured’ editor, so most editing operations acts on the structure of the document, for example Format->Color insert a new environment, always. If you have already set a color for a region and what to change it then you can also change it via the input field on the focus bar. If instead you want to go back to the color of the document then you remove the structure altogether. These are two conceptually different options and they corresponds to conceptually different operations within the TeXmacs document model.

Thank you for your explanation. Because I started to write the paper using Texmacs, many additional questions must appear. Because my coauthors use different programs to work with Latex file, the export/import to/from Latex is very important. At this moment I find TeXMacs very useful.

I find a functionality which seems important: it might be as well useful to understand a proper way to do some kind of “mixed programming” with LaTeX other than conversions. For example, one writes Chapter 1 in TeXmacs and the other writes Chapter 2 in LaTeX. It seems better that TeXmacs could export labels and import the processed bibliography to facilitate cooperation.

Unfortunately, it is not so simple, Chapter1 and Chapter 2. Usually, everything is mixed. At this moment there is a simple solution - to use simple Latex code without additional specific packages. At the end of writing, we have to convert the Latex file to a style of the journal. But I hope that the converter to/from Latex will be better and better

Well, it would be easier to convince your coauthors to switch to TeXmacs than to provide 100% reliable conversion to LaTeX. Joris made some research on reliable ways to go back and forth, here https://www.texmacs.org/joris/latexconv/latexconv.pdf but is in general a difficult problem. I think if you coauthors just stick to standard LaTeX there are no problems in general. If you want to do fancy stuff it is better to do it in TeXmacs and not touch it in the LaTeX export.

“it would be easier to convince your coauthors to switch to TeXmacs” - It is impossible. Everybody can use the package which they want. I use Latex already 25 years and changed a lot of different packages to work with. I did not use WYSIWYG packages. This is my first experience. I see that without a good converter to/from Latex, the TeXMAcs can not be used in the scientific community. This point is very well discussed in that paper. Thank you for this reference. I see that van Hoeven, as a mathematician, understands this problem.
There is another WYSIWYG package that works with Latex - Bakoma. It works directly with Latex code but nevertheless is WYSIWYG. It шы commercial and the project is for sale (and dying) and I can not test it. I’m a physicist and I have a very good impression of TeXMacs and will use them for homework files.

I don’t agree even if I understand what you say. I was a physicist and now I’m a mathematician, I worked with LaTeX from 1996 to 2006 when I started to use TeXmacs more and more. Nowadays if I work with my students I use TeXmacs and it is up to them to adapt. For more senior colleagues which are reluctant to change their ways I tend to write my parts of the papers with TeXmacs and then copy them into our common LaTeX file. And I write all my presentations and lecture notes with TeXmacs. I touch LaTeX only in the very last stages of the prepraration of the files for the editors and to put the papers on arXiv. Of course is a matter of personal choice and nobody has to be forced, but many of my younger colleagues, which were less “framed” in the LaTeX habits discovered quite easily TeXmacs and are happy to use it. The painful situation is where you try to take your old habits with you, then you discover that TeXmacs do not behave like LaTeX and you are very unhappy. One has to let the olds habits go and discover new ones. Last thing: I beg respectfully to dissent: BaKoMa (for what I see on the internet) or LyX are not WYSIWYG, what you see on the screen is only an approximation of what you will get on the paper. No system based on LaTeX can do it because it is almost impossible or anyway to difficult to implement. That is why TeXmacs had to get away from 100% LaTeX compliance. I’m glad you find TeXmacs useful for you. Indeed lecture notes and private files are an area where it is easier to switch.

2 Likes

As with any paradigm shift at some point the cost of switching will become lower than the cost of remaining in the old paradigm.

One particular reason why I think TeXmacs may become increasingly attractive is the growing amount of regulation requiring universities to produce accessible educational materials.

For mathematical content, the only reasonable ways to provide access to users of screenreader technology at the moment are MS Word and HTML with MathJax. MS Word is not an option I wish to consider, so you need an editing solution with good convertibility to HTML with MathJax. With LaTeX you quickly run into the convertibility issues described in the article linked to by @mgubi. TeXmacs has a significant advantage there. All my lecture notes are now written in TeXmacs and convert easily into HTML.

1 Like