質問用フォーラムです。ご質問の前に質問のしかたをご覧ください。

titleps でのページレイアウト設定について

- 上山 英二 の投稿

初めまして.僭越ながら初めての質問をさせていただきます.

以下の画像に示すようなページデザインにしたく思い,titleps パッケージを使い LuaLaTeX + jlreq で以下のソースコードをタイプセットしたところ,夥しい量のエラーが発生してしまいました.

以下に示すのがそのソース,及び log ファイルとなります:

\documentclass[
    paper=b5j,
    fontsize=11.5pt,
    jafontscale=0.9,
    onecolumn,
    gutter=12mm,
    fore-edge=12mm,
    head_space=18mm,
    foot_space=22.5mm
    ]{jlreq}

\usepackage[dvipsnames]{xcolor}
\usepackage{titleps}
\usepackage{tikz}
    \usetikzlibrary{calc}

\definecolor{mynavy}{HTML}{202f55}
\newpagestyle{mystyle}{%
    \setfoot[][]
    [\begin{tikzpicture}[remember picture,overlay]
        \fill[mynavy] ($(current page.south east)+(0,2)$)
        --($(current page.south east)+(-2.2,2)$)--($(current page.south east)+(-3.5,0.5)$)
        --($(current page.south west)+(0,0.5)$)--(current page.south west)
        --(current page.south east)--cycle;
        \node at ($(current page.south east)+(-1.4,1)$)
        {\fontsize{25pt}{50pt}\selectfont\bfseries\color{White}
        \texttt{\thepage}};
     \end{tikzpicture}
    ]
    {\begin{tikzpicture}[remember picture,overlay]
        \fill[mynavy] ($(current page.south west)+(0,2)$)
        --($(current page.south west)+(2.2,2)$)--($(current page.south west)+(3.5,0.5)$)
        --($(current page.south east)+(0,0.5)$)--(current page.south east)
        --(current page.south west)--cycle;
    \node at ($(current page.south west)+(1.4,1)$)
    {\fontsize{25pt}{50pt}\selectfont\bfseries\color{White}
    \texttt{\thepage}};
    \end{tikzpicture}
    }
    {}
    {}
}
\pagestyle{mystyle}

\begin{document}
ほげほげ。 \newpage
ふがふが。\newpage
あ\newpage
い\newpage
う\newpage
え\newpage
お\newpage
か\newpage
き\newpage
く\newpage
け\newpage

\end{document}
 
なお,実行環境は WSL2, Ubuntu 上の VSCode(TeX Live 2024)です.
 
 

zref-clever の日本語対応について意見を募りたい

- ya ra の投稿

zref-clever はいくつかの言語に対応するようになっており、v.0.4.8 現在、以下の 8 つの言語に対応しています。

  • 英語
  • イタリア語
  • オランダ語
  • スペイン語
  • ドイツ語
  • フランス語
  • ポルトガル語
  • ロシア語

今回、これに加えて日本語を対応させたいと考えています。

組織やジャーナル、想定される利用状況等によって慣習は異なると思いますが、どの場面であっても奇妙ではないフォーマルな日本語対応を目指したいと考えています。

zref-clever に関する概要は「zref-clever で簡単に相互参照しよう #LaTeX - Qiita」を参照してください。

素案

先に示した Qiita の記事 で示されている日本語対応の例をちょっとだけ変更したものを素案とします。

概ねこの素案で良いと思っていますが、他にご意見を聞きたいと考えています。

\zcDeclareLanguage[allcaps]{japanese}
\zcLanguageSetup{japanese}{
  namesep   = {\nobreak} ,
  pairsep   = {と} ,
  listsep   = {、} ,
  lastsep   = {、および} ,
  tpairsep  = {および} ,
  tlistsep  = {、} ,
  tlastsep  = {、および} ,
  notesep   = {:} ,
  rangesep  = {から} ,
  type = book ,
    Name-sg = 第 ,
    Name-pl = 第 ,
    refbounds = {,,,編} ,
  type = part ,
    Name-sg = 第 ,
    Name-pl = 第 ,
    refbounds = {,,,部} ,
  type = chapter ,
    Name-sg = 第 ,
    Name-pl = 第 ,
    refbounds = {,,,章} ,
  type = section ,
    Name-sg = 第 ,
    Name-pl = 第 ,
    refbounds = {,,,節} ,
  type = paragraph ,
    Name-sg = 第 ,
    Name-pl = 第 ,
    refbounds = {,,,段落} ,
  type = appendix ,
    Name-sg = 付録 ,
    Name-pl = 付録 ,
  type = page ,
    Name-sg = p. ,
    Name-pl = pp. ,
    namesep = ~ ,
    rangesep = \textendash ,
    rangetopair = false ,
  type = line ,
    Name-sg = l. ,
    Name-pl = l. ,
    namesep = ~ ,
    rangesep = \textendash ,
    rangetopair = false ,
  type = figure ,
    Name-sg = 図 ,
    Name-pl = 図 ,
  type = table ,
    Name-sg = 表 ,
    Name-pl = 表 ,
  type = item ,
    Name-sg = 項目 ,
    Name-pl = 項目 ,
  type = footnote ,
    Name-sg = 脚注 ,
    Name-pl = 脚注 ,
  type = endnote ,
    Name-sg = 後注 ,
    Name-pl = 後注 ,
  type = note ,
    Name-sg = 注記 ,
    Name-pl = 注記 ,
  type = equation ,
    Name-sg = 式 ,
    Name-pl = 式 ,
    refbounds-first-sg = {,(,),} ,
    refbounds = {(,,,)} ,
  type = theorem ,
    Name-sg = 定理 ,
    Name-pl = 定理 ,
  type = lemma ,
    Name-sg = 補題 ,
    Name-pl = 補題 ,
  type = corollary ,
    Name-sg = 系 ,
    Name-pl = 系 ,
  type = proposition ,
    Name-sg = 命題 ,
    Name-pl = 命題 ,
  type = definition ,
    Name-sg = 定義 ,
    Name-pl = 定義 ,
  type = proof ,
    Name-sg = 証明 ,
    Name-pl = 証明 ,
  type = result ,
    Name-sg = 結果 ,
    Name-pl = 結果 ,
  type = remark ,
    Name-sg = 注意 ,
    Name-pl = 注意 ,
  type = example ,
    Name-sg = 例 ,
    Name-pl = 例 ,
  type = algorithm ,
    Name-sg = アルゴリズム ,
    Name-pl = アルゴリズム ,
  type = listing ,
    Name-sg = コード ,
    Name-pl = コード ,
  type = exercise ,
    Name-sg = 演習 ,
    Name-pl = 演習 ,
  type = solution ,
    Name-sg = 解法 ,
    Name-pl = 解法 ,
}

前提事項

zref-clever には大きく 2 つの部分で日本語対応が必要になります。

接続助詞:

pairsep 同じカウンタを 2 つ参照する場合の接続助詞
listsep 同じカウンタを 3 つ以上参照する場合の最後以外の接続助詞
lastsep 同じカウンタを 3 つ以上参照する場合の最後の接続助詞
rangesep カウンタを範囲で参照する場合の接続助詞
tpairsep 異なるカウンタを 2 つ参照する場合の接続助詞
tlistsep 異なるカウンタを 3 つ参照する場合の最後以外の接続助詞
tlastsep 異なるカウンタを 3 つ参照する場合の最後の接続助詞
namesep 参照名とカウンタの間
notesep note オプションで追加した参照のノートとの間

カウンタの参照名:

book 編(\bookmemoir 文書クラス等で \part と同じレベルの見出しとして定義される)
part 部(\part
chapter 章(\chapter
section 節(\section
paragraph 段落(\paragraph
appendix 付録(\appendix
page ページ
line 行(memoir 文書クラスの poemlinelistings パッケージの lstnumber に対応)
figure 図(figure 環境)
table 表(table 環境)
item 番号付きリストの項目(enumerate 環境)
equation 数式
footnote 脚注
endnote 後注
note footnoteendnote 以外の注
algorithm アルゴリズム(algorithms パッケージなどのキャプション番号)
listing コード(listings パッケージのキャプション番号)
theorem 定理
corollary
definition 定義
example
exercise 演習
lemma 補題
proof 証明
proposition 命題
remark 注意
result 結果
solution 解法

今回、これらの既定となる日本語構成を考えますが、ユーザーがこれらの個別変更も可能です。 そのため、ある程度多くの人の合意の得られる形になっていれば良いと考えています。

特に知りたいこと

今回、私が本ディスカッションで特に知りたいことは以下の点です。

  • 複数のカウンタを参照した際の接続助詞
  • いくつかのカウンタの参照の仕方
  • 改行を避けた方が良い箇所

複数のカウンタを参照した際の接続助詞

zref-clever では、複数のカウンタを参照する場合、カウンタの間に自動的に接続助詞を挿入します。

cleveref における日本語構成の接続助詞を見ると、以下のようにすることが妥当だと考えられます。

  pairsep   = {と} ,
  listsep   = {、} ,
  lastsep   = {、および} ,
  tpairsep  = {および} ,
  tlistsep  = {、} ,
  tlastsep  = {、および} ,
  rangesep  = {から} ,

また、読点を のどちらにするべきかも疑問の余地があります。どちらの方が好ましいでしょうか。

いくつかのカウンタの参照の仕方

日本語で以下のカウンタを参照する場合の参照の仕方が知りたいです。(添付ファイルと添付画像も参考にしてください)

  • page

    “p.”・“pp.” とするか、“ページ” とするか。

    • 「pp. 1 と 3」、「pp. 1--3」、「pp. 1、3 および 5」
    • 「1 と 3 ページ」、「1--3 ページ」、「1、3 および 5 ページ」

    また、“ページ” とする場合、複数ページの参照のときカウンタそれぞれに “ページ” と当てるべきか。

    • 「1 と 3 ページ」、「1--3 ページ」、「1、3 および 5 ページ」
    • 「1 ページと 3 ページ」、「1 ページから 3 ページ」、「1 ページ、3 ページおよび 5 ページ」
  • line

    “l.” とするか、“行” とするか、“行目” とするか。

    • 「l. 1」、「l. 1--3」、「l. 1、3 および 5」
    • 「行 1」、「行 1--3」、「行 1、3 および 5」
    • 「1 行目」、「1--3 行目」、「1、3 および 5 行目」

    また、page と同じように、複数行を参照するときにそれぞれのカウンタに参照名を当てるべきか。

    • 「1 行目」、「1--3 行目」、「1、3 および 5 行目」
    • 「1 行目」、「1 行目から 3 行目」、「1 行目、3 行目および 5 行目」
  • paragraph

    \paragraph に番号が与えられることは少ないと思いますが、これを参照する場合はどのような参照名にするべきか。

    上の例では「第 1 段落」等となるようにしています。

    \sub(sub)section は「第 1.1 節」のように扱うようになっているため、\paragraph に “項” や “目” を当てることが出来ますが、\paragraph の参照名にこれらを当てるのは不自然かも……

改行を避けた方が良い箇所

素案では参照名とカウンタの間の namesep\nobreak としているのみです。これ以外にも改行を避けるように構成するべき箇所はあるでしょうか。


この他、おかしいと感じたところがあれば教えてください。

この質問の回答に期限は無いのですが、年末くらいにリポジトリに PR を出したいと考えています。


添付 ref-line-image-1.png
添付 ref-page-image-1.png

日本語版 chemfig マニュアル

- TPKato の投稿

はじめまして。
chemfig のマニュアルを日本語に訳しました。

https://github.com/TPKato/chemfig-ja にて公開しています。

誤植、誤訳、感想等ありましたら、GitHub の Issues/Pull requests か、(このフォーラムの使い方として問題なければ) ここでご報告いただければありがたいです。

現時点では作者には連絡していませんが、少し様子をみて問題がなさそうだったら連絡をしようと思っています。

\UTFでUnicodeの文字が出せない

- 名前 無 の投稿

こんにちは。ネットで検索してみると,以前にも同じような質問があったのですが,それでも解決できなかったので投稿しております。

最近,自由にフォントを使いたいために,LuaLaTeXを学び始めるようになりました。

パソコンに詳しくないので,ハードウェア,ソフトウェアの何もわからないですが,とりあえず「MacOSでTeXShop,TeXLiveの最新版」をインストールして使っています。

さて,本題なのですが,フォントを自由に使えるようになったはいいものの,Unicodeの文字が出せないのに困っております。

問題のコードは↓です。

¥documentclass{ltjsarticle}
¥usepackage[no-math,deluxe,expert]{luatexja-preset}
¥begin{document}

{¥jfontspec{HiraginoSans-W3} ★☆♂}%ここはきちんと出力される

{¥jfontspec{HiraginoSans-W3} ☃}%ここでコンパイルエラー

¥end{document}

以下,エラーメッセージ↓

l.9 {\jfontspec{HiraginoSans-W3} \UTF
                                   {2603}}

このように,\UTFを認識してくれません。

インターネットの知識のみなので,システムの基礎をきちんと知りません。個人的には,MacOS上のFont Book上にあるリストに照合していると考えてしまっています。事実上Font Bookにある文字は全て出力できるのではないかと考えています。

解決策と,軽くで良いのでこの辺りを解説してくれる心優しい方はいらっしゃいませんでしょうか。何卒よろしくお願いいたします。

添付 スクリーンショット 2024-12-12 11.26.42.png

ページ番号表示位置の調整

- yasu oka の投稿
原稿の余白を増やすように指定されて、geometory.styを使って、本文の余白は、指定通りにできたのですが、ヘッダーの端に出力されるはずのページ番号がの出力が、余白にはみ出てしまいます。どうにか、収めようと思うのですが、どこをいじれば、いいでしょうか。プリアンプル部分は、次のようになっています。柱は、\pagestyle{myheadings}とし、\markboth{\centerline{\small{◯◯学研究 XX}}}{\centerline{\small{◯◯の研究}}}で指定しています。 \documentclass[uplatex,twoside,b5paper]{jsarticle} \usepackage[expert,deluxe,multi,jis2004]{otf} \usepackage{txfonts} \usepackage[T1]{fontenc}%T1フォントエンコーディング \usepackage{textcomp}%TS1追加フォントエンコーディング \usepackage[utf8]{inputenc}%欧文 UTF-8エンコード入力 \usepackage[prefernoncjk]{pxcjkcat}%ASCII 以外の Unicode 文字も和文としてではなく欧文扱い %\usepackage{extaccent,DeclareUnicode} \usepackage[japanese,english]{babel} \usepackage{longtable} %\usepackage{slashbox} \usepackage{url}%% \usepackage{ulem} \usepackage{multicol} \usepackage{endnotes} \usepackage[top=35truemm,bottom=46truemm,left=25truemm,right=25truemm]{geometry} \setcounter{page}{1} \usepackage[morefloats=20]{morefloats} \newcommand{\lc}[1]{\noindent {\sf\small #1}\vspace*{0.5zh}} \newcommand{\lct}[1]{\hspace*{0zw}{$_{_{_{_{\!\!\!\hspace{0.8pt}\triangle\hspace{0.5pt}}\!\!}}\!\!}$}\marginpar{\scriptsize \textsf{#1}}\hspace*{0zw}} \renewcommand{\baselinestretch}{0.9} \newenvironment{hangall}[1]{\begin{flushleft}\hangindent = #1em}{\end{flushleft}}%文献表用 \renewcommand{\thefootnote}{\ajLabel\ajKakko{footnote}} \makeatletter \def\@makefnmark{\hbox{\@textsuperscript{\normalfont(\@thefnmark)}}} \def\thefootnote{\ifnum\c@footnote>\z@\leavevmode\lower.5ex\hbox{}\@arabic\c@footnote\fi} \makeatother \renewcommand{\theendnote}{\alph{endnote}} \makeatletter \def\@makeenmark{\hbox{\@textsuperscript{\normalfont(\@theenmark)}}} \def\enoteformat{\rightskip\z@ \leftskip=22pt \parindent\z@ \leavevmode\llap{\hbox{\@textsuperscript{\normalfont(\@theenmark)\ }}}\hspace*{0zw}} \makeatother \pagestyle{myheadings} \def\noindbf#1{\noindent\textbf{#1}} %------------------------ %セクション,サブセクション \makeatletter \def\section{\@startsection {section}{1}{\z@}{-3.5ex plus -1ex minus -.2ex}{2.3ex plus .2ex}{\normalsize\bf}} \makeatother \makeatletter \def\subsection{\@startsection {subsection}{1}{\z@}{-3.5ex plus -1ex minus-.2ex}{2.3ex plus .2ex}{\normalsize\bf}} \makeatletter \def\subsubsection{\@startsection {section}{1}{\z@}{-3.5ex plus -1ex minus -.2ex}{2.3ex plus .2ex}{\normalsize\bf}} \makeatother \begin{document} \markboth{\centerline{\small{◯◯学研究 XX}}}{\centerline {\small{◯◯の研究}}} \thispagestyle{empty}%この頁は頁番号をふらない。 \vspace*{9mm} \thispagestyle{empty}%この頁は頁番号をふらない。 \vspace*{9mm} \begin{center} {\Large ◯◯の研究}\\ {\Large △△△△ についての覚書} \end{center} 内容 \end{document} よろしくお願いします。

\nolinebreak の使い方

- ueki ichiro の投稿

Windows11の富士通ノートパソコンに23年版のTEXをのせて論文を書いています。

プリアンブルは下記の通りです。

\documentclass[11pt,fleqn,b5paper,twoside]{jsarticle}

\setlength{\textwidth}{40zw}

\setlength{\oddsidemargin}{-1cm}

\setlength{\evensidemargin}{0cm}

\setlength{\topmargin}{-1cm}

\setlength{\textheight}{19cm}

\usepackage{amsmath}

\usepackage{tabularx}

\pagenumbering{roman}

\begin{document}

論文中の目次を撮った下記のスクリーンショット「目次1」中段の「付録1」の行は、末尾の文字「腐食」だけが2行目になります。「付録1」を1行にまとめるため、下記のように「腐食」の前に\nolinebreakを挿入したところ、かえってスクリーンショット「目次2」のように「腐食」の前にあった文字「の」が2行目の先頭に来てしまいました。\nolinebreakの正しい使い方を教えてください。

「付録1.β相から種々の速度で冷却したジルカロイ-2の高温水および水蒸気中での\nolinebreak 腐食」

なおスクリーンショット「目次1」では「付録2」は「付録1」に比べると字間のスペースが小さく同じ文字数が1行で書かれています。\nolinebreakを使わずこのように「付録1」を1行にまとめることもできるのでしょうか。なお同じように書いているのに「付録2」は「付録1」に比べると字間のスペースが小さくなるのは何故でしょうか。

  植木

添付 目次1.png
添付 目次2.png

task内で画像を挿入できるか.

- y h の投稿
\documentclass[dvipdfmx,12pt,fleqn]{jsbook}
\usepackage{tasks}
\usepackage{tikz}
\usepackage{tasks}
\usepackage{enumitem}
 
begin{document}
\settasks{counter-format= }
\begin{tasks}(2)
\task\egg{0}\;\input{graph1.pdf}
\task\egg{1}\;\input{graph2.pdf} \\ \vspace{-3mm}
\task\egg{2}\;\input{graph3.pdf}
\task\egg{3}\;\input{graph4.pdf} \\ \vspace{-3mm}
\end{tasks}
\end{document}
 
として,画像のような選択肢を作成したいと考えているのですが,
なぜかうまくいかないです.どなたか代理で作成していただけないでしょうか.

*\egg{}はマークを呼び出すコマンドです.↓
\newcommand{\egg}[1]{\raisebox{-3pt}{
    \begin{tikzpicture}[x=1pt,y=1pt,line width=1pt]
        \draw (0,0) ellipse (4.5 and 6);
        \draw (0,0) node {
            \usefont{T1}{phv}{m}{n}
            \fontsize{9pt}{0}\selectfont #1 \/};
    \end{tikzpicture}}}
 
*graph◯.pdfなどはこちらで作成したものなので,画像に関しては,なんでもいいです.
補足で,画像のようにtasks環境の中でtikzを用いてグラフを作成し挿入する方法も知りたいです.

画像

bmパッケージとfontdimen

- かず の投稿

こんにちは かずです。

fontdimenで変更した値が\bm部分で無視された結果になってしまいます。

bmパッケージを利用しても変更したfontdimenの値が適用されるようにするにはどうしたらいいでしょうか。

{}を2重で括っている箇所がありますが、2重で括っても同じように変更したfontdimenの値がされてほしいからです。

よろしくお願いします。

\documentclass[dvipdfmx]{jsarticle}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{bm}


\newdimen\savedimen
\begin{document} 
\noindent

\hrule
\verb|\fontdimen13| $\sigma_{13}$
\savedimen=\fontdimen13\textfont2
\fontdimen13\textfont2=10pt

$
  a^2 \bm{a^2} \bm{{a^2}}
  a_2 \bm{a_2} \bm{{a_2}}
  a^2_2 \bm{a^2_2} \bm{{a^2_2}}
$
\fontdimen13\textfont2=\savedimen

\hrule
\verb|\fontdimen14| $\sigma_{14}$
\savedimen=\fontdimen14\textfont2
\fontdimen14\textfont2=10pt

$
  a^2 \bm{a^2} \bm{{a^2}}
  a_2 \bm{a_2} \bm{{a_2}}
  a^2_2 \bm{a^2_2} \bm{{a^2_2}}
$
\fontdimen14\textfont2=\savedimen


\hrule
\verb|\fontdimen16| $\sigma_{16}$
\savedimen=\fontdimen16\textfont2
\fontdimen16\textfont2=10pt

$
  a^2 \bm{a^2} \bm{{a^2}}
  a_2 \bm{a_2} \bm{{a_2}}
  a^2_2 \bm{a^2_2} \bm{{a^2_2}}
$
\fontdimen16\textfont2=\savedimen

\hrule
\verb|\fontdimen17| $\sigma_{17}$
\savedimen=\fontdimen17\textfont2
\fontdimen17\textfont2=10pt

$
  a^2 \bm{a^2} \bm{{a^2}}
  a_2 \bm{a_2} \bm{{a_2}}
  a^2_2 \bm{a^2_2} \bm{{a^2_2}}
$
\fontdimen17\textfont2=\savedimen

\end{document}

コードドキュメント内の日本語に日本語フォントを当てる方法

- ya ra の投稿

zref-clever の日本語対応について意見を募りたい」に関連する質問です。

zref-clever に日本語を対応させる過程で zref-clever.dtx に日本語が入っていると、フォントが無いためコードドキュメント (zref-clever-code.pdf) では豆腐になってしまいます。

これに対応するため babel を利用して日本語フォントを与えることで、日本語を表示させることが出来るようになりました。

しかし、他の CJK フォントを追加すると日本語フォントと重複する文字に関して正しくフォントが当たらないことがあります。 日本語の言語構成をしている箇所で日本語フォントを当てる方法はあるでしょうか。

以下の要件を満たしたものを得たいと考えています。

  • 日本語には日本語フォント、韓国語には韓国語フォントが当たっている
  • ラテン文字やそのほかの記号は主となるフォント(今回は CMU Typewriter Text)が当たっている

現在 zref-clever には他の CJK 言語が含まれていないため杞憂であることは分かっていますが、出来ればそれぞれの言語に対応するフォントが当たるようになっていると良いなぁと考えています。


[お願い]

zref-clever の日本語対応について意見を募りたい」で zref-clever の日本語対応について意見を募っています。重ねてよろしくお願いします。

問題点の再現

babel を使って次のように日本語フォントと韓国語フォントを構成すると、\babelprovide による構成の順序によって漢字に当てられるフォントが変わってしまいます。 (以下の例は添付ファイルと同じもの)

%#! lualatex
\documentclass{l3doc}

\usepackage[main=english]{babel}
\usepackage{fontspec}

\babelfont{rm}{CMU Serif}
\babelfont{sf}{CMU Sans Serif}
\babelfont{tt}{CMU Typewriter Text}

%% babelprovide の順序を
%%    japanese > korean にすると漢字が korean フォントになる
%% 逆にすると漢字が japanese フォントになる
\babelprovide[onchar=ids fonts]{japanese}
\babelprovide[onchar=ids fonts]{korean}
%%

\babelfont[japanese]{rm}{Harano Aji Mincho}
\babelfont[japanese]{sf}[Scale=0.9]{Harano Aji Gothic}
\babelfont[japanese]{tt}[Scale=0.8]{Harano Aji Gothic}
%% CMU Typewriter Text に対して大きいのでScaleを調整

\babelfont[korean]{rm}{baekmukbatang}
\babelfont[korean]{sf}[Scale=0.9]{baekmukdotum}
\babelfont[korean]{tt}[Scale=0.85]{baekmukgulim}

\begin{document}

\DocInput{test.dtx}

\end{document}

%% test.dtx
%    \begin{macrocode}
Hello New World.
%    \end{macrocode}

%    \begin{macrocode}
こんにちは New 世界。
%    \end{macrocode}

%    \begin{macrocode}
안녕하세요 New 세계.
%    \end{macrocode}

zref-clever での実際の再現方法

上の例で MWE となっていると考えていますが、間違っていると嫌なので実際に想定されている状況も並記しておきます。

l3build の実行

リポジトリ から git clone してファイルをダウンロードし、zref-clever/ ディレクトリ内で以下のように l3build を実行すると、必要な sty ファイルやドキュメントファイルを取得できるようになります。

l3build doc

再現方法

2 つのファイルを変更します。

  • zref-clever.dtx
  • zref-clever-code.tex
zref-clever.dtx

zref-clever.dtx の 12043 行目 以降に以下のような日本語のための言語構成を追加します。

zref-clever.dtx のみを変更した状態で l3build を実行すると、PDF が正常に生成されますが、日本語の部分は豆腐になってしまいます。

% \subsection{Japanese}
%
%
%    \begin{macrocode}
%<*package>
\zcDeclareLanguage[ allcaps ]{ japanese }
%</package>
%    \end{macrocode}
%
%    \begin{macrocode}
%<*lang-japanese>
%    \end{macrocode}
%
%    \begin{macrocode}
namesep   = {\nobreak} ,
pairsep   = {と} ,
listsep   = {、} ,
lastsep   = {、および} ,
tpairsep  = {および} ,
tlistsep  = {、} ,
tlastsep  = {、および} ,
notesep   = {:} ,
rangesep  = {から} ,

type = book ,
  Name-sg = 第 ,
  Name-pl = 第 ,
  refbounds = {,,,編} ,

type = part ,
  Name-sg = 第 ,
  Name-pl = 第 ,
  refbounds = {,,,部} ,

type = chapter ,
  Name-sg = 第 ,
  Name-pl = 第 ,
  refbounds = {,,,章} ,

type = section ,
  Name-sg = 第 ,
  Name-pl = 第 ,
  refbounds = {,,,節} ,

type = paragraph ,
  Name-sg = 第 ,
  Name-pl = 第 ,
  refbounds = {,,,段落} ,

type = appendix ,
  Name-sg = 付録 ,
  Name-pl = 付録 ,

type = page ,
  Name-sg = p. ,
  Name-pl = pp. ,
  namesep = ~ ,
  rangesep = \textendash ,
  rangetopair = false ,

type = line ,
  Name-sg = l. ,
  Name-pl = l. ,
  namesep = ~ ,
  rangesep = \textendash ,
  rangetopair = false ,

type = figure ,
  Name-sg = 図 ,
  Name-pl = 図 ,

type = table ,
  Name-sg = 表 ,
  Name-pl = 表 ,

type = item ,
  Name-sg = 項目 ,
  Name-pl = 項目 ,

type = footnote ,
  Name-sg = 脚注 ,
  Name-pl = 脚注 ,

type = endnote ,
  Name-sg = 後注 ,
  Name-pl = 後注 ,

type = note ,
  Name-sg = 注記 ,
  Name-pl = 注記 ,

type = equation ,
  Name-sg = 式 ,
  Name-pl = 式 ,
  refbounds-first-sg = {,(,),} ,
  refbounds = {(,,,)} ,

type = theorem ,
  Name-sg = 定理 ,
  Name-pl = 定理 ,

type = lemma ,
  Name-sg = 補題 ,
  Name-pl = 補題 ,

type = corollary ,
  Name-sg = 系 ,
  Name-pl = 系 ,

type = proposition ,
  Name-sg = 命題 ,
  Name-pl = 命題 ,

type = definition ,
  Name-sg = 定義 ,
  Name-pl = 定義 ,

type = proof ,
  Name-sg = 証明 ,
  Name-pl = 証明 ,

type = result ,
  Name-sg = 結果 ,
  Name-pl = 結果 ,

type = remark ,
  Name-sg = 注意 ,
  Name-pl = 注意 ,

type = example ,
  Name-sg = 例 ,
  Name-pl = 例 ,

type = algorithm ,
  Name-sg = アルゴリズム ,
  Name-pl = アルゴリズム ,

type = listing ,
  Name-sg = コード ,
  Name-pl = コード ,

type = exercise ,
  Name-sg = 演習 ,
  Name-pl = 演習 ,

type = solution ,
  Name-sg = 解法 ,
  Name-pl = 解法 ,
%    \end{macrocode}
%
%    \begin{macrocode}
%</lang-japanese>
%    \end{macrocode}
zref-clever-code.tex

zref-clever-code.tex の 42~47 行目 を次のように変更して l3build を実行すると、日本語が上手く表示されるようになります。

\documentclass{l3doc}

\usepackage[english]{babel}
\usepackage{fontspec}
% \setmainfont{CMU Serif}
% \setsansfont{CMU Sans Serif}
% \setmonofont{CMU Typewriter Text}

\babelfont{rm}{CMU Serif}
\babelfont{sf}{CMU Sans Serif}
\babelfont{tt}{CMU Typewriter Text}

\babelprovide[onchar=ids fonts]{japanese}
\babelfont[japanese]{rm}[Scale=0.9]{Harano Aji Mincho}
\babelfont[japanese]{sf}[Scale=0.9]{Harano Aji Gothic}
\babelfont[japanese]{tt}[Scale=0.8]{Harano Aji Gothic}

TeXShopでのupmendexの使用について

- たか ま の投稿

お世話になっております。

現在エディタとしてTeXLive同梱のTeXShopを利用しているのですが,upmendexを用いた索引作成を行いたいと思っています。

デフォルトではMakeindexが起動しますが,これをupmendexに変更することはできるのでしょうか。

よろしくお願いいたします。