【LuaTeX】日本航空宇宙学会 年会講演会のLaTeXテンプレート
日本航空宇宙学会 年会講演会のLaTeXテンプレートが存在しなかったので作成した.
処理系はLuaTeXである.
1.環境
Microsoft Windows 10 Home (64bit)
W32TeX(2017/09/17インストール)
2.日本航空宇宙学会 年会講演会の論文フォーマット
論文フォーマットは以下の日本航空宇宙学会HPリンクから入手できる.
(念のためこのHPにもミラーしてある.)
▶ フォーマット (PDF) (49_mihon.pdf [178,856 byte])
▶ フォーマット (DOC) (49_mihon.doc [45,056 byte])
▶ フォーマット (PDF)(ミラー) (49_mihon.pdf [178,856 byte])
▶ フォーマット (DOC)(ミラー) (49_mihon.doc [45,056 byte])
フォーマットのスクリーンショットは以下.
配布されているフォーマットは.doc
で,フォントサイズは9.5ptとかいうよくわからないサイズ.
LaTeXのテンプレートも見当たらなかったので,自作することにした.
3.作成結果
作ったテンプレートのスクリーンショットは次のようになった.
フォーマットを完全には厳守してない点は以下.
・ | 章番号などの数字が全角ではなく半角 |
・ | “1-1”ではなく“1.1” |
・ | 題目部や章名の行間が厳密ではない |
4.コード
.tex
コードは以下.
002 | \documentclass [9pt,a4paper] {ltjsarticle} |
015 | {\fontsize{16pt}{24pt}\selectfont \textbf{1A23 ほげほげほげほげによるぴよぴよぴよぴよのための}} \\ [8pt] |
016 | {\fontsize{16pt}{24pt}\selectfont \textbf{ふがふがふがふがに関する研究}} \\ [14pt] |
018 | ○ \textbf {田中 太郎}(東京大学),\textbf{鈴木 一郎} (京都大学), \\ |
019 | \textbf {高橋 修},\textbf{松本 次郎},\textbf{佐々木 明},\textbf{内藤 康平} (東京大学) \\ [14pt] |
021 | Hogehoge Piyopiyo Fugafuga of Hogepiyofuga Study \\ |
023 | Taro Tanaka (The University of Tokyo), Ichiro Suzuki (Kyoto University), \\ |
024 | Osamu Takahashi, Jiro Matsumoto, Akira Sasaki, Kohe Naito (The University of Tokyo) \\ [14pt] |
026 | Key words : Aircraft, Safety and Reliability, Remote Sensing, \\ |
027 | Flight Dynamics, Artificial Satellites \\ [14pt] |
037 | \mySection {序論 \label{Sec:Intro}} |
045 | \captionsetup {type=figure} |
046 | \caption {``Hoge'' イメージ図} |
048 | \jalipsum [1-2] {wagahai} |
051 | \mySubsection {サブセクション} |
052 | \mySubsubsection {サブサブセクション} |
056 | \mySubsubsection {サブサブセクション} |
057 | \mySubsubsubsection {サブサブサブセクション} |
061 | \mySubsubsubsection {サブサブサブセクション} |
075 | \captionsetup {type=figure} |
079 | \begin {minipage}{0.49\hsize} |
086 | \begin {minipage}{0.49\hsize} |
093 | \captionsetup {type=figure} |
094 | \caption {小さな図(左)と小さな図(右)} |
097 | \begin {minipage}{0.49\hsize} |
104 | \begin {minipage}{0.49\hsize} |
111 | \captionsetup {type=figure} |
112 | \caption {小さな図(左)と小さな図(右)} |
119 | \renewcommand {\arraystretch}{0.8} |
120 | \captionsetup {type=table} |
123 | \begin {tabular}{lccc} |
125 | \multicolumn {1}{c}{\myJFontTable{}} & |
126 | \multicolumn {1}{c}{\myJFontTable{記号}} & |
127 | \multicolumn {1}{c}{\myJFontTable{単位}} & |
128 | \multicolumn {1}{c}{\myJFontTable{値}} \\ |
130 | \myJFontTable {ほげ直径} & |
131 | $D$ & $\si{m}$ & $1.234$ \\ |
134 | \myFontTable {Fuga値} & |
135 | $f$ & $\si{m}$ & $3.56$ \\ |
136 | \myFontTable {HOGE精度} & |
137 | $\delta_h$ & $\si{\micro m}$ & $1.00$ \\ |
138 | \myFontTable {Piyo精度} & |
139 | $\delta_f$ & $\si{\micro rad}$ & $2.00$ \\ |
142 | \renewcommand {\arraystretch}{1} |
147 | \citen {Schweighart2002} によると,ほげほげ. |
148 | また,ふがふがはぴよぴよである \cite {Hadaegh2016} . |
151 | \renewcommand {\refname}{} |
153 | \addcontentsline {toc}{chapter}{参考文献} |
157 | \bibliographystyle {junsrt} |
158 | \bibliography {bibdata} |
main.tex
001 | \usepackage [top=25truemm,bottom=25truemm,left=23truemm,right=23truemm] {geometry} |
006 | \usepackage [no-math] {fontspec} |
008 | \usepackage [yu-win,deluxe] {luatexja-preset} |
013 | \usepackage {luatexja-fontspec} |
017 | \newfontfamily \myFontYuGothM [ExternalLocation,Scale=0.91] {YuGothM001.ttf} |
018 | \newjfontfamily \myJFontYuGothM [ExternalLocation] {YuGothM001.ttf} |
019 | \newfontfamily \myFontYuGothB [ExternalLocation,Scale=0.91] {YuGothB001.ttf} |
020 | \newjfontfamily \myJFontYuGothB [ExternalLocation] {YuGothB001.ttf} |
024 | \usepackage {amsmath,amssymb} |
026 | \sisetup {input-ignore={,},input-decimal-markers={.},group-separator={,},group-minimum-digits=4,group-digits=integer} |
028 | \sisetup {math-micro=\text{µ},text-micro=µ} |
036 | \usepackage [normalem] {ulem} % for \sout{} 取り消し線 |
043 | \usepackage [luatex] {graphicx} |
049 | \usepackage [unicode=true,hidelinks,bookmarksnumbered=true,bookmarksdepth=subsubsection,bookmarksopen=true] {hyperref} |
058 | \titleformat * {\section}{\normalsize\bfseries} |
059 | \titleformat * {\subsection}{\normalsize\rmfamily} |
060 | \titleformat * {\subsubsection}{\normalsize\rmfamily} |
064 | \DeclareMathAlphabet {\mathpzc}{OT1}{pzc}{m}{it} |
068 | \usepackage [square] {natbib} |
077 | \usepackage [labelsep=quad] {caption} |
078 | \newenvironment {Figure} |
079 | {\par\medskip\noindent\minipage{\linewidth}} |
080 | {\endminipage\par\medskip} |
081 | \newenvironment {Table} |
082 | {\par\medskip\noindent\minipage{\linewidth}} |
083 | {\endminipage\par\medskip} |
100 | \renewcommand {\figurename}{Fig.\,} |
101 | \renewcommand {\tablename}{Table\,} |
104 | \renewcommand {\thefigure}{\thesection.\arabic{figure}} |
105 | \renewcommand {\thetable}{\thesection.\arabic{table}} |
106 | \renewcommand {\theequation}{\thesection.\arabic{equation}} |
109 | \@addtoreset {figure}{section} |
110 | \@addtoreset {table}{section} |
111 | \@addtoreset {equation}{section} |
119 | \setcitestyle {citesep={,}} |
120 | \DeclareRobustCommand * {\citen} [1] { |
123 | \setcitestyle {numbers} |
131 | \DeclareMathSymbol {\mhyph}{\mathalpha}{operators}{`-} |
135 | \newcommand {\refSec}[1] {\ref{#1}章} |
136 | \newcommand {\refApd}[1] {付録\ref{#1}} |
137 | \newcommand {\refSsec}[1] {\ref{#1}節} |
138 | \newcommand {\refSssec}[1] {\ref{#1}項} |
139 | \newcommand {\refFig}[1] {\figurename\ref{#1}} |
140 | \newcommand {\refTable}[1] {\tablename\ref{#1}} |
141 | \newcommand {\refEq}[1] {Eq.\,\ref{#1}} |
144 | \newcommand {\argmax}{\mathop{\rm arg~max}\limits} |
145 | \newcommand {\argmin}{\mathop{\rm arg~min}\limits} |
150 | \newcommand {\relmiddle}[1]{\mathrel{}\middle#1} |
153 | \newcommand * \rfrac [2] {{}^{#1}\!/_{#2}} |
155 | \newcommand {\mySection} [1] { |
159 | \newcommand {\mySubsection} [1] { |
163 | \newcommand {\mySubsubsection} [1] { |
166 | \newcommand {\mySubsubsubsection} [1] { |
173 | \newcommand {\myJFontTable}[1] {\myJFontYuGothM{#1}} |
174 | \newcommand {\myEFontTable}[1] {\myFontYuGothM{#1}} |
175 | \newcommand {\myFontTable}[1] {\myJFontYuGothM{\myFontYuGothM{#1}}} |
177 | \allowdisplaybreaks [4] |
180 | \usepackage {bxjalipsum} |
setting.tex
01 | @article{Schweighart2002, |
02 | author={Schweighart, Samuel A. and Sedwick, Raymond J.}, |
03 | title={{High-Fidelity Linearized $J_2$ Model for Satellite Formation Flight}}, |
04 | journal={Journal of Guidance, Control, and Dynamics}, |
08 | publisher={American Institute of Aeronautics and Astronautics}, |
17 | author = {Hadaegh, Fred Y. and Chung, Soon Jo and Manohara, Harish M.}, |
18 | doi = {10.1109/JSYST.2014.2327972}, |
20 | journal = {IEEE Systems Journal}, |
21 | keywords = {Autonomous agents,Control systems,Distributed control,Satellites,Space technology}, |
24 | title = {{On development of 100-gram-class spacecraft for swarm applications}}, |
bibdata.bib
5.Tips
基本的にはコードの周辺にURLが書いてあるのでそれを参照すればいいが,いくつかここでまとめておく.
太文字明朝と太文字ゴシックの両立
6 | \usepackage [no-math] {fontspec} |
8 | \usepackage [yu-win,deluxe] {luatexja-preset} |
とすることにより,いろいろましになる.
[yu-win]
によりデフォルトのフォントが游書体となり,
[deluxe]
により日本語の太文字が明朝体となる.
これで\textbf
は太字明朝体となる.
\textmg
でゴシック体が使えるようになるはずだったのだが,いまいちうまくいかなかったので,
13 | \usepackage {luatexja-fontspec} |
17 | \newfontfamily \myFontYuGothM [ExternalLocation,Scale=0.91] {YuGothM001.ttf} |
18 | \newjfontfamily \myJFontYuGothM [ExternalLocation] {YuGothM001.ttf} |
19 | \newfontfamily \myFontYuGothB [ExternalLocation,Scale=0.91] {YuGothB001.ttf} |
20 | \newjfontfamily \myJFontYuGothB [ExternalLocation] {YuGothB001.ttf} |
で游ゴシック体を別途使えるようにしている.(日本語と英語で別途作っているあたりセンスがないが....)
一般的には,\newfontfamily\fontConsolas{フォント名}
とするのだが,フォント名にスペースがあったり和名フォントはうまくいかなかったので,フォントファイルを直接パスが通っているディレクトリ(ここではmain.tex
直下)において指定している.
なお,YuGothM001.ttf
はYuGothM.ttc
をばらして生成したものである.
.ttc
,.ttf
ファイルについてはまだ別の記事で書こうかね....
Scale=0.91
では,日本語フォント (\newjfontfamily
) と英語フォント (\newfontfamily
) のサイズの調整をしている.
Scale=MatchLowercase
でうまくいくと思っていたが,微妙にいい感じにならなかったので手動設定している.
ここで発生した問題として,\usepackage[no-math]{fontspec}
を読み込むとsiunitx
パッケージの\micro
が消失するというものがあった.
28 | \sisetup {math-micro=\text{µ},text-micro=µ} |
を指定することによって解決した.
なお,μはUnicode上に2つありU+03BC
は通常のギリシャ文字領域に存在するミューであり,U+00B5
はLatin-1領域のものである.
前者はイタリック体となるが,後者を指定すると単位系文字としてふさわしいローマン体となる.
フォントサイズの制御
15 | {\fontsize{16pt}{24pt}\selectfont \textbf{1A23 ほげほげほげほげによるぴよぴよぴよぴよのための}} \\ [8pt] |
では,\fontsize{フォントサイズ}{行送り}\selectfont
で設定している.
しかし,行送りが正しく機能しなかったため,\\[8pt]
というひどい実装になっている.
Abstract
普通Abstractにはabstract
環境を用いるが,それだと幅が若干狭くなる.
ここではAbstractは一段組でかつ100%幅にしたかったため,abstract
環境は使用していない.
二段組における図表の位置コントロール
二段組では[H]
による強制位置合わせができない.
そこで以下のようにFigure
,Table
を定義する.
77 | \usepackage [labelsep=quad] {caption} |
78 | \newenvironment {Figure} |
79 | {\par\medskip\noindent\minipage{\linewidth}} |
80 | {\endminipage\par\medskip} |
82 | {\par\medskip\noindent\minipage{\linewidth}} |
83 | {\endminipage\par\medskip} |
キャプションがおかしくなるので,caption
パッケージをインクルードして
45 | \captionsetup {type=figure} |
46 | \caption {``Hoge'' イメージ図} |
のように\captionsetup{type=figure}
などと追記する.
出典記号を文中と右肩を両方使い分ける
68 | \usepackage [square] {natbib} |
119 | \setcitestyle {citesep={,}} |
120 | \DeclareRobustCommand * {\citen} [1] { |
123 | \setcitestyle {numbers} |
とすることにより,文中の引用は\cite
を,右肩の引用は\citen
で使い分けができるようになる.
6.諦めたこと
全体のフォントサイズの小数での制御
全体のフォントサイズを9.5ptとしたくて
1 | \documentclass [9.5pt,a4paper] {ltjsarticle} |
としたが,小数での設定はできなかった.(コンパイルは通る.)
7.出典
関連記事