TeXmacs Tips

Efficient Math Typing, Crash Fixes, and More

Posted by Wanyu Zhang on November 6, 2024

About TeXmacs

TeXmacs is my favorite text editor, especially useful for those who frequently need to type mathematical formulas. I highly recommend giving it a try!

In case you need help getting started, here are some tutorials that might be useful:

Hope you enjoy using TeXmacs! :) I will keep updating this post whenever I find new tips!

How to fix TeXmacs crash

Recently, I encountered a TeXmacs crash on my MacBook, which was quite frustrating since I couldn’t use it for note-taking. :( Here is a guide to help you fix it. The crash is likely caused by a full cache, and clearing it should resolve the issue.

For macOS and Linux, run:

rm -fr ~/.TeXmacs

For Windows, the cache is located at %APPDATA%\TeXmacs and C:\Users\[User name]\AppData\Roaming\TeXmacs.

TeXmacs to MarkDown

Since I occasionally write blog posts, I need a way to convert .tm files to .md files. Unfortunately, this feature is not available in the default TeXmacs installation, so you’ll need to install additional plugins.

Here is a repository for the tm2md converter: tm2md GitHub Repo

For macOS:

mkdir -p ~/.TeXmacs/progs/convert
cd ~/.TeXmacs/progs/convert
git clone git@github.com:PikachuHy/texmacs-converter-tm2md.git markdown

open ~/.TeXmacs/progs/my-init-texmacs.scm, and add the following code

(use-modules (convert markdown init-markdown))

For Windows, refer to the repository instructions for setup details.

Math typing tips

  • Use option F to create fraction numbers.

  • Type shift [ + Tab to create various brackets, which is much more convenient than \langle \rangle.

  • Select some content and type \red to mark it in red, which is faster than selecting color in the menu.

  • :star: How to define Assumption environment or other theorem-like environment?

    Enter the preamble (Select Document->Part->Show preamble), and type

    <new-theorem|assumption|Assumption>
    

    Then return to the file and type \assumption to define assumptions! Here are the references:

    http://forum.texmacs.cn/t/how-do-i-add-a-new-environment-assumption/795/2

    https://www.texmacs.org/tmdoc/main/styles/env/env-base-dtd.en.html

  • :crystal_ball: Magic right click: Customized environment

    In the Algorithm environment, right click->Preferences->Framed Programs to add box on your algorithm block. Also, you can selected named environment. There are so many customized functions by right click. Also, in the theorem environment, you can right click->Preferences->European Numbering Style to seperately number the lemmas, theorems, etc.