Skip to content

Instantly share code, notes, and snippets.

@cffnpwr
Last active June 14, 2022 01:46
Show Gist options
  • Save cffnpwr/a984a2d443c77f59cca91f2cb5982560 to your computer and use it in GitHub Desktop.
Save cffnpwr/a984a2d443c77f59cca91f2cb5982560 to your computer and use it in GitHub Desktop.
レポートを書くときのLaTeXテンプレ
\NeedsTeXFormat{pLaTeX2e}
\usepackage[top=30mm, bottom=30mm, right=25mm, left=25mm]{geometry}
\usepackage{siunitx}
\usepackage{graphicx}
\usepackage{array}
\usepackage{multirow}
\pagestyle{plain}
\DeclareOption{noPageNum}{\pagestyle{empty}}
\ProcessOptions\relax
\makeatletter
\renewcommand{\theequation}{\thesection.\arabic{equation}}
\renewcommand{\thefigure}{\thesection.\arabic{figure}}
\renewcommand{\thetable}{\thesection.\arabic{table}}
\@addtoreset{equation}{section}
\@addtoreset{figure}{section}
\@addtoreset{table}{section}
\long\def\@makecaption#1#2{%
\vskip\abovecaptionskip
\iftdir\sbox\@tempboxa{#1\hskip1zw#2}%
\else\sbox\@tempboxa{#1 #2}%
\fi
\ifdim \wd\@tempboxa >\hsize
\iftdir #1\hskip1zw#2\relax\par
\else #1 #2\relax\par\fi
\else
\global \@minipagefalse
\hbox to\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
\def\@biblabel#1{#1.}
\makeatother
\newcolumntype{I}{!{\vrule width 1.5pt}}
\newcommand{\bhline}{\noalign{\hrule height 1pt}}
\newcommand{\ctext}[1]{\raise0.2ex\hbox{\textcircled{\scriptsize{#1}}}}
\renewcommand{\baselinestretch}{1.2}
\renewcommand{\labelenumi}{(\arabic{enumi})}
\setlength{\unitlength}{1mm}
\newcommand{\reffig}[1]{図\ref{#1}}
\newcommand{\reftab}[1]{表\ref{#1}}
\newcommand{\refeq}[1]{式(\ref{#1})}
@cffnpwr
Copy link
Author

cffnpwr commented May 21, 2022

使い方

読み込み

texファイルがあるディレクトリと同じディレクトリにパッケージファイルを配置して

\usepackage{eireport}

で読み込んで使ってください

ページ番号の有無

\usepackage[noPageNum]{eireport}

でページ番号を無効化できます
前と同じように

\usepackage{eireport}

で読み込むとページ番号ありになります

図表番号

\reffig{図の名前}
\reftab{表の名前}
\refeq{式の名前}

のようにして図・表・式番号を呼び出せます
このとき図・表・式にはそれぞれ

\label{fig:図の名前}
\label{tab:表の名前}
\label{eq:式の名前}

のように名前をつけてください

太線

表で縦の太線を使いたいときは

\begin{tabular}{Ic|c|c|cI}

のように"I"(大文字のi)が使用できます
横の太線は

\bhline

で引けます

①みたいな文字

\ctext{番号}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment