1

I'm using Xelatex. I'm trying to type the Japanese marujirushi symbol into my document. The exact way I get the symbol is to toggle my keyboard to the Microsoft Japanese IME, type maru, hit the spacebar and select ○ 丸印. If I type it into Google, it tells me the character is Unicode Character 'WHITE CIRCLE' (U+25CB).

I tried \textbigcircle from the textcomp package, but it also didn't work. However, I don't think that character is the right size, so I don't want it.

I also thought it might be a font issue, but I was using MS Mincho and it shows up fine in Microsoft Word. So I assume it would show up in my document too.

More context: I'm writing a document with both Latin letters and CJK. xeCJK used one font for the Latin letters and MS Mincho for the Japanese characters. I'd like to be able to retain that.

How can I get this character to display in my document?

Here is my example:

\documentclass{article}
\usepackage[boldfont]{xeCJK}
\setCJKmainfont{MS Mincho}

\begin{document}

    ○ Keyboard input of ``marujirushi"

\end{document}

Here is a list of packages that I'm using in my document, for context:

\usepackage[boldfont]{xeCJK}
\usepackage{makecell}
\usepackage{csquotes}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{titlesec}
\usepackage{ruby}
\usepackage{textcomp}
\usepackage{tipa}
0

2 Answers 2

0

The character does not belong to the CJK family, so xeCJK will print it in the Latin family and the default Latin Modern hasn't it.

You have two strategies:

  1. define as main (Latin) font one that has the glyph (it could be the same font you use for CJK glyphs, if it supports Latin)
  2. redefine the character to issue a command for selecting the CJK font

You can also combine the two by defining a font that has the glyph.

First strategy

\documentclass{article}
\usepackage{xeCJK}

\setCJKmainfont{Hiragino Mincho Pro W3} % or whatever
\setmainfont{Hiragino Mincho Pro W3}

\begin{document}

○ Keyboard input of ``marujirushi"

\end{document}

enter image description here

Second strategy

\documentclass{article}
\usepackage{xeCJK}

\usepackage{newunicodechar}

\setCJKmainfont{Hiragino Mincho Pro W3} % or whatever

\ExplSyntaxOn
\newunicodechar{○}{{\xeCJK_select_font: ○}}
\ExplSyntaxOff

\begin{document}

○ Keyboard input of ``marujirushi"

\end{document}

enter image description here

Combined strategy

\documentclass{article}
\usepackage{xeCJK}

\usepackage{newunicodechar}

\setCJKmainfont{Hiragino Mincho Pro W3} % or whatever
\newfontfamily{\maru}{Hiragino Mincho Pro W3} % or whatever

\newunicodechar{○}{{\maru ○}}

\begin{document}

○ Keyboard input of ``marujirushi"

\end{document}

enter image description here

Note

As I don't have MS Mincho, I used a different CJK font, but it should be irrelevant.

Different strategy (caveat: no real testing done)

Use `\xeCJK_select_font:

\documentclass{article}
\usepackage{xeCJK}

\usepackage{newunicodechar}

\setCJKmainfont{Hiragino Mincho Pro W3} % or whatever

\ExplSyntaxOn
\newunicodechar{○}{{\normalfont\xeCJK_select_font: ○}}
\ExplSyntaxOff

\begin{document}

○ Keyboard input of ``marujirushi"

\end{document}

Be aware that no real testing has been done, as I know no Japanese, Chinese or Korean.

4
  • The first approach is inadvertently causing me other problems. So I'm currently going with your second approach. But now that I've thought about your combined approach some more, I think it might be the best if you could call the setCJKmainfont argument into the second argument of newfontfamily. I'm curious, is that possible (in a simple way)?
    – user171309
    Sep 29, 2018 at 18:45
  • @user171309 I had another solution, but as my knowledge of xeCJK is very limited, I wasn't so keen to show it. But now it's online.
    – egreg
    Sep 29, 2018 at 19:29
  • Thanks a lot! But I'm not sure why \normalfont is needed. Works well without it for me. Sorry for all the confusion and hassle. What I meant was, in your first combined strategy, is it possible to do something like this \newunicodechar{○}{{\X ○}} where X is a command that gives the font set in \setCJKmainfont. That way, you don't have to change the font in two places, just once in \setCJKmainfont. Is it not possible? That's why you need \newfontfamily? Sorry, I thought that would be a simple follow-up question. If you can point me to a related page, that's fine too.
    – user171309
    Oct 10, 2018 at 20:40
  • @user171309 Isn't \newunicodechar{○}{{\normalfont\xeCJK_select_font: ○}} what you want? (the fourth solution).
    – egreg
    Oct 11, 2018 at 17:10
0

Without using the CJK setting it works:

\documentclass{article}
\usepackage{fontspec}
%\usepackage[boldfont]{xeCJK}
%\setCJKmainfont{MS Mincho}
\setmainfont{MS Mincho}

\begin{document}

    ○ Keyboard input of ``marujirushi"

\end{document}

enter image description here

or alternatively:

\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{MS Mincho}
\newfontface\Mincho{MS Mincho}

\begin{document}

    {\Mincho○} Keyboard input of ``marujirushi"

\end{document}

enter image description here

0

You must log in to answer this question.

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