6

I defined the following macro (thanks to this question)

\font\maljapanese=dmjhira at 2.5ex
\newcommand{\yo}{\textrm{\!\maljapanese\char"48}}

which prints the Hiragana letter よ. This works fine in both text and inline math mode, but its size does not scale correctly when I use it in a subscript in math mode. In fact, it does not scale at all:

Inline: $a$; subscript: $f_a$.

Inline: $\yo$; subscript: $f_\yo$.

enter image description here

How can I reasonably fix this? I could add a version of \yo, say \subyo, which prints よ in a smaller font, but it does not seem elegant at all.

1 Answers1

7

You should never use \font in LaTeX.

\documentclass{article}
\usepackage{amsmath}

\DeclareFontFamily{U}{dmjhira}{} \DeclareFontShape{U}{dmjhira}{m}{n}{ <-> dmjhira }{}

\DeclareRobustCommand{\yo}{\text{\usefont{U}{dmjhira}{m}{n}\symbol{"48}}}

\begin{document}

$f_{\yo}+\yo$

\end{document}

enter image description here

In case you need other Hiragana characters, here's the complete font table of dmjhira

enter image description here

However, you should think twice (or more) whether inflicting your readers strange symbols that they know nothing about.

egreg
  • 1,121,712
  • 1
    The Hiragana よ is sometimes used to denote the Yoneda embedding. In any case, this is for my own notes and there's a very small chance that someone else will read them. – Lorenzo Riva Jun 25 '21 at 10:11
  • @egreg -- The hiragana character numbered 46 in this chart was requested for the STIX project, so use of some such symbols is not unknown in western math documents. – barbara beeton Jun 28 '21 at 17:01