LoginSignup
3
5

More than 5 years have passed since last update.

他のTeXファイルの内容を読み込む方法

Last updated at Posted at 2017-01-08

docmuteパッケージを使って、他の$\TeX$ファイルの内容を読み込む方法についてまとめます。

想定するシチュエーション

  • 以下の文書を作成する必要がある
    • 発表用研究要旨 (abstract.tex)
    • 論文 (thesis.tex)
  • これらの文書のアブストラクトは共通している

docmuteパッケージの使い方

abstract.tex
\documentclass[uplatex]{jsarticle}

%(省略)

\begin{document}
\maketitle

\begin{abstract}
アブストラクトです。
\end{abstract}
\end{document}
thesis.tex
\documentclass[uplatex]{jsarticle}
%docmuteパッケージ読み込み
\usepackage{docmute}

%(省略)

\begin{document}
\maketitle

% abstract.texの内容(プリアンブルやタイトル除く)を挿入
%(どちらかのコマンドを使う)
\input{abstract}   %挿入する前後の改ページなし
\include{abstract} %挿入する前後の改ページあり

\clearpage
\tableofcontents

\clearpage
\section{はじめに}
%(省略)
\end{document}

参考文献

3
5
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
3
5