雑感等

音楽,数学,語学,その他に関するメモを記す.

TeX Live2018のセットアップ(Windows10)とソースの例

TeXWorksの設定(タイプセット)

  • 名前:MAIN_upLaTeX (ptex2pdf)
  • プログラム:C:/texlive/2018/bin/win32/ptex2pdf.exe
  • 引数
    • -l
    • -u
    • -ot
    • -kanji=utf8
    • $synctexoption -no-guess-input-enc -kanji=utf8
    • $fullname
  • 名前:CITE_upBibTeX
  • プログラム:C:/texlive/2018/bin/win32/upbibtex.exe
  • 引数
    • $basename

コンパイル順序

MAIN_upLaTeX (ptex2pdf)→CITE_upBibTeX→MAIN_upLaTeX (ptex2pdf)→MAIN_upLaTeX (ptex2pdf)

小塚フォントを有効にする

  • フォントのコピー
    • "C:\texlive\2018\texmf-dist\fonts\opentype"に"kozuka-pr6n"フォルダを作成
    • "C:\texlive\2018\texmf-dist\fonts\opentype\kozuka-pr6n"に"KozGoPr6N-Medium.otf"と"KozMinPr6N-Regular.otf"をコピー
  • cmdでフォントを有効にする
    • "updmap-sys --setoption kanjiEmbed kozuka"をcmd上で実行
    • "kanji-config-updmap-sys kozuka-pr6n"をcmd上で実行
    • "mktexlsr"をcmd上で実行

texファイルの例

\RequirePackage[l2tabu, orthodox]{nag}
\documentclass[12pt, a4j, uplatex]{jsarticle}
\bibliographystyle{junsrt} % 参考文献を引用された順で出力する
\usepackage[margin=15truemm,left=10truemm,right=10truemm,includehead,includefoot,dvipdfm]{geometry}
\usepackage[dvipdfmx]{graphicx,color}  % 図と文字色指定を有効にする
\usepackage[all, warning]{onlyamsmath}
\renewcommand{\figurename}{Fig.~}
\renewcommand{\tablename}{Table }
\usepackage{flushend}
\usepackage{type1ec}
\usepackage{fix-cm}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{comment} %begin{comment}等の複数行コメントを有効にする
\usepackage{setspace}
\usepackage{textcomp}
\usepackage{subfig}
\usepackage{amsmath,amssymb}
\usepackage{mathtools}
\mathtoolsset{showonlyrefs=true}
\usepackage{exscale}
\usepackage{bm}        %bm{}を有効にする
%\setstretch{1.2}
%\pagestyle{empty}
\usepackage[dvipdfmx]{hyperref}
\usepackage{pxjahyper} %図番号,式番号などのリンクを有効にする
\usepackage{float}        %図の配置でhere強制を有効にする
\usepackage{here}
\usepackage{dcolumn}
\usepackage{helvet} %英字のサンセリフ体をhelveticaにする
\usepackage{url} %urlのリンクを有効にする
\usepackage{multirow}
\usepackage{booktabs} %セルを結合した表を表示するために必要

%図表を最後にまとめる
\usepackage[nolists,nomarkers]{endfloat}
%まとめた図表を詰めて配置する
\renewcommand{\efloatseparator}{\medskip}

%pdfの図は''pdfcrop filename''でトリミング

\title{題名}
\author{所属\\所属 苗字 名前}
\date{2019/02/21}

\begin{document}
\maketitle


        \section{section 1}
\begin{enumerate}
\item 列挙1
\item 列挙2
\end{enumerate}

%\textcolor{red}{\huge{注意点}}

        \section{section 2}
本文

本文($\theta$帯域3-5\,Hz,$\alpha$帯域8-12\,Hz,$\beta$帯域18-24\,Hz)

1\,s(2049\,sample)なら$19\,\textrm{ch} \times 13\,\textrm{周波数点}=247\,次元$.

Fig.\,\ref{fig:figlabel1}で図の参照

\begin{figure}[h]
  \centering
  \includegraphics[width=0.6\linewidth]{figlabel1の図.png}
  \caption{figlabel1のキャプション}
  \label{fig:figlabel1}
\end{figure}

\begin{figure}[h]
  \centering
  \includegraphics[width=0.6\linewidth]{figlabel2の図.png}
  \caption{figlabel2のキャプション}
  \label{fig:figlabel2}
\end{figure}


        \section{section 3}
本文

Fig.\ref{fig:label}で図の参照.

○○によっては25\,Hz以上でもp値~~~~~,先行研究\cite{kenkyu}で用いられた~~~~~が期待できる.

\begin{figure}[h]
  \centering
  \includegraphics[width=1\linewidth]{picture.png}
  \caption{caption}
  \label{fig:label}
\end{figure}

        \section{section}
\begin{enumerate}
\item aaaa
\item bbbb
\end{enumerate}

\bibliography{cite} %このtexファイルと同一フォルダに"cite.bib"というbibファイルを配置すること.

\end{document}

bibファイルの例(cite.bib)

@book{
本,
author={authorname},
title={booktitle},
publisher={publisher},
year={2018}
}

@misc{
参照するときのラベル,
author={著者},
title={タイトル},
howpublished={\url{http://www.aaaaaaaaaaa.org/files/dir/filename.pdf}},
note={ページ名},
year={2009}
}

@book{
参照するときのラベル,
author={著者一 and 著者二 and 著者三},
title={タイトル},
publisher={○○株式会社},
year={2004}
}

@book{aaaabbbb-et-al-XXXX,
    title={title},
    author={Author Name andAuthor Name and Author Name},
    publisher={PUBL isher},
    note={\url{http://www.aaaaaaaaaaaa.org}},
    year={2016}
}

@MasterThesis{kenkyu,
title={○○についての研究},
author={著者名},
year={2015},
school={大学名}
}