Question about blackboard font

I am wondering why ("R R" "<bbb-R>") is different to \mathbb{R} as you can see in the following image
30

I want to change all <bbb-LETTER> to be \mathbb{LETTER} and I’m curious on how to do this.
I understand that you can control the blackboard font on the current document by accessing and editing Document > Font... and then heading to Advanced..:


Although:

  1. I’m not sure which font correctly corresponds to mathbb{LETTER} seen above
  2. How to do this for all documents
  3. Is there an easier way to do this?

Any help with this would be appreciated.

1 Like

Hmm… There are some TeX fonts with bb charaters that are similar but different from the \mathbb{R} one. In fact all the available TeX fonts in the Advanced menu don’t produce desired one.

There’s a file called math-bbb.enc in the TeXmacs\fonts\enc folder, don’t know if it’s relevant.

They are different characters. \mathbb{R} is just a char R in font mathbb, <bbb-R> is the substitute of unicode 0x211D (ℝ in the webpage). To show 0x211D as the glyph of \mathbb{R}, I guess you have to make a font yourself. The easiest method to do your need may be redefining the keyboard short.

If you use emacs, this elisp snippet can help you (for non-capital character, start from 97):

(dotimes (i 26)
  (let ((c (+ i 65)))
    (insert (format "(\"v v %c\" (insert \"<b-up-%c>\"))" c c)))
  (newline-and-indent))

something will be inserted to you cursor point like:

("v v S" (insert "<b-up-S>"))

I see, thank you for your help. Would that mean that it is not recommended for one to use R+R to produce a blackboard R when wanting to export to LaTeX? Or, does the export understand that 0x211D should be understood as \mathbb{R}?

I will likely redefine the R+R command in my-init-texmacs.scm to obtain my desired result.

Result of latex export shows:

"<bbb-R>" => \ensuremath{\mathbb{R}}
(math "<bbb-R>") => \mathbb{R}
(with "font" "Bbb" "R") => R
(math (with "font" "Bbb" "R") => \mathbb{R}

So unless you use (with "font" "Bbb" "R") outside a math env inside texmacs, you will always end up with a \mathbb{R} in latex.

FYI, under TeXmacs font Pagella, glyphs of (with "font" "Bbb" "R") and "<bbb-R>" are almost identical.

To set Pagella as your default font if you want, put in your my-init-buffer.scm:

(if (not (buffer-has-name? (current-buffer)))
    (begin
      ;; you can also specify default styles, packages, etc. like:
      ;; (init-style "mynotes")
      ;; (set-style-list (append (get-style-list) '("quantum")))
      (init-font "pagella" "math-pagella")

      (buffer-pretend-saved (current-buffer))))