Issue with '>' Symbol When Exporting from TeXmacs to LaTeX

Hello everyone,

I’m new to TeXmacs and recently wrote a paper using it. When exporting my document to LaTeX and attempting to compile it via Overleaf, I’m encountering compilation errors.

After some investigation, I discovered that whenever I use the ‘>’ symbol inside an eqnarray environment, TeXmacs automatically adds the following code to the LaTeX output:

\catcode`>=\active \def>{\fontencoding{T1}\selectfont\symbol{62}\fontencoding{\encodingdefault}}

When I remove all instances of ‘>’ from my eqnarray environments, this code is no longer included in the export, and Overleaf compiles the file without any errors.

Is there a way to prevent TeXmacs from adding this catcode definition when exporting to LaTeX? Or is there another approach I should take to ensure compatibility with Overleaf?

Thank you for your help!

Welcome! Can you tell us which is the LaTeX error involved? And also, can you give us a minimal viable example of the TeXMacs source and the LaTeX output so that we can test what is going wrong? Thanks!

(Also: I think is improper to say “compile via Overleaf” as “Overleaf” is just a frontend to LaTeX, it is more appropriate to just mention “LaTeX”, unless you think the problem is in the cloud technology that Overleaf layers on top of it, which I do not think it is the case)

Thank you for your quick response!
You’re right about the terminology. I should simply refer to “compiling with LaTeX” rather than Overleaf specifically.

The specific LaTeX error I’m getting is:
Incomplete \iffalse; all text was ignored after line 139.
Followed by additional errors related to undefined control sequences.

Here’s minimal reproducible example:

In TeXmacs:

Exported LaTeX output:

\documentclass{article}
\usepackage[english]{babel}

%%%%%%%%%% Start TeXmacs macros
\catcode`\>=\active \def>{
\fontencoding{T1}\selectfont\symbol{62}\fontencoding{\encodingdefault}}
%%%%%%%%%% End TeXmacs macros

\begin{document}

\begin{eqnarray*}
  x & > & y
\end{eqnarray*}

\end{document}

When I remove the ‘>’ symbol from the equation, the \catcode line is not included in the exported LaTeX, and the document compiles without errors.
Also, ‘>’ symbol inside an inline formula or a displayed formula doesn’t trigger this error.

Is there a way to configure TeXmacs to handle this symbol differently during export?
Thank you for your help!

For a quick fix it would be enough to remove the line with \catcode in the generated file. I’m not sure why it is there, seems a but to me. I will report it to the TeXmacs bug tracker. (Done: https://savannah.gnu.org/bugs/?66921)

Thank you so much for your quick solution and for reporting this to the bug tracker!

I have one more question. I recently discovered your YouTube channel, and in one of your videos, I noticed that menus like File, Edit, and Insert appear in the macOS menu bar at the top of the screen. However, on my laptop, these menus appear inside the TeXmacs window (similar to how they would on Windows). How can I change this to match the native macOS menu style?

Thanks again for your assistance!

You can choose this in ‘Preferences->Others->Native menu bar’.

I’ve already tried that option, but unfortunately, it doesn’t seem to work on my system. However, it’s not a significant issue compared to the converter problem you resolved. I was mainly hoping to gain a bit more screen space, but the current interface is still perfectly usable.

Thanks for your help and for developing this wonderful editor. Though I’m new to TeXmacs, I’m already enjoying it much more than other editors I’ve used in the past. The interface is intuitive, and despite the small export issue, the overall experience has been excellent.