Weird font bugs?

I got two weird font issues recently in the beamer or projector style.

  1. The font is sans-serif for inline math, but serif for displayed math. I can’t get it back to the default behavior by choosing Default or manually choose TeXmacs Computer Modern Sans

  2. If I choose STIX font, the square root sign becomes corrupted.
    image

This is for an existing document. No problem at all if I open a new document.

Are you able to post a “minimum example” by copy-pasting its file content in a message?


This is the source code of a minimal example.

I just found the problem with the Default font is solved if I remove the preamble, which I copied from http://forum.texmacs.cn/t/large-displayed-style-by-default-for-inline-formulas/280/2?u=jade in order to set displayed style for all inline math. Is there a problem with this preamble? Nevertheless, the STIX font problem persists even I delete the preamble.

The problem with the square root can be solved by choosing a specific math font rather than default.

Thanks for posting the image of the document. Are you able to post (in place of the image) the file content itself? You can do it if you open the .tm file with a text editor, then copy its contents and paste them in a message in a code block. Then I and others can copy-paste the file contents into a document in our own computers.

This is the content of the file.

<TeXmacs|2.1.1>

<style|projector>

<\body>
  <\hide-preamble>
    <assign|math|<macro|body|<with|mode|math|math-display|true|<arg|body>>>>
  </hide-preamble>

  <screens|<\shown>
    <math|a>

    <\equation*>
      a
    </equation*>
  </shown>>
</body>

<\initial>
  <\collection>
    <associate|page-medium|paper>
  </collection>
</initial>

The definitions of the math environments for the beamer style are different from the ones for the generic style, I think. I do not understand how they work, and I am not able to go into the details, this said I started from the definition of the math tag for the beamer style and I set it to have the math-display environment variable as true, in the following way:

<assign|math|<macro|x|<math-colored|<with|math-display|true|<uncolored-math|<arg|x>>>>>>

and now both inline math and display math are serif and inline math is display.
I hope that this is what you want.
I used the macro editor as in https://texmacs.github.io/notes/docs/macro-editor.html to see the definitions and figure out what seemed sensible to change.

For the STIX font let us see if anyone else answers, I do not understand anything about how fonts work.

1 Like

Great! Indeed the definitions are different! The macro editor is really useful.Thanks!

I was experimenting on the macro editor and the shortcut creator. However, I can’t remove the shortcuts. I click the Remove then OK. But the shortcut still exists and reappear if I open the shortcut editor again. And I didn’t find which file the shortcut is saved. The only way now it to delete the whole .TeXmacs folder.

For the Shortcuts editor pls. see the thread Inserting footnotes via keyboard shortcuts and in particular this post and this post, the conclusion was that it does not work.
The way to save your own shortcuts is through the personal initialization file my-init-texmacs.scm; pls. see the beginning of [wiki] Assorted code snippets to customize TeXmacs' behaviour for how to edit that file. If you are not able to find out on your own the syntax for writing your own shortcuts please ask.

I have made some shortcuts in my-init-texmacs.scm. I thought the editor would be more convenient.

1 Like