Forums: 公開討議/質問 (Thread #36359)

アポストロフィが全角になってしまう (2015-01-07 18:25 by pecorarista #75200)

TeXLive 2014 の lualatex を使用しています.
スライドで欧文の部分も和文用のフォントを使いたいのですが,
コード中に半角で書いたアポストロフィが PDF だと全角になってしまいます.
今は CID を直接指定して対応しているのですが,
適切な対応方法がありましたら教えていただきたいです.
よろしくお願いします.

\documentclass{beamer}
\usepackage{luatexja}
\usepackage{luatexja-otf}
\usepackage{luatexja-fontspec}
\usepackage[deluxe,hiragino-pron]{luatexja-preset}
\setsansfont{Hiragino Kaku Gothic ProN W3}
\setmainfont{Hiragino Kaku Gothic ProN W3}
\renewcommand{\kanjifamilydefault}{\gtdefault}
\begin{document}
\begin{frame}
I'm %PDF では全角
I\CID{96}m %半角+前後にスペース
I$\text{\CID{96}}$m %半角
\end{frame}
\end{document}

Reply to #75200×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

Re: アポストロフィが全角になってしまう (2015-01-07 18:47 by h7k #75201)

[メッセージ #75200 への返信]
> TeXLive 2014 の lualatex を使用しています.
> スライドで欧文の部分も和文用のフォントを使いたいのですが,
> コード中に半角で書いたアポストロフィが PDF だと全角になってしまいます.

ヒラギノフォントは手元にないので推測ですが,
\setsansfont[CharacterWidth=Proportional]{Hiragino Kaku Gothic ProN W3}
\setmainfont[CharacterWidth=Proportional]{Hiragino Kaku Gothic ProN W3}
と,文字幅をプロポーショナルにする指定をつけるとどうでしょう.

> I\CID{96}m %半角+前後にスペース
これは,\CID{96} が(全角幅の)和文文字と認識されて,
前後に和欧文間の四分空きが入るためです.
Best Answer Reply to #75200

Reply to #75201×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

Re: アポストロフィが全角になってしまう (2015-01-07 19:18 by pecorarista #75202)

[メッセージ #75201 への返信]
> \setsansfont[CharacterWidth=Proportional]{Hiragino Kaku Gothic ProN W3}
> \setmainfont[CharacterWidth=Proportional]{Hiragino Kaku Gothic ProN W3}
> と,文字幅をプロポーショナルにする指定をつけるとどうでしょう.

上記の方法で想定したとおりに表示されました.
とりあえず動くのでいいかと放置していましたが,コードが不自然になりもやもやしていました.
教えていただきとても助かりました.
ありがとうございます.
Reply to #75201

Reply to #75202×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login