MENU

溶けかけてるうさぎ HP GALLERY BLOG TOP RECENT ARTICLES POPULAR ARTICLES ABOUT THIS BLOG

CATEGORY

大学 (140) 仕事 (17) 航空宇宙 (104) 写真 (77) 旅行 (32) 飯・酒 (17) コンピュータ (118) その他 (44)

TAG

ARCHIVE

RECENT

【カメラ】X100 シリーズが好きすぎる(主にリーフシャッタ) 【カメラ】X100V から X100VI に買い替えました 【自宅サーバー】Google Domains から Cloudflare にドメインを移管 【カメラ】FUJIFILM XF レンズのサイズ比較ができるようにしてみた 【写真】自作写真閲覧ページにてフィルムシミュレーションで写真をフィルタできるようにした

【LuaTeX】日本航空宇宙学会 年会講演会のLaTeXテンプレート

事象発生日:2018-02-25

記事公開日:2018-02-25

アクセス数:7310

日本航空宇宙学会 年会講演会の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コードは以下.

% \documentclass[9pt,a4paper]{jsarticle}                % for upLaTeX
\documentclass[9pt,a4paper]{ltjsarticle}                % for LuaTeX
% \documentclass[9.5pt,a4paper]{ltjsarticle}            % for 小数指定はできなかった

% ###############################
% 航空宇宙学会年会 原稿
% ###############################

\pagestyle{empty}       % ページ番号を消す

\input{setting}
\begin{document}

\begin{center}
    {\fontsize{16pt}{24pt}\selectfont \textbf{1A23 ほげほげほげほげによるぴよぴよぴよぴよのための}} \\[8pt]
    {\fontsize{16pt}{24pt}\selectfont \textbf{ふがふがふがふがに関する研究}} \\[14pt]

    ○\textbf{田中 太郎}(東京大学),\textbf{鈴木 一郎}(京都大学), \\
    \textbf{高橋 修},\textbf{松本 次郎},\textbf{佐々木 明},\textbf{内藤 康平}(東京大学) \\[14pt]

    Hogehoge Piyopiyo Fugafuga of Hogepiyofuga Study \\

    Taro Tanaka (The University of Tokyo), Ichiro Suzuki (Kyoto University), \\
    Osamu Takahashi, Jiro Matsumoto, Akira Sasaki, Kohe Naito (The University of Tokyo) \\[14pt]

    Key words :  Aircraft, Safety and Reliability, Remote Sensing, \\
    Flight Dynamics, Artificial Satellites \\[14pt]

    \textbf{Abstract}
\end{center}
\vspace{-2mm}

\lipsum[1-2]

\begin{multicols}{2}

\mySection{序論 \label{Sec:Intro}}
\mySubsection{研究背景}
\begin{Figure}
    \centering
    \iffigure
    \rule{50mm}{30mm}
    % \includegraphics[width=50mm]{./img/hoge.pdf}
    \fi
    \captionsetup{type=figure}
    \caption{``Hoge'' イメージ図}
\end{Figure}
\jalipsum[1-2]{wagahai}


\mySubsection{サブセクション}
\mySubsubsection{サブサブセクション}
\jalipsum[3]{wagahai}


\mySubsubsection{サブサブセクション}
\mySubsubsubsection{サブサブサブセクション}
ああああ.


\mySubsubsubsection{サブサブサブセクション}
いいいい.
% \vfill\null
% \columnbreak


\mySection{図表}
\mySubsection{図}
\begin{Figure}
    \centering
    \iffigure
    \rule{50mm}{30mm}
    % \includegraphics[width=50mm]{./img/hoge.pdf}
    \fi
    \captionsetup{type=figure}
    \caption{大きな図}
\end{Figure}
\begin{Figure}
    \begin{minipage}{0.49\hsize}
        \centering
        \iffigure
        \rule{35mm}{30mm}
        % \includegraphics[width=30mm]{./img/hoge.pdf}
        \fi
    \end{minipage}
    \begin{minipage}{0.49\hsize}
        \centering
        \iffigure
        \rule{35mm}{30mm}
        % \includegraphics[width=30mm]{./img/hoge.pdf}
        \fi
    \end{minipage}
    \captionsetup{type=figure}
    \caption{小さな図(左)と小さな図(右)}
\end{Figure}
\begin{Figure}
    \begin{minipage}{0.49\hsize}
        \centering
        \iffigure
        \rule{35mm}{30mm}
        % \includegraphics[width=30mm]{./img/hoge.pdf}
        \fi
    \end{minipage}
    \begin{minipage}{0.49\hsize}
        \centering
        \iffigure
        \rule{35mm}{30mm}
        % \includegraphics[width=30mm]{./img/hoge.pdf}
        \fi
    \end{minipage}
    \captionsetup{type=figure}
    \caption{小さな図(左)と小さな図(右)}
\end{Figure}


\mySubsection{表}
\begin{Table}
    \centering
    \renewcommand{\arraystretch}{0.8}
    \captionsetup{type=table}
    \caption{表テンプレート}
    \small
    \begin{tabular}{lccc}
    \toprule
    \multicolumn{1}{c}{\myJFontTable{}}       &
    \multicolumn{1}{c}{\myJFontTable{記号}}   &
    \multicolumn{1}{c}{\myJFontTable{単位}}   &
    \multicolumn{1}{c}{\myJFontTable{値}} \\
    \midrule
    \myJFontTable{ほげ直径} &
        $D$         & $\si{m}$           & $1.234$ \\
    \myJFontTable{ピヨ数} &
        $Q$         &                    & $6$ \\
    \myFontTable{Fuga値} &
        $f$         & $\si{m}$           & $3.56$ \\
    \myFontTable{HOGE精度} &
        $\delta_h$  & $\si{\micro m}$    & $1.00$ \\
    \myFontTable{Piyo精度} &
        $\delta_f$  & $\si{\micro rad}$  & $2.00$ \\
    \bottomrule
    \end{tabular}
    \renewcommand{\arraystretch}{1}
\end{Table}


\mySection{出典}
\citen{Schweighart2002}によると,ほげほげ.
また,ふがふがはぴよぴよである\cite{Hadaegh2016}.


\renewcommand{\refname}{}
\phantomsection
\addcontentsline{toc}{chapter}{参考文献}
\section*{参考文献}
% レイアウト調整
\vspace{-20pt}
\bibliographystyle{junsrt}
\bibliography{bibdata}

\end{multicols}
\end{document}
main.tex
\usepackage[top=25truemm,bottom=25truemm,left=23truemm,right=23truemm]{geometry}

% フォント設定
% https://ja.osdn.net/projects/luatex-ja/wiki/LuaTeX-ja%E3%81%AE%E4%BD%BF%E3%81%84%E6%96%B9
% http://0-chromosome.hatenablog.jp/entry/2015/08/10/214938
\usepackage[no-math]{fontspec}
% ↑これつけるとsiunitxのmicroが消えた... ↓下で解決
\usepackage[yu-win,deluxe]{luatexja-preset}

% https://ja.osdn.net/projects/luatex-ja/wiki/LuaTeX-ja%E3%81%AE%E4%BD%BF%E3%81%84%E6%96%B9
% https://tex.stackexchange.com/questions/25249/how-do-i-use-a-particular-font-for-a-small-section-of-text-in-my-document
% http://arxiv.hatenablog.com/entry/2016/11/30/183000
\usepackage{luatexja-fontspec}
% \newfontfamily\fontConsolas{Consolas}
% \newfontfamily\myFontYuGothM[ExternalLocation,Scale=0.91]{YuGothM.ttc}  % これでもできた
% \newjfontfamily\myJFontYuGothM[ExternalLocation]{YuGothM.ttc}           % これでもできた
\newfontfamily\myFontYuGothM[ExternalLocation,Scale=0.91]{YuGothM001.ttf}
\newjfontfamily\myJFontYuGothM[ExternalLocation]{YuGothM001.ttf}
\newfontfamily\myFontYuGothB[ExternalLocation,Scale=0.91]{YuGothB001.ttf}
\newjfontfamily\myJFontYuGothB[ExternalLocation]{YuGothB001.ttf}
% \newfontfamily\myFontYuGothM[ExternalLocation,Scale=MatchLowercase]{YuGothM.ttc}   % サイズが上手く合わない
% \newjfontfamily\myJFontYuGothM[ExternalLocation,Scale=MatchLowercase]{YuGothM.ttc} % サイズが上手く合わない

\usepackage{amsmath,amssymb}
\usepackage{siunitx}                            % SI単位
\sisetup{input-ignore={,},input-decimal-markers={.},group-separator={,},group-minimum-digits=4,group-digits=integer}
% \sisetup{mathsmu = \text{μ},textmu  = μ}    % μとµは違う
\sisetup{math-micro=\text{µ},text-micro=µ}
% μ
% U+03BC
% µ
% U+00B5
% for % ↑これつけるとsiunitxのmicroが消えた... ってのの解決
\usepackage{bm}                                 % for vector    % font系パッケージの後に宣言
\usepackage{setspace}                           % for spacing環境
\usepackage[normalem]{ulem}                     % for \sout{} 取り消し線
% ulemの下線注意
% http://kawaiihaseigi.blogspot.jp/2013/01/ulemstyemph.html
\usepackage{url}
% http://osksn2.hep.sci.osaka-u.ac.jp/~naga/miscellaneous/tex/tex-tips3.html
\usepackage{booktabs}                           % for \toprule \midrule \bottomrule
% \usepackage[dvipdfmx]{graphicx}               % for upLaTeX
\usepackage[luatex]{graphicx}                   % for LuaTeX
\usepackage{multirow}                           % 表で行結合
% https://texwiki.texjp.org/?hyperref
% http://www.biwako.shiga-u.ac.jp/sensei/kumazawa/tex/hyperref.html
% http://0-chromosome.hatenablog.jp/entry/2015/04/10/175912
% LuaTeX. upLaTeXではオプションが違う.
\usepackage[unicode=true,hidelinks,bookmarksnumbered=true,bookmarksdepth=subsubsection,bookmarksopen=true]{hyperref}
\usepackage{comment}
% 画像強制位置合わせ
% http://ac206223.ppp.asahi-net.or.jp/adiary/memo/adiary.cgi/hirosugu/TeX%E3%81%A7%E5%9B%B3%E3%82%92%E3%82%B3%E3%83%BC%E3%83%89%E8%A8%98%E8%BF%B0%E4%BD%8D%E7%BD%AE%E3%81%AB%E5%BC%B7%E5%88%B6%E7%9A%84%E3%81%AB%E5%87%BA%E5%8A%9B%E3%81%99%E3%82%8B
\usepackage{here}

% sectionのフォントサイズ変更
% https://qiita.com/roaming_south/items/ea39b9554167fcaba882
\usepackage{titlesec}
\titleformat*{\section}{\normalsize\bfseries}
\titleformat*{\subsection}{\normalsize\rmfamily}
\titleformat*{\subsubsection}{\normalsize\rmfamily}

% http://www.biwako.shiga-u.ac.jp/sensei/kumazawa/tex/mathbfbb.html
% mathpzc
\DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it}

% 引用[]を右上に 方法3
% https://tex.stackexchange.com/questions/94178/temporarily-disable-superscript-in-citation
\usepackage[square]{natbib}

% 2段組み
% http://nezumitori.hatenablog.jp/entry/20160509/1462762800
\usepackage{multicol}

% 2段組み図 方法2
% https://tex.stackexchange.com/questions/12262/multicol-and-figures
% \usepackage[labelsep=none]{caption}
\usepackage[labelsep=quad]{caption}
\newenvironment{Figure}
  {\par\medskip\noindent\minipage{\linewidth}}
  {\endminipage\par\medskip}
\newenvironment{Table}
  {\par\medskip\noindent\minipage{\linewidth}}
  {\endminipage\par\medskip}
% キャプションのエラー
% Package caption Warning: The option `hypcap=true' will be ignored for this(caption)
% については
% https://tex.stackexchange.com/questions/32344/issue-with-capt-of-package

% コンパイル時に図をとばす
% http://blog.livedoor.jp/tmako123-programming/archives/42210596.html
\newif\iffigure
\figurefalse
\figuretrue


% http://d.hatena.ne.jp/gp98/20090919/1253367749
\makeatletter % プリアンブルで定義開始

% 表示文字列を"図"から"Figure"へ
\renewcommand{\figurename}{Fig.\,}
\renewcommand{\tablename}{Table\,}

% 図番号を"<節番号>.<図番号>" へ
\renewcommand{\thefigure}{\thesection.\arabic{figure}}
\renewcommand{\thetable}{\thesection.\arabic{table}}
\renewcommand{\theequation}{\thesection.\arabic{equation}}

% 節が進むごとに図番号をリセットする
\@addtoreset{figure}{section}
\@addtoreset{table}{section}
\@addtoreset{equation}{section}

\makeatother % プリアンブルで定義終了


% 引用[]を右上に 方法3
% https://tex.stackexchange.com/questions/94178/temporarily-disable-superscript-in-citation
\setcitestyle{super}
\setcitestyle{citesep={,}}
\DeclareRobustCommand*{\citen}[1]{%
    \begingroup
        \romannumeral-`\x % remove space at the beginning of \setcitestyle
        \setcitestyle{numbers}%
        \cite{#1}%
    \endgroup
}

% 数式記号命令 \mhyph の定義
% ハイフン
% http://d.hatena.ne.jp/zrbabbler/20160609/1465426138
\DeclareMathSymbol{\mhyph}{\mathalpha}{operators}{`-}


% マクロ
\newcommand{\refSec}[1]   {\ref{#1}章}
\newcommand{\refApd}[1]   {付録\ref{#1}}
\newcommand{\refSsec}[1]  {\ref{#1}節}
\newcommand{\refSssec}[1] {\ref{#1}項}
\newcommand{\refFig}[1]   {\figurename\ref{#1}}
\newcommand{\refTable}[1] {\tablename\ref{#1}}
\newcommand{\refEq}[1]    {Eq.\,\ref{#1}}

% http://www.latex-cmd.com/equation/max_min.html
\newcommand{\argmax}{\mathop{\rm arg~max}\limits}
\newcommand{\argmin}{\mathop{\rm arg~min}\limits}

% \midの拡張
% http://d.hatena.ne.jp/zrbabbler/20120411/1334151482
% \newcommand{\relmiddle}[1]{\mathrel{}\middle#1\mathrel{}}
\newcommand{\relmiddle}[1]{\mathrel{}\middle#1}

% https://en.wikibooks.org/wiki/LaTeX/Mathematics#Fractions_and_Binomials
\newcommand*\rfrac[2]{{}^{#1}\!/_{#2}}

\newcommand{\mySection}[1] {%
    \section{#1}%
    \vspace{-6pt}
}
\newcommand{\mySubsection}[1] {%
    \subsection{#1}%
    \vspace{-6pt}
}
\newcommand{\mySubsubsection}[1] {%
    \subsubsection{#1}%
}
\newcommand{\mySubsubsubsection}[1] {
    \vspace{5pt}
    \noindent
    ・#1 \par
}

% 表見出しフォント
\newcommand{\myJFontTable}[1] {\myJFontYuGothM{#1}}
\newcommand{\myEFontTable}[1] {\myFontYuGothM{#1}}
\newcommand{\myFontTable}[1] {\myJFontYuGothM{\myFontYuGothM{#1}}}

\allowdisplaybreaks[4]

\usepackage{lipsum}
\usepackage {bxjalipsum}
setting.tex
@article{Schweighart2002,
author={Schweighart, Samuel A. and Sedwick, Raymond J.},
title={{High-Fidelity Linearized $J_2$ Model for Satellite Formation Flight}},
journal={Journal of Guidance, Control, and Dynamics},
year={2002},
month={Nov},
day={01},
publisher={American Institute of Aeronautics and Astronautics},
volume={25},
number={6},
pages={1073-1080},
issn={0731-5090},
doi={10.2514/2.4986},
url={https://doi.org/10.2514/2.4986}
}
@article{Hadaegh2016,
author = {Hadaegh, Fred Y. and Chung, Soon Jo and Manohara, Harish M.},
doi = {10.1109/JSYST.2014.2327972},
issn = {19379234},
journal = {IEEE Systems Journal},
keywords = {Autonomous agents,Control systems,Distributed control,Satellites,Space technology},
number = {2},
pages = {673--684},
title = {{On development of 100-gram-class spacecraft for swarm applications}},
volume = {10},
year = {2016}
}
bibdata.bib

5.Tips

基本的にはコードの周辺にURLが書いてあるのでそれを参照すればいいが,いくつかここでまとめておく.

太文字明朝と太文字ゴシックの両立

\usepackage[no-math]{fontspec}
% ↑これつけるとsiunitxのmicroが消えた... ↓下で解決
\usepackage[yu-win,deluxe]{luatexja-preset}

とすることにより,いろいろましになる.

[yu-win]によりデフォルトのフォントが游書体となり,

[deluxe]により日本語の太文字が明朝体となる.

 

これで\textbfは太字明朝体となる.

\textmgでゴシック体が使えるようになるはずだったのだが,いまいちうまくいかなかったので,

% https://ja.osdn.net/projects/luatex-ja/wiki/LuaTeX-ja%E3%81%AE%E4%BD%BF%E3%81%84%E6%96%B9
% https://tex.stackexchange.com/questions/25249/how-do-i-use-a-particular-font-for-a-small-section-of-text-in-my-document
% http://arxiv.hatenablog.com/entry/2016/11/30/183000
\usepackage{luatexja-fontspec}
% \newfontfamily\fontConsolas{Consolas}
% \newfontfamily\myFontYuGothM[ExternalLocation,Scale=0.91]{YuGothM.ttc}  % これでもできた
% \newjfontfamily\myJFontYuGothM[ExternalLocation]{YuGothM.ttc}           % これでもできた
\newfontfamily\myFontYuGothM[ExternalLocation,Scale=0.91]{YuGothM001.ttf}
\newjfontfamily\myJFontYuGothM[ExternalLocation]{YuGothM001.ttf}
\newfontfamily\myFontYuGothB[ExternalLocation,Scale=0.91]{YuGothB001.ttf}
\newjfontfamily\myJFontYuGothB[ExternalLocation]{YuGothB001.ttf}
% \newfontfamily\myFontYuGothM[ExternalLocation,Scale=MatchLowercase]{YuGothM.ttc}   % サイズが上手く合わない
% \newjfontfamily\myJFontYuGothM[ExternalLocation,Scale=MatchLowercase]{YuGothM.ttc} % サイズが上手く合わない

で游ゴシック体を別途使えるようにしている.(日本語と英語で別途作っているあたりセンスがないが....)

 

一般的には,\newfontfamily\fontConsolas{フォント名}とするのだが,フォント名にスペースがあったり和名フォントはうまくいかなかったので,フォントファイルを直接パスが通っているディレクトリ(ここではmain.tex直下)において指定している.

なお,YuGothM001.ttfYuGothM.ttcをばらして生成したものである.

.ttc.ttfファイルについてはまだ別の記事で書こうかね....

 

Scale=0.91では,日本語フォント (\newjfontfamily) と英語フォント (\newfontfamily) のサイズの調整をしている.

Scale=MatchLowercaseでうまくいくと思っていたが,微妙にいい感じにならなかったので手動設定している.

 

 

ここで発生した問題として,\usepackage[no-math]{fontspec}を読み込むとsiunitxパッケージの\microが消失するというものがあった.

% \sisetup{mathsmu = \text{μ},textmu  = μ}    % μとµは違う
\sisetup{math-micro=\text{µ},text-micro=µ}
% μ
% U+03BC
% µ
% U+00B5
% for % ↑これつけるとsiunitxのmicroが消えた... ってのの解決

を指定することによって解決した.

なお,μはUnicode上に2つありU+03BCは通常のギリシャ文字領域に存在するミューであり,U+00B5はLatin-1領域のものである.

前者はイタリック体となるが,後者を指定すると単位系文字としてふさわしいローマン体となる.

フォントサイズの制御

    {\fontsize{16pt}{24pt}\selectfont \textbf{1A23 ほげほげほげほげによるぴよぴよぴよぴよのための}} \\[8pt]

では,\fontsize{フォントサイズ}{行送り}\selectfontで設定している.

しかし,行送りが正しく機能しなかったため,\\[8pt]というひどい実装になっている.

Abstract

普通Abstractにはabstract環境を用いるが,それだと幅が若干狭くなる.

ここではAbstractは一段組でかつ100%幅にしたかったため,abstract環境は使用していない.

二段組における図表の位置コントロール

二段組では[H]による強制位置合わせができない.

そこで以下のようにFigureTableを定義する.

% 2段組み図 方法2
% https://tex.stackexchange.com/questions/12262/multicol-and-figures
% \usepackage[labelsep=none]{caption}
\usepackage[labelsep=quad]{caption}
\newenvironment{Figure}
  {\par\medskip\noindent\minipage{\linewidth}}
  {\endminipage\par\medskip}
\newenvironment{Table}
  {\par\medskip\noindent\minipage{\linewidth}}
  {\endminipage\par\medskip}
% キャプションのエラー
% Package caption Warning: The option `hypcap=true' will be ignored for this(caption)
% については
% https://tex.stackexchange.com/questions/32344/issue-with-capt-of-package

キャプションがおかしくなるので,captionパッケージをインクルードして

\begin{Figure}
    \centering
    \iffigure
    \rule{50mm}{30mm}
    % \includegraphics[width=50mm]{./img/hoge.pdf}
    \fi
    \captionsetup{type=figure}
    \caption{``Hoge'' イメージ図}
\end{Figure}

のように\captionsetup{type=figure}などと追記する.

出典記号を文中と右肩を両方使い分ける

% 引用[]を右上に 方法3
% https://tex.stackexchange.com/questions/94178/temporarily-disable-superscript-in-citation
\usepackage[square]{natbib}
% 引用[]を右上に 方法3
% https://tex.stackexchange.com/questions/94178/temporarily-disable-superscript-in-citation
\setcitestyle{super}
\setcitestyle{citesep={,}}
\DeclareRobustCommand*{\citen}[1]{%
    \begingroup
        \romannumeral-`\x % remove space at the beginning of \setcitestyle
        \setcitestyle{numbers}%
        \cite{#1}%
    \endgroup
}

とすることにより,文中の引用は\citeを,右肩の引用は\citenで使い分けができるようになる.

6.諦めたこと

全体のフォントサイズの小数での制御

全体のフォントサイズを9.5ptとしたくて

\documentclass[9.5pt,a4paper]{ltjsarticle}

としたが,小数での設定はできなかった.(コンパイルは通る.)

7.出典

(一社)日本航空宇宙学会 第49期 定時社員総会および年会講演会. 原稿投稿. Retrieved February 25, 2018, from http://branch.jsass.or.jp/nenkai/%E5%8E%9F%E7%A8%BF%E6%8A%95%E7%A8%BF/

関連記事

コメントを投稿

名前

Email (※公開されることはありません)

コメント