9

I've run out of letters and I would like to use the Hiragana ''ro'' in a latex document. How can I produce it in the simplest way?

6

This example works with lua-, xe-, pdf- and with plain latex (followed by dvips and ps2pdf conversion).

% run: *latex mal-japanese.tex
% or 
% latex mal-japanese.tex
% dvips mal-japanese.dvi
% ps2pdf mal-japanese.ps
\documentclass{article}
\pagestyle{empty}
\begin{document}
% pdftex testfont
% --> dmjhira
% --> \table\bye
\font\maljapanese=dmjhira at 2ex % This is a matter of taste.
Some text {\maljapanese\char"4D} before $a+\textrm{\maljapanese\char"4D}=c$ some text {\maljapanese\char"4D} after.
\end{document}

mwe

13

I'm not sure people reading your document will understand the symbol or know how to pronounce it. However, here's a way without loading the whole CJKutf8

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{newunicodechar}

\newunicodechar{ろ}{\text{\usefont{U}{min}{m}{n}\symbol{'215}}}

\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}

\begin{document}
$a+ろ=c$
\end{document}

enter image description here

If you have problems in typing the character directly, just define a command for it:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}

\newcommand{\hiraro}{\text{\usefont{U}{min}{m}{n}\symbol{'215}}}

\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}

\begin{document}
$a+\hiraro=c$
\end{document}

Here's the complete table of the udmj30 font, if you want to extend the usage to other Hiragana:

enter image description here

In case you don't have udmj30 (probably due to an incomplete TeX distribution), you can try dmjhira:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}

\newcommand{\hiraro}{\text{\usefont{U}{min}{m}{n}\symbol{'115}}}

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

\begin{document}
$a+\hiraro=c$
\end{document}

Here's the table of the font:

enter image description here

The syntax is \symbol{'<octal number>} or \symbol{"<hexadecimal number>} or also \symbol{<decimal number>}. Just look up the table for the correct number.

  • Thanks. I've found the following error while compiling: Package newunicodechar Error: ASCII character requested – user17786 Apr 15 '14 at 11:00
  • @user17786 Are you saving your file as UTF-8? – egreg Apr 15 '14 at 11:01
  • @user17786 I've added an alternative way. – egreg Apr 15 '14 at 12:13
  • Thanks. It now says that the font udmj30 is not loadable. But Malipivo's slutins is working fine. – user17786 Apr 15 '14 at 12:28
  • @user17786 I'll add the correction for using dmjhira – egreg Apr 15 '14 at 12:37
3

enter image description here

% arara: lualatex

\documentclass{article}
\usepackage{luatexja-fontspec}
\setmainjfont{MS Mincho}    
\newcommand{\HiraganaRo}{ろ}

\begin{document}
\[\HiraganaRo = 42\]
In the formula I use the symbol \HiraganaRo{} which is taken from the Japanese Hiragana alphabet.
\end{document}
  • This is great, but I use plain latex. – user17786 Apr 15 '14 at 11:01
  • 1
    @user17786 Are you using latex or pdflatex? – Malipivo Apr 15 '14 at 11:15
  • good point. I'm using pdflatex. – user17786 Apr 15 '14 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.