3

I am writing a document that contains several languages, including English and Japanese (polyglossia, xeLatex, Windows 7, TeXLive, TeXWorks).

For English, I prefer the classic Hoefler Text font, and since English is the main language, it unfortunately also influences the numerals that appear inside the Japanese environment. The resulting output is quite mismatched with the numerals appearing to have the wrong size and position inside horizontal texts, and producing the wrong spacing in vertical texts. Here is a minimal example:

 \documentclass[12pt]{article}
 \usepackage[a4paper,vmargin=2cm,hmargin=2cm,showframe=false]{geometry}
 \usepackage{xunicode}

 \usepackage{fontspec}

 \usepackage{polyglossia}

 \usepackage{setspace}

 \setmainlanguage{english}

 %Setting main fonts for English (Latin alphabet) text
 \setmainfont[Mapping=tex-
 text,Ligatures=TeX,Scale=1,Color=black,FakeBold=0,AutoFakeSlant=0]{Hoefler 
 Text}
 \setsansfont[Ligatures=TeX]{Geneva}
 \setmonofont{Noto Mono}

 %-------------------------------------------------------%%%

 %%% CJK requires a different treatment
 \usepackage[space,AutoFallBack=true]{xeCJK}

 \usepackage[CJK,overlap]{ruby} % use \ruby{kanji}{kana} to set Furigana

 % position and size of horizontal Furigana (global): below/right
 \renewcommand{\rubysep}{-4ex}
 \renewcommand{\rubysize}{0.5}

 \XeTeXlinebreaklocale "ja"
 \XeTeXlinebreakskip=0em plus 0.1em minus 0.01em
 % we also drop paragraph indentation in order to get proper alignment
 \setlength{\parindent}{0pt}

 \setCJKmainfont[Mapping=tex-text,Script=CJK,BoldFont=MS 
 Gothic,ItalicFont=Meiryo,Scale=1,FakeBold=0]{Kozuka Mincho Pro}
 \setCJKfamilyfont{cjk-vert}[Script=CJK,RawFeature=vertical]{Kozuka Gothic 
 Pro M} %vertical font assignment\
 \newCJKfontfamily\strokefont{KanjiStrokeOrders} %for kanji stroke orders
 \setCJKsansfont{Noto Sans CJK SC}
 \setCJKmonofont{cwTeXFangSong}

 \newenvironment{japanese}


 \begin{document}

 \section{Japanese 1}

 \subsection{Horizontal and Vertical Furigana}

 \begin{japanese}

 \foreignlanguage{english}{An example of Furigana under the character on 
 this horizontal line} 3 \ruby{学}{がく}\ruby{生}{せい}. \par%

 \foreignlanguage{english}{An example of vertical text with vertical 
  Furigana:}\\
 \begin{figure}[ht!]
 \begin{center}
 \rotatebox{-90}{
 \begin{minipage}{0.32\textwidth}
 \CJKfamily{cjk-vert} %setting font locally
 \doublespacing  %setting double space for vertical alignment
 \renewcommand{\rubysep}{-5ex} %setting ruby spacing locally
 \renewcommand{\rubysize}{0.5} %setting ruby size locally
 きのう、\textbf{ラース}は \ruby{山}{やま}\ruby{本}{もと}と あいました。 
「こんにちは、\ruby{山}{やま}\ruby{本}{もと}さん。おげんき 100 ですか。」
 \end{minipage}
 }
 \end{center}
 \end{figure}

 \end{japanese}

 \section{Japanese 2}

 \begin{japanese}

 \subsection{ご使用のまえに 1000} 

 本機は、AC(交流)100 V専用の機械です。絶対に100 V以上の電 圧やDC (直流)を加え
 ないでください。

 \end{japanese}

 \end{document}   

The resulting PDF is quite ugly.PDF
Note the number '3' before the horizontal Furigana in Section 1 is out of place on the line. Note the number '100' in the vertical minipage environment is both too small and weirdly situated, so the spacing above the number and below it is different. The number '1000' in the subsection heading also appears out of kilter. Finally, for the typical text in subsection 2.1, the number '100' again appears too small and simply incompatible with the rest of characters in that sentence.

Is it possible to define the numerals/digits for the Japanese environment separate from the main environment? Is it possible to resolve the discrepancy between horizontal and vertical alignment of the numbers?

Finally, although the numbering of the sections seems OK, I neither like the size of the numerals of subsections nor the horizontal spacing between the heading and the number. Is it possible to control this spacing?

Any help would be greatly appreciated!!

0
1

Have you tried using full-width numerals?

When you use normal A-Z and 0-9 , . ? ! ( ) and other basic "English" ASCII characters, they are proportional (each character has a unique width) and they rotate when vertical.

If you are writing an excerpt of French or Russian Cyrillic, the same thing happens.

When you write Chinese and Japanese, you always should use full-width characters if the content is part of the sentence. Full width I, A, 1, O, and ? are all the same width. They are all the same size as one block of kana, kanji, or hanzi. They do not rotate.

For vertical Korean, you also use full-width characters.

........

中国和IMF。 (Full-width)

........

我读「Les Misérables」。 (Normal)

........

When you rotate the first sentence to vertical lines, each character looks the same. When you rotate the second sentence to vertical lines, the French book title will rotate. This is especially important for Arabic. In Arabic text, the letters must connect in a cursive way. The block of text must run together. You cannot have one normal looking Arabic letter and then one normal looking Arabic character by itself directly below. That is why full-width only exists for A-Z and 0-9 which are used in Chinese, Korean, and Japanese. For other scripts or for English phrases (and surprisingly, for Pinyin), use normal width. There are no full-width versions of accents, precomposed characters, Arabic, Greek, Devangari, Cambodian, etc.

Full width characters have unique codepoints in Unicode.

Your IME should help or you can copy-paste from https://lingojam.com/FullWidthTextGenerator.

Also, mind this. A full width characters are mono-spaced, but all change slightly in vertical text (sometimes by shifting from bottom to right as in small kana (tsu). Others do rotate, such as ( ) and the katakana vowel elongater mark.

This Unicode page is great

https://www.unicode.org/reports/tr50/

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.