%=================================================================
% form05_shingaku_kadai_header.tex
%	for the 2008(H20) Japanese Fiscal Year
%	2008-03-04 : Taku Yamanaka (Osaka Univ.)
%=================================================================
\usepackage{calc}
\usepackage{watermark}
\usepackage{longtable}
\usepackage{geometry}                % See geometry.pdf to learn the layout options. There are lots.

\geometry{noheadfoot,scale=1}  %scale=1 resets margins to 0
\setlength{\unitlength}{1pt}

% define variables for positions ==========================
% picture environment location, in  units of points
\newcommand{\KLOddPictureX}{}
\newcommand{\KLEvenPictureX}{}
\newcommand{\KLPictureY}{}
\newcommand{\KLOddPictureInWaterMarkX}{}
\newcommand{\KLEvenPictureInWaterMarkX}{}
\newcommand{\KLPictureInWaterMarkY}{}

% standard left edge positions
\newcommand{\KLOddLeftEdge}{}
\newcommand{\KLOddRightEdge}{}
\newcommand{\KLEvenLeftEdge}{}
\newcommand{\KLEvenRightEdge}{}
%------------------------------------------------------------

\newcommand{\KLLeftEdge}{}
\newcommand{\KLRightEdge}{}

% standard margins for text in frames
\setcounter{KLParboxSideMargin}{7}
\setcounter{KLParboxTopMargin}{12}
\setcounter{KLParboxBottomMargin}{5}

% ===== Global definitions for the Kakenhi form ======================
%　基本情報
\newcommand{\研究種目}{新学術領域研究}
\newcommand{\研究種目後半}{(研究課題提案型)}
\ifthenelse{\isundefined{\研究種別}}{
	\newcommand{\研究種別}{}
}{}%
\newcommand{\KLMainFile}{shingaku\_kadai.tex}
\newcommand{\KLForms}{shingaku_kadai_forms}
\newcommand{\KLYoshiki}{shingaku_kadai_form}

%　奇数ページの下に記入される情報
\newcommand{\klbyYup}{}
\newcommand{\klbyYdown}{}
\newcommand{\klbyKikanXleft}{}
\newcommand{\klbyKikanXright}{}
\newcommand{\klbyNameXleft}{}
\newcommand{\klbyNameXright}{}

\newcommand{\KLBottomInfo}[6]{%
	\ifthenelse{\equal{#1}{}}{%
		\renewcommand{\klbyYup}{72}
		\renewcommand{\klbyYdown}{58}
	}{%
		\renewcommand{\klbyYup}{#1}
		\renewcommand{\klbyYdown}{#2}
	}
	
	\ifthenelse{\equal{#3}{}}{%
		\renewcommand{\klbyKikanXleft}{110}
		\renewcommand{\klbyKikanXright}{326}
		\renewcommand{\klbyNameXleft}{416}
		\renewcommand{\klbyNameXright}{526}
	}{%
		\renewcommand{\klbyKikanXleft}{#3}
		\renewcommand{\klbyKikanXright}{#4}
		\renewcommand{\klbyNameXleft}{#5}
		\renewcommand{\klbyNameXright}{#6}
	}
	\KLTextBox{\klbyKikanXleft}{\klbyYup}{\klbyKikanXright}{\klbyYdown}{}{\研究機関名}%
	\KLTextBox{\klbyNameXleft}{\klbyYup}{\klbyNameXright}{\klbyYdown}{}{\研究代表者氏名}%
}

%==========================================================
\newcommand{\KLStandardLengths}{%
	\setlength{\textwidth}{168mm}
	\setlength{\textheight}{235mm}
}

\newcommand{\KLStandardPositions}{%
	% picture environment location, in  units of points
	\renewcommand{\KLOddPictureX}{82.5}% was 77
	\renewcommand{\KLEvenPictureX}{58.5}% was 50
	\renewcommand{\KLPictureY}{725}% was 760
	\renewcommand{\KLOddPictureInWaterMarkX}{72}% was 67
	\renewcommand{\KLEvenPictureInWaterMarkX}{48}% was 39
	\renewcommand{\KLPictureInWaterMarkY}{733}% was 768

	% standard left edge positions
	\renewcommand{\KLOddLeftEdge}{65}% was 58
	\renewcommand{\KLOddRightEdge}{551}% was 563
	\renewcommand{\KLEvenLeftEdge}{42}% was 31
	\renewcommand{\KLEvenRightEdge}{529}% was 535

	\setlength{\oddsidemargin}{0mm}
	\setlength{\evensidemargin}{-8.5mm}
	\setlength{\topmargin}{14mm}
}

%------ This should be set before \begin{document} ------
\KLStandardLengths
\KLStandardPositions
%----------------------------------------------------------------------------


