6

The goal of this question is to find an appropriate font for the editor in which I input TeX, rather than a font for use in the output. I hope this is sufficiently on-topic for TeX.se.

I recently switched to unicode input for all mathematical operators. Now I'm considering taking it one step further and using the Mathematical Alphanumeric Symbols range to match the font-style of the input to the font-style of the output (upright for functions, italic for variables, script/double-struck/fraktur for the appropriate mathematical concepts).

It's become a bit of a personal project to get my TeX code to resemble the output as much as possible.

The problem so far is that I have no font in which those characters all occupy the same horizontal space, making the code in the editor misaligned and harder to read and edit:

enter image description here

The above screenshot fragment is from Eclipse / TeXlipse, but every Linux editor I tried does the same. The only font on my system that supports that particular unicode range is XITS, so whichever font I choose in the editor, it falls back to XITS for those variables.

Is there a font around which covers as much unicode as possible (but at least the standard mathematical operators and U+1D400..U+1D7FF) and has all of them in the same width? (What's the technical term; monospaced, fixed width?)

Or perhaps there is a way to display the characters with a fixed width, regardless of font? It feels like it would be a fairly mechanical process to take a font such as XITS, center each character in a fixed-width space and output a makeshift font with the characteristic I need. But I have no idea how to do that.

4
  • Mathematical symbols are inherently unsuitable for monospace rendering. Consider whether you really need monospace. People often think that all computer code must appear in monospace, but there are really no compelling reasons for that. Jul 28, 2013 at 16:08
  • There are a number of reasons. --- The most compelling, perhaps, is that (LaTeX) code often contains regularity in its structure; regularity which I want to make apparent with horizontal alignment. A single character with a deviating width will mess up alignment for the rest of the line, as you can see in my screenshot above. --- Perhaps it would be OK if some symbols have exactly twice or thrice the standard width, but there is still the second reason: Fast editing requires that I know where my cursor lands after pressing the 'down' key. No such certainty with variable width symbols.
    – mhelvens
    Jul 28, 2013 at 21:57
  • I'm working on a Free monospace with large character repertoire, including the mathematical symbols.
    – user38810
    Oct 23, 2013 at 14:58
  • @ChristTrekker: Sounds good. :-) Do you have a webpage, or some way to be kept up to date on this?
    – mhelvens
    Oct 23, 2013 at 21:45

1 Answer 1

5

There are very few fonts which cover all languages (let alone mathematics; see threads at typophile and stackoverflow), but Everson Mono seems to do what you want, although it'll cost you 25 euros.

3
  • Everson Mono appears to be the only monospace font that contains e.g. U+1D400, see fileformat.info/info/unicode/char/1d400/fontsupport.htm Jul 28, 2013 at 16:05
  • I don't have a problem paying for something useful. However, I tried it out for a little while and to be honest... it makes my eyes hurt. --- I considered using it only as a fallback font, for the ranges not supported by DejaVu Sans Mono, but that would break monospacing. The Everson alphanumeric symbols are way too small, and don't fit in. --- I now discovered FontForge, which would make it relatively easy to scale them up, but this is not allowed by the Everson shareware license.
    – mhelvens
    Jul 28, 2013 at 22:07
  • In 2021, I came across: mono-math.netlify.app. Seems JuliaMono is a good choice.
    – GManNickG
    Nov 17, 2021 at 19:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .