%=================================================================
% form05_tokusui_header.tex
%	2007-09-07: 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}  
\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}{tokusui.tex}
\newcommand{\KLForms}{tokusui_forms}
\newcommand{\KLYoshiki}{yoshiki_tokusui}

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

\newcommand{\KLBottomInfo}[6]{%
	\ifthenelse{\equal{#1}{}}{%
		\renewcommand{\klbyYup}{69}
		\renewcommand{\klbyYdown}{55}
	}{%
		\renewcommand{\klbyYup}{#1}
		\renewcommand{\klbyYdown}{#2}
	}
	
	\ifthenelse{\equal{#3}{}}{%
		\renewcommand{\klbyKikanXleft}{127}
		\renewcommand{\klbyKikanXright}{347}
		\renewcommand{\klbyNameXleft}{436}
		\renewcommand{\klbyNameXright}{550}
	}{%
		\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}{176mm}
}

\newcommand{\KLStandardPositions}{%
	% picture environment location, in  units of points
	\renewcommand{\KLOddPictureX}{75}% was 77
	\renewcommand{\KLEvenPictureX}{75}% was 50
	\renewcommand{\KLPictureY}{591}% was 760
	\renewcommand{\KLOddPictureInWaterMarkX}{64.5}% was 67
	\renewcommand{\KLEvenPictureInWaterMarkX}{68}% was 39
	\renewcommand{\KLPictureInWaterMarkY}{599}% was 768

	% standard left edge positions
	\renewcommand{\KLOddLeftEdge}{56}% was 58
	\renewcommand{\KLOddRightEdge}{552}% was 563
	\renewcommand{\KLEvenLeftEdge}{56}% was 31
	\renewcommand{\KLEvenRightEdge}{549}% was 535

	\setlength{\oddsidemargin}{-2.5mm}
	\setlength{\evensidemargin}{-2.5mm}
	\setlength{\topmargin}{61mm}
}

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

