\usepackage[dvipdfmx]{graphicx}
%\usepackage{mediabb}
\usepackage{color}
\usepackage{colortbl}
\usepackage{amsmath,amssymb} 
\usepackage{okumacro} 
\usepackage[dvipdfmx,colorlinks=true,linkcolor=blue,filecolor=blue,citecolor=blue,urlcolor=blue,
%hidelinks, % activate when the thesis is printed
]{hyperref}
\usepackage{cite}
\usepackage{pxjahyper}
\usepackage{titlesec}
\usepackage{tensor}
\usepackage{ifthen} % for parapara
\usepackage{intcalc} % for parapara
\usepackage{bm}
\usepackage{caption}
\usepackage[caption=false]{subfig}
\usepackage{comment}
%\usepackage{seqsplit} % to show labels of eqs, figures, etc. for easy writing
%\usepackage{showkeys} % to show labels of eqs, figures, etc. for easy writing
%\renewcommand*\showkeyslabelformat[1]{%
%\parbox[t]{\marginparwidth}{\raggedright\normalfont\small\ttfamily\seqsplit{\(\{\)#1\(\}\)}}}


\graphicspath{{./}{./figure/}{../figure/}}

%\renewcommand{\baselinestretch}{1.3} % これが一番読みやすい行間
\definecolor{gray}{gray}{0.9} 

\usepackage{fancyhdr}

%%% headings スタイルの別形を作成します（ご希望の体裁にしてください）
\fancypagestyle{varheadings}{%
   \fancyhf{}
   \fancyhead[EL]{\textbf{\thepage}}
   \fancyhead[ER]{\leftmark}
   \fancyhead[OR]{\textbf{\thepage}}
   %\fancyhead[OR]{
   %\textbf{\thepage}
   %\begin{picture}(0,0) %\put(0,0)
   %{
   %\ifthenelse{\intcalcMod{\thepage}{2}=0}{}{
   %\ifthenelse{\intcalcMod{\thepage}{16}=1 \OR \intcalcMod{\thepage}{16}=9}{
   %\includegraphics[width=1cm]{chapter/p0.pdf}}{
   %\ifthenelse{\intcalcMod{\thepage}{16}=3 \OR \intcalcMod{\thepage}{16}=7}{
   %\includegraphics[width=1cm]{chapter/p1.pdf}}{
   %\ifthenelse{\intcalcMod{\thepage}{16}=5}{
   %\includegraphics[width=1cm]{chapter/p2.pdf}}{
   %\ifthenelse{\intcalcMod{\thepage}{16}=11 \OR \intcalcMod{\thepage}{16}=15}{
   %\includegraphics[width=1cm]{chapter/p5.pdf}}{
   %\ifthenelse{\intcalcMod{\thepage}{16}=13}{
   %\includegraphics[width=1cm]{chapter/p6.pdf}}{
   %}
   %}
   %}
   %}
   %}
   %}
   %} \end{picture}
   %}
   \fancyhead[OL]{\rightmark}
   %\renewcommand{\headrulewidth}{0.5pt} 
   }

\fancypagestyle{chapheadings}{%
   \fancyhf{}
   %\fancyhead[EL]{\textbf{\thepage}}
   %\fancyhead[ER]{\leftmark}
   \fancyhead[OR]{\textbf{\thepage}}
   %\fancyhead[OR]{
   %\textbf{\thepage}
   %\begin{picture}(0,0) %\put(0,0)
   %{
   %\ifthenelse{\intcalcMod{\thepage}{2}=0}{}{
   %\ifthenelse{\intcalcMod{\thepage}{16}=1 \OR \intcalcMod{\thepage}{16}=9}{
   %\includegraphics[width=1cm]{chapter/p0.pdf}}{
   %\ifthenelse{\intcalcMod{\thepage}{16}=3 \OR \intcalcMod{\thepage}{16}=7}{
   %\includegraphics[width=1cm]{chapter/p1.pdf}}{
   %\ifthenelse{\intcalcMod{\thepage}{16}=5}{
   %\includegraphics[width=1cm]{chapter/p2.pdf}}{
   %\ifthenelse{\intcalcMod{\thepage}{16}=11 \OR \intcalcMod{\thepage}{16}=15}{
   %\includegraphics[width=1cm]{chapter/p5.pdf}}{
   %\ifthenelse{\intcalcMod{\thepage}{16}=13}{
   %\includegraphics[width=1cm]{chapter/p6.pdf}}{
   %}
   %}
   %}
   %}
   %}
   %}
   %} \end{picture}
   %}
   %\fancyhead[OL]{\rightmark}
   \renewcommand{\headrulewidth}{0pt} 
   }

\fancypagestyle{plain}{%
   \fancyhf{}
   \fancyhead[EL]{\textbf{\thepage}}
   \fancyhead[OR]{\textbf{\thepage}}
   \renewcommand{\headrulewidth}{0.4pt} 
   \fancyhead[ER]{\leftmark}
   \fancyhead[OL]{\rightmark}
  }
  
\fancypagestyle{abstractheadings}{%
   \fancyhf{}
   \renewcommand{\headrulewidth}{0.4pt} 
  }



%%% 全体のページスタイルはこの varheadings にします
\pagestyle{varheadings}

%%% 以下の設定は \pagestyle より後にするようにと fancyhdr のドキュメントにあります
%%% \headwidth は fancyhdr が導入したもので，\fullwidth は jsclasses が導入したものです
\setlength{\headwidth}{\fullwidth}

% centering the text area 
\addtolength{\evensidemargin}{-4truemm}
\addtolength{\oddsidemargin}{4truemm}

% activate them to center the headings lines
%\fancyhfoffset[EL,OR]{4truemm}
%\fancyhfoffset[ER,OL]{4truemm}

%%% headings のマークの設定を jsbook.cls からコピーします
\makeatletter
\def\chaptermark#1{\markboth{%
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
        \@chapapp\thechapter\@chappos\hskip1zw
      \fi
    \fi
    #1}{}}%
\def\sectionmark#1{\markright{%
    \ifnum \c@secnumdepth >\z@ \thesection \hskip1zw\fi
    #1}}
\makeatother

%\newcommand{\chapnumfont}[1]{\fontsize{25mm}{0pt}\selectfont\sf\textbf{#1}}


%\renewcommand{\prechaptername}{}  %欧文の場合消す
%\renewcommand{\postchaptername}{}  %欧文の場合消す
\renewcommand{\appendixname}{補遺}  %欧文の場合消す

\newcommand{\repeatcaption}[2]{%
  \renewcommand{\thefigure}{\ref{#1}}%
  \captionsetup{list=no}%
  \caption{#2 \pageref{#1}ページからの再掲。}% 図の繰り返しコマンド
}



\titleformat{\chapter}[display]{\Huge\bfseries}{第\thechapter 章}{0pt}{\Huge\bfseries}


\let\Gamma\varGamma
\let\Delta\varDelta
\let\Theta\varTheta
\let\Lambda\varLambda
\let\Xi\varXi
\let\Pi\varPi
\let\Sigma\varSigma
\let\Upsilon\varUpsilon
\let\Phi\varPhi
\let\Psi\varPsi
\let\Omega\varOmega
