CCWO Embedded Space

CCWOの日々の開発を発信するブログ

LaTeX テンプレート 改

TeXのテンプレートを少し更新したので、

1カラム ショート

% ドキュメント設定
\documentclass[a4j,11pt]{jarticle}

% 余白設定
\setlength{\topmargin}{-0.5in}
\setlength{\oddsidemargin}{-5mm}
\setlength{\evensidemargin}{-19mm}
\setlength{\textwidth}{180mm}
\setlength{\textheight}{253mm}

% パッケージ設定
\usepackage[dvips]{graphicx}
\usepackage{tabularx}
\usepackage{subfigure}
\usepackage{fancyhdr}
\usepackage{comment}

% ページ番号設定
\renewcommand{\thepage}{--- \arabic{page} ---}

% ヘッダー設定
\pagestyle{fancy}
% \pagestyle{plain} % ページ番号表示
\lhead{} % 左上
\chead{} % 上
\rhead{Seminar} % 右上
%\lfoot{} % 左下
%\cfoot{} % 下
%\rfoot{} % 右下
\renewcommand{\headrulewidth}{0.0pt}

% タイトル設定
\title{Seminar\\theme}
\author{Name}
\date{Month Date, Year}

% 本文
\begin{document}
    % \maketitle
    % タイトル
    \begin{center}
    {\huge{Seminar}} % タイトル
    \\{\large{Theme}} % サブタイトル
    \end{center}
    \begin{flushleft}
    \end{flushleft}
    \begin{flushright}
    Month Date, Year % 日付
    \\Name % 名前
    \end{flushright}

    % 章
    \section{title 1}
    chapter1 aaa
    \subsection{title 1.1}
    sub chapter1.1
    \subsection{title 1.2}
    sub chapter1.2
    \section{title 2}
    chapter2
    \subsection{title 2.1}
    sub chapter2.1
    \subsection{title 2.2}
    sub chapter2.2
    % \newpage
\end{document}

2カラム ショート

% ドキュメント設定
\documentclass[twoclomn, a4j, 11pt]{jarticle}

% 余白設定
\setlength{\topmargin}{-0.5in}
\setlength{\oddsidemargin}{-5mm}
\setlength{\evensidemargin}{-19mm}
\setlength{\textwidth}{180mm}
\setlength{\textheight}{253mm}

% パッケージ設定
\usepackage[dvips]{graphicx}
\usepackage{tabularx}
\usepackage{subfigure}
\usepackage{fancyhdr}
\usepackage{comment}

% ページ番号設定
\renewcommand{\thepage}{--- \arabic{page} ---}

% タイトル設定
\title{Seminar\\theme}
\author{Name}
\date{Month Date, Year}

% 本文
\begin{document}
    % \maketitle
    % タイトル
    \twocolumn[
        \begin{center}
        {\huge{Seminar}} % タイトル
        \\{\large{Theme}} % サブタイトル
        \end{center}
        \begin{flushleft}
        \end{flushleft}
        \begin{flushright}
        Month Date, Year % 日付
        \\Name % 名前
        \end{flushright}
    ]
    % 本文
    \section{title 1}
    chapter1 aaa
    \subsection{title 1.1}
    sub chapter1.1
    \subsection{title 1.2}
    sub chapter1.2
    \section{title 2}
    chapter2
    \subsection{title 2.1}
    sub chapter2.1
    \subsection{title 2.2}
    sub chapter2.2
    % \columnbreak
\end{document}

以前あげた2カラムのテンプレートは少し改ページがうまくきかないというバグがあったので直しました。
以前の2カラムのテンプレートは、1カラムのドキュメントクラス→本文中からパッケージを使って2カラムとしていたのですが、これだと文章が2カラムで均等になるようになるので、体裁が悪いです。当たり前です。
なので、今回は2カラムのドキュメントクラスを用いて、見出し等は1カラムになるように結合して作りました。その結果うまくいったので今はこちらをベースに使っています。

最近のTeXの編集の流れとしましては、
グラフ→PythonからPDFで出力し、PDFで取り込み
図→Powerpointで作成しPDFで出力し、PDFで取り込み(この際、無駄な余白を切り取る処理を行います。)
数式・表→TeXの機能
その他→調べながら
といった感じでVSCode上でプレビューしながら行っています。ただ、VSCodeでのTeX編集も完璧というわけではなくて、まだ日本語でworningがでたりするときがあります。コンパイルに支障はないのですが、worningがいっぱい出てしまい、どこで今エラーが出ているのかがわからなくなってしまうときがあります。なので、こまめにプレビューしながらやっているという現状です。ここらへんはLaTeX workshopのアップデートとかでなんとかなりそうな気もするので気長に待ちたいと思います。現状そこまで深刻になるほどのエラーは出ていないので。

2017/07/09の記事