%=================================================================
% form05_rpd_header.tex
%	for the 2007(H19) Japanese Fiscal Year
%	2006-10-01 : Taku Yamanaka (Osaka Univ.)
%			Switched to the new development system using a "mother file".
%	2007-08-08: Taku
%			Switched to a new method using "picture" environment.
%	2008-03-09: Taku
%			Readjusted parameters for the new 2008 form.
%=================================================================
\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{\研究種目}{RPD}
\newcommand{\研究種目後半}{}
\ifthenelse{\isundefined{\研究種別}}{
	\newcommand{\研究種別}{}
}{}%
\newcommand{\KLMainFile}{rpd.tex}
\newcommand{\KLForms}{rpd_forms}
\newcommand{\KLYoshiki}{rpd_form}

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

\newcommand{\KLBottomInfo}[6]{%
	\ifthenelse{\equal{#1}{}}{%
		\renewcommand{\klbyYup}{62}
		\renewcommand{\klbyYdown}{47}
	}{%
		\renewcommand{\klbyYup}{#1}
		\renewcommand{\klbyYdown}{#2}
	}
	
	\ifthenelse{\equal{#3}{}}{%
		\renewcommand{\klbyKikanXleft}{132}
		\renewcommand{\klbyKikanXright}{349}
		\renewcommand{\klbyNameXleft}{415}
		\renewcommand{\klbyNameXright}{542}
	}{%
		\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}{172mm}
	\setlength{\textheight}{250mm}
}

\newcommand{\KLStandardPositions}{%
	% picture environment location, in  units of points
	\renewcommand{\KLOddPictureX}{67}
	\renewcommand{\KLEvenPictureX}{65}
	\renewcommand{\KLPictureY}{791}
	\renewcommand{\KLOddPictureInWaterMarkX}{55}
	\renewcommand{\KLEvenPictureInWaterMarkX}{54}
	\renewcommand{\KLPictureInWaterMarkY}{800}

	% standard left edge positions
	\renewcommand{\KLOddLeftEdge}{46}
	\renewcommand{\KLOddRightEdge}{548}
	\renewcommand{\KLEvenLeftEdge}{46}
	\renewcommand{\KLEvenRightEdge}{548}

	\setlength{\oddsidemargin}{-6mm}
	\setlength{\evensidemargin}{-6mm}
	\setlength{\topmargin}{-10mm}
}

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


