2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

TeX 執筆時にファイル分割をする方法

Posted at

0. 本記事概要

私は専攻柄、よくTeXを用います。
きっとこの記事を読んでくれた方に「TeXって何?」という方はいないと思うので、TeXそのものの説明はしません。

大量の文章を執筆する際、1つのファイルに書くのはあまり好ましくないと思っています。(どこに何書いたか分からないし…)

そこで、例えばセクションごとにファイルを作成して、最後に合体させることができればかなり良いと思っています。
私自身も最近この方法を知りました。私の備忘録という意味も込めてこの記事を書きます。

#1. 方法

ファイル構造は、以下のようになっているとします。
スクリーンショット 2019-11-13 11.46.13.png

「01_report」の中に、分割している「chapter_」ファイルと、最後に統合して出力するreport.tex があります。

統合しているreport.texには、以下のように記述します。

report.tex
\documentclass[dvipdfmx,uplatex]{jsarticle}
\def\vector#1{\mbox{\boldmath $#1$}}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[hiresbb]{graphicx}
\usepackage{ascmac}
\usepackage{siunitx}
\usepackage{float}
\usepackage{tikz}
\usepackage{circuitikz}
\usepackage{url}
\makeatletter
 \renewcommand{\theequation}{%
   \thesubsection.\arabic{equation}}
  \@addtoreset{equation}{subsection}
\makeatother
\title{title}
\author{name}
\date{date}
\begin{document}
\maketitle

\include{chapter01/191105}








\end{document}

使いたいパッケージと、\includeを用います。.texの拡張子を書く必要はありません。

注意

分割しているchapter内のtexファイルに usepackageを記述するとおかしくなりました。分割されたファイルには記述せず、ただひたすら文を打っていきます。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?