0

I am trying to use a custom font/character in Overleaf. I made a character (a modified integral) as a .ttf, and have uploaded it into Overleaf. I'm referring to the new font as 'specint', and the character can be accessed via the 'a' key.

I can render the character properly in "in-line" math mode, with this example code:

\specint{a}\(_{a}^{b} x^2 dx\)

My problem is I cannot figure out how to render the character in "display" math mode. For example, the following does not work:

\specint{a}\[_{a}^{b} x^2 \,dx\]    

If helpful, my entire minimal code is here: https://www.overleaf.com/read/dqssmgmwrysc, and the .ttf is here: https://www.dropbox.com/s/bt8h49ksj565veg/integralsymbol-Regular.ttf?dl=0

Any help understanding how to use 'display' format in math mode with a custom character would be greatly appreciated. (Apologies for what is likely a basic question -- I am very new to LaTeX.)

Paul Gessler
  • 29,607
navona
  • 1
  • 1
  • Are you using XeTeX or LuaTeX? / You may want to look into fontspec package documentation. – user202729 Jan 01 '22 at 16:25
  • you have not used inline math mode at all, in \specint{a}\(... you are starting the inline math after the a so you have only specified this font for use in text mode. – David Carlisle Jan 01 '22 at 16:48
  • 1
    simplest is to use \text{\specint{a}} which will work in math (but not resize like an integral, you would need explicit support for that in the font) – David Carlisle Jan 01 '22 at 16:50
  • see https://tex.stackexchange.com/a/618129/1090 – David Carlisle Jan 01 '22 at 17:25
  • Thank you @DavidCarlisle, this is very helpful. – navona Jan 01 '22 at 17:28
  • Is this an OpenType math font with a MATH table, or is there a separate big-integral symbol? – Davislor Jan 01 '22 at 17:36
  • @Davislor as far as I understand it's a one character font with an integral sign in the slot for a so no math table... – David Carlisle Jan 01 '22 at 17:40
  • @Davislor Yes, as DavidCarlisle said, I made a one character font, and assigned the integral character to the 'a'. I was thinking I'd modify the integral symbol within Overleaf (i.e., adjust the size) to display it properly when using it out-of-line. Is there a better way to do this? Any thoughts/guidance much appreciated -- I'm totally new to all elements of this. – navona Jan 02 '22 at 18:14

0 Answers0