diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d49a554 --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +# ビルド生成物 +build/ + +# latexmk を使わずにビルドした場合の中間ファイル +*.aux +*.bbl +*.bcf +*.blg +*.fdb_latexmk +*.fls +*.lof +*.log +*.lot +*.out +*.run.xml +*.synctex.gz +*.toc + +# 参考資料(他者の論文・個人情報を含むため管理しない) +Reference/ + +# Word の一時ファイル +~$* + +# OS +.DS_Store +Thumbs.db +Zone.Identifier +*:Zone.Identifier diff --git a/.latexmkrc b/.latexmkrc new file mode 100644 index 0000000..671211d --- /dev/null +++ b/.latexmkrc @@ -0,0 +1,7 @@ +# LuaLaTeX + biber でビルドし,生成物は build/ に出力する +$pdf_mode = 4; # lualatex +$lualatex = 'lualatex -synctex=1 -interaction=nonstopmode -file-line-error %O %S'; +$bibtex_use = 2; # biber +$out_dir = 'build'; +$max_repeat = 10; # 空の状態からだと目次・参照・文献の確定に6回程度かかる +@default_files = ('main.tex'); diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..60685ae --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,22 @@ +{ + // LaTeX Workshop: .latexmkrc の設定(LuaLaTeX + biber)でビルドする + // 既定のレシピは -pdf(pdfLaTeX)を付けてしまうため上書きする + "latex-workshop.latex.tools": [ + { + "name": "latexmk", + "command": "latexmk", + "args": ["%DOC%"], + "env": {} + } + ], + "latex-workshop.latex.recipes": [ + { + "name": "latexmk (LuaLaTeX)", + "tools": ["latexmk"] + } + ], + "latex-workshop.latex.rootFile.useSubFile": false, + "latex-workshop.latex.outDir": "%DIR%/build", + "latex-workshop.latex.autoClean.run": "never", + "latex-workshop.view.pdf.viewer": "tab" +} diff --git a/README.md b/README.md index b385b13..54af14c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,34 @@ MasterThesis =============== + +修士論文(LuaLaTeX + jlreq,参考文献は biblatex + biber) + +## ビルド + +```sh +latexmk # build/main.pdf を生成 +latexmk -c # 中間ファイルを削除 +``` + +VS Code の LaTeX Workshop では,どの `.tex` を保存しても `main.tex` がビルドされる。 + +## フォルダ構成 + +| パス | 内容 | +|---|---| +| `main.tex` | 骨組み。章を `\include` で並べる | +| `style/` | パッケージ (`preamble.tex`) と自作コマンド (`macros.tex`) | +| `chapters/` | 1章 = 1ファイル | +| `backmatter/` | 謝辞 | +| `figures/<章名>/` | 図(グラフは PDF 推奨) | +| `bib/references.bib` | 参考文献 | +| `cover/` | 表紙・背表紙の PDF(配布後に配置) | +| `notes/` | 章構成の検討メモ | + +## 書き方のルール + +- 章を追加するときは `chapters/<内容>.tex` を作り,`main.tex` に `\include` を足す +- ラベルは `種類:章:内容`(例: `\label{fig:method:overview}`)で付け,`\figref{method:overview}` で参照する +- 作業中の章だけビルドするときは `main.tex` の `\includeonly` を使う +- 修正箇所は `\revised{}`,書きかけは `\todo{}`。提出時は `style/macros.tex` の `\showrevisiontrue` を `\showrevisionfalse` にする +- 見本は `chapters/example.tex`(本文を書き始めたら削除) diff --git a/backmatter/acknowledgments.tex b/backmatter/acknowledgments.tex new file mode 100644 index 0000000..8c5746e --- /dev/null +++ b/backmatter/acknowledgments.tex @@ -0,0 +1,3 @@ +% !TEX root = ../main.tex +\chapter{謝辞} +\todo{謝辞} diff --git a/bib/references.bib b/bib/references.bib new file mode 100644 index 0000000..1787737 --- /dev/null +++ b/bib/references.bib @@ -0,0 +1,12 @@ +% 参考文献データベース +% キーは「第一著者の姓 + 年」を基本にする(例: kawaguchi2019) +% Zotero 等からエクスポートしたものを貼り付けてもよい + +@article{kawaguchi2019, + author = {Kawaguchi, Rui and Nakada, Taka-aki and Oshima, Taku and Shinozaki, Masayoshi and Nakaguchi, Toshiya and Haneishi, Hideaki and Oda, Shigeto}, + title = {Optimal pressing strength and time for capillary refilling time}, + journal = {Critical Care}, + volume = {23}, + pages = {4}, + year = {2019}, +} diff --git a/chapters/conclusion.tex b/chapters/conclusion.tex new file mode 100644 index 0000000..ebd74ad --- /dev/null +++ b/chapters/conclusion.tex @@ -0,0 +1,4 @@ +% !TEX root = ../main.tex +\chapter{総論} +\label{chap:conclusion} +\todo{本研究のまとめと今後の課題} diff --git a/chapters/example.tex b/chapters/example.tex new file mode 100644 index 0000000..4f42abf --- /dev/null +++ b/chapters/example.tex @@ -0,0 +1,66 @@ +% !TEX root = ../main.tex +% 書き方の見本.本文を書き始めたら main.tex の \include と一緒に削除する +\chapter{書き方の見本} +\label{chap:example} + +\section{図} +\label{sec:example:figure} +図は figures/<章名>/ に置き,拡張子を省略して読み込む. +グラフは PDF で書き出すと拡大しても劣化しない. +\figref{example:single}に単一の図,\figref{example:sub}に小図を並べた例を示す. + +\begin{figure}[H] + \centering + % 実際には \includegraphics[width=0.6\linewidth]{example/overview} のように書く + \includegraphics[width=0.5\linewidth]{example-image} + \caption{単一の図の例} + \label{fig:example:single} +\end{figure} + +\begin{figure}[H] + \centering + \begin{subfigure}[b]{0.45\linewidth} + \centering + \includegraphics[width=\linewidth]{example-image-a} + \caption{条件A} + \label{fig:example:sub-a} + \end{subfigure} + \hfill + \begin{subfigure}[b]{0.45\linewidth} + \centering + \includegraphics[width=\linewidth]{example-image-b} + \caption{条件B} + \label{fig:example:sub-b} + \end{subfigure} + \caption{小図を並べた例} + \label{fig:example:sub} +\end{figure} + +\section{表} +\label{sec:example:table} +表は booktabs を使い,縦罫線は引かない.\tabref{example:result}に例を示す. + +\begin{table}[H] + \centering + \caption{表の例} + \label{tab:example:result} + \begin{tabular}{lSS} + \toprule + 被験者 & {閾値} & {AUC} \\ + \midrule + 被験者1 & 1.23 & 0.658 \\ + 被験者2 & 0.0699 & 0.686 \\ + \bottomrule + \end{tabular} +\end{table} + +\section{数式・単位・引用} +\label{sec:example:math} +数式は align などを使う(eqnarray は使わない).\equref{example:exp}に例を示す. +\begin{align} + \hat{G}(t) = y_0 + A \left(1 - e^{-t/\tau}\right) + \label{eq:example:exp} +\end{align} +単位は siunitx で \SI{3}{N},\SI{30}{fps} のように書く. +文献は bib/references.bib に登録し,キーで引用する\cite{kawaguchi2019}. +修正した箇所は\revised{このように強調}でき,提出時に一括で解除できる. diff --git a/chapters/introduction.tex b/chapters/introduction.tex new file mode 100644 index 0000000..a823bb1 --- /dev/null +++ b/chapters/introduction.tex @@ -0,0 +1,23 @@ +% !TEX root = ../main.tex +\chapter{序論} +\label{chap:intro} + +\section{研究背景} +\label{sec:intro:background} +\todo{研究背景} + +\section{先行研究} +\label{sec:intro:related} +\todo{先行研究} + +\section{研究目的} +\label{sec:intro:purpose} +\todo{研究目的} + +\section{本論文の構成} +\label{sec:intro:structure} +本論文の構成を以下に示す. + +\chapref{intro}では研究背景,先行研究と目的について述べた. + +\chapref{conclusion}では本論文の結論について述べる. diff --git a/cover/.gitkeep b/cover/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/cover/.gitkeep diff --git a/figures/conclusion/.gitkeep b/figures/conclusion/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/figures/conclusion/.gitkeep diff --git a/figures/example/.gitkeep b/figures/example/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/figures/example/.gitkeep diff --git a/figures/introduction/.gitkeep b/figures/introduction/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/figures/introduction/.gitkeep diff --git a/main.tex b/main.tex new file mode 100644 index 0000000..985351a --- /dev/null +++ b/main.tex @@ -0,0 +1,55 @@ +% 修士論文 メインファイル +% ビルド: latexmk(設定は .latexmkrc,LuaLaTeX + biber,出力は build/) +% 本文はここに書かず,章ごとのファイルを \include で読み込む + +% 見出しのゴシック体を先輩と同じ太さ(Regular)にする. +% jlreq がクラス内で luatexja を読み込むため,\documentclass より前に指定する +\makeatletter +\def\ltj@stdgtfont{file:HaranoAjiGothic-Regular.otf} +\makeatother + +\documentclass[ + book, + paper=a4paper, + fontsize=11pt, + % 先輩(pLaTeX + jreport 11pt)に合わせる: 和文は欧文の0.962倍,行送り15.5pt + jafontscale=0.962, + baselineskip=15.5pt, + oneside, % 片面印刷(両面にするなら twoside, openright) + openany, + % 余白は先輩の設定に合わせた(上25.4 / 下35.4 / 左右19.05 mm).指定が配布されたら変更する + head_space=25.4mm, + foot_space=35.4mm, + gutter=19.05mm, + fore-edge=19.05mm, +]{jlreq} + +\input{style/preamble} +\input{style/macros} + +% 作業中の章だけビルドしたいときに有効化(ページ番号・相互参照は保持される) +% \includeonly{chapters/introduction} + +\begin{document} + +% 表紙(配布されたら cover/ に置いて有効化) +% \includepdf[pages=-]{cover/frontCover.pdf} + +\frontmatter +\tableofcontents +% \listoffigures +% \listoftables + +\mainmatter +\include{chapters/introduction} +\include{chapters/example} % 書き方の見本.本文を書き始めたら削除する +\include{chapters/conclusion} + +\backmatter +\include{backmatter/acknowledgments} +\printbibliography[heading=bibintoc, title=参考文献] + +% 背表紙(配布されたら cover/ に置いて有効化) +% \includepdf[pages=-]{cover/backCover.pdf} + +\end{document} diff --git a/notes/outline.md b/notes/outline.md new file mode 100644 index 0000000..da785a9 --- /dev/null +++ b/notes/outline.md @@ -0,0 +1,15 @@ +# 章構成メモ + +構成が固まるまでここで検討し,決まったら `chapters/` にファイルを追加して `main.tex` に `\include` を足す。 + +## 仮の章立て + +1. 序論(`introduction.tex`): 研究背景 / 先行研究 / 研究目的 / 本論文の構成 +2. (研究の章: 未定): はじめに / 実験方法 / 結果と考察 / 小括 +3. 総論(`conclusion.tex`) + +## ルール + +- ファイル名は章番号ではなく内容で付ける(例: `method.tex`)。順番は `main.tex` で決める +- 図は `figures/<ファイル名と同じ章名>/` に置く +- ラベルは `種類:章:内容`(例: `fig:method:overview`) diff --git a/style/macros.tex b/style/macros.tex new file mode 100644 index 0000000..6c5f6d5 --- /dev/null +++ b/style/macros.tex @@ -0,0 +1,20 @@ +% 自作コマンド(main.tex から \input される) + +% ---- 参照 ---- +% ラベルは「種類:章:内容」で付ける.例: \label{fig:intro:overview} +% 本文では \figref{intro:overview} → 「図1.1」 +\newcommand{\figref}[1]{図\ref{fig:#1}} +\newcommand{\tabref}[1]{表\ref{tab:#1}} +\newcommand{\equref}[1]{式(\ref{eq:#1})} +\newcommand{\chapref}[1]{第\ref{chap:#1}章} +\newcommand{\secref}[1]{\ref{sec:#1}節} + +% ---- 執筆中の補助 ---- +% \showrevisionfalse にすると,修正箇所の色付けと TODO がすべて消える(提出時) +\newif\ifshowrevision +\showrevisiontrue + +% 修正箇所: \revised{修正した文} +\newcommand{\revised}[1]{\ifshowrevision{\color{red}#1}\else#1\fi} +% 書きかけ: \todo{実験条件を追記} +\newcommand{\todo}[1]{\ifshowrevision{\color{blue}[TODO: #1]}\fi} diff --git a/style/preamble.tex b/style/preamble.tex new file mode 100644 index 0000000..d3c01f7 --- /dev/null +++ b/style/preamble.tex @@ -0,0 +1,41 @@ +% パッケージの読み込み(main.tex から \input される) +% 日本語処理(luatexja)は jlreq が LuaLaTeX 上で自動的に読み込む + +% 数式とフォント(欧文・数式は Palatino 系.先輩の mathpazo に合わせる) +\usepackage{amsmath} +\usepackage{newpxtext, newpxmath} % amssymb の記号も含む +\usepackage{bm} + +% 見出し(先輩の jreport に合わせ,ゴシック + 欧文 Palatino 太字) +\ModifyHeading{chapter}{font={\huge\bfseries}} +\ModifyHeading{section}{font={\Large\bfseries}} +\ModifyHeading{subsection}{font={\large\bfseries}} +\ModifyHeading{subsubsection}{font={\normalsize\bfseries}} + +% 図表 +\usepackage{graphicx} +\graphicspath{{figures/}} +\usepackage{float} % [H] で位置を固定 +\usepackage{subcaption} % 小図 (a)(b) +\captionsetup{format=hang, font=small, labelfont=bf} % 先輩の caption[hang,small,bf] と同じ +\usepackage{booktabs} % 表の罫線 +\usepackage{multirow} +\usepackage{siunitx} % 数値と単位: \SI{3}{N}, \num{0.84} + +% PDF の差し込み(表紙・背表紙) +\usepackage{pdfpages} + +% 色(修正箇所の強調・TODO) +\usepackage{xcolor} + +% 参考文献(bib/references.bib を biber で処理,引用順の番号) +\usepackage[backend=biber, style=ieee]{biblatex} +\addbibresource{bib/references.bib} +\setlength{\biblabelsep}{0.5em} % jlreq では番号 [1] と本文の間が詰まるため + +% URL とリンク(hyperref はなるべく最後に読み込む) +\usepackage{url} +\usepackage[ + hidelinks, + bookmarksnumbered=true, +]{hyperref}