AtomにはTeXをコンパイル可能にするパッケージが存在しています。
それが https://atom.io/packages/latex です。
thomasjo氏が配布しているこのパッケージは素晴らしいですが、
コンパイル方法がpdflatex,lualatex,xelatexの3つだけしかありません。
そのため、日本語をコンパイルすることができませんでした。
そこで、日本語のTexをコンパイルできるようにした内容を備忘録として書き留めておこうと思います。
まずpdflatexでも日本語をコンパイル可能にするためにbxcjkjatypeパッケージを使用しました。
そしてプリアンブル部分に次のように記述しました。
\documentclass[12pt,a4paper]{report}
\usepackage[whole]{bxcjkjatype}
これで、コンパイルが可能になります。
しかし、このままだと第何章という表記ではなく、Chapter ○ という表記になっています。
また、タイトルが2行目に来てしまう問題があります。
(このままでもいいのかもしれないが、今まで使っていたujreportの表記と変わってしまうのが気に食わなかった)
そこで、report.clsファイルの中身を書き換えることにしたのでメモしておきます。
変更する際は バックアップを取ることをおすすめ します。
変更箇所が多いので、該当箇所のbefore,afterを対にして表記します。
一部のみの変更も多いのでよく見比べてもらえると助かります。
\newcommand\@chapapp{\chaptername}
\newcommand\chaptername{Chapter}
\newcommand\@chapapp{\prechaptername}
\newcommand\@chappos{\postchaptername}
\newcommand\prechaptername{Chapter}
\newcommand\postchaptername{}
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#1}%
\else
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter\space\@chappos.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#1}%
\else
\def\@makechapterhead#1{%
\vspace*{50\p@}%
\vspace*{\p@}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\huge\bfseries \@chapapp\space \thechapter\space \@chappos
\par\nobreak
\vskip 20\p@
\fi
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@
}}
\def\@makechapterhead#1{%
% \vspace*{50\p@}%
\vspace*{\p@}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\huge\bfseries \@chapapp\space \thechapter\space \@chappos\space\space \Huge \bfseries #1
\par\nobreak
\vskip 20\p@
\fi
\interlinepenalty\@M
% \Huge \bfseries #1\par\nobreak
\vskip 40\p@
}}
\def\chaptermark##1{%
\markboth {\MakeUppercase{%
\ifnum \c@secnumdepth >\m@ne
\@chapapp\ \thechapter. \ %
\fi
##1}}{}}%
\def\chaptermark##1{%
\markboth {\MakeUppercase{%
\ifnum \c@secnumdepth >\m@ne
\@chapapp\ \thechapter\ \@chappos. \ % <=ここだけ
\fi
##1}}{}}%
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#1}%
\else
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter\space\@chappos.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#1}%
\else
以上の箇所を変更することで、ujreportクラスをplatexしてpdf出力したときと似たようなレイアウトになる(はず)。
最後にtexのプリアンブル部分に第何章表記にするためのコマンドを書き足して終了。
\renewcommand{\prechaptername}{第}
\renewcommand{\postchaptername}{章}
雑な記述ですが、自分と似たようなことをしようとしている人の助けになればと思います。
###追記:
Atom + MacTeX2015 + OS X ElCapitan 環境で再度構築して、動作を確認しました。
report.clsファイルが新しく作られるので、このページの内容を再度行えばujreport.clsと同等になりました。