%===== houga_forms ===================================
% 2007(H19)年度　萌芽 様式
%
% 2006-05-30 Taku Yamanaka (Physics Dept., Osaka Univ.)
% 2006-06-02 V1.0
% 2006-06-14 V1.1 Use automatic calculation for cost tables.
% 2006-06-18 V1.2 Split user's contents and the format.
% 2006-06-20 V1.3 Reorganized user and format files
% 2006-06-25 V1.4 Readjusted all the table column widths with p{...}.
%				With \KLTabR and \KLTabRNum, now the items can be right-justified
%				in the cell defined by p{...}.
% 2006-06-26 V1.5 Use \newlength and \setlength, instead of \newcommand, to define positions.
% 2006-07-12 V1.6 Remade for Houga (2005) by M. Kawaguchi.
% 2006-09-05 V1.7 Modified for JFY2007 version.
% 2006-09-09 V1.8 Added features to calculate efforts, etc.
% 2006-09-09 V1.9 Changed the first part of p.7.
%
% 2006-09-11 V2.0 Added an option to show budget summary.
% 2006-09-13 V2.1 Added an option to show the group.
% 2006-09-24 V2.1.2 Inserted \small{ ... } for the title in p.7.
%====================================================== 
\usepackage{../kakenhi}
%\DrawBox  % uncomment this to show the boxes 

\pagestyle{empty}

% ===== File format for forms ===========================
\ifthenelse{\boolean{usePDFform}}{
	\newcommand{\KLFormFormat}{pdf}	\usepackage[dvipdfm]{graphicx}
}{	\newcommand{\KLFormFormat}{eps}	\usepackage{graphicx}
}

% ===== Parameters for LaTeX =========================
\setlength{\topmargin}{-3.9cm}
\setlength{\oddsidemargin}{-2.9cm}
\setlength{\evensidemargin}{-2.9cm}
	% Above three margins are set so that the origin of the coordinate is the top-left corner.
	
\setlength{\textwidth}{22cm}		
	% should be large enough to avoid Overfull \hbox warning when including PDF form files
	
\setlength{\textheight}{30cm}	
	% should be large enough to avoid the 1st form to flow into the 2nd page
	 
% ===== Font declarations  ======================================
\DeclareFontShape{JT1}{mc}{m}{it}{<->ssub * mc/m/n}{}
\DeclareFontShape{JY1}{mc}{m}{it}{<->ssub * mc/m/n}{}

% ===== Parameters for KL (Kakenhi LaTeX) ========================
\newlength{\KLOddLeftEdge}		\setlength{\KLOddLeftEdge}{2.3cm}
\newlength{\KLEvenLeftEdge}		\setlength{\KLEvenLeftEdge}{1.3cm}
\newlength{\KLFullWidth} 			\setlength{\KLFullWidth}{17.2cm}
\newlength{\KLMiniPageWidth}	\setlength{\KLMiniPageWidth}{21cm} % 

% vertical and horizontal shift amounts for pdf and eps forms
\newlength{\KLGraphicsVspace}	\setlength{\KLGraphicsVspace}{-0cm}
\newlength{\KLGraphicsHspace}	\setlength{\KLGraphicsHspace}{-0.1cm}

% general purpose temporary variables
\newlength{\KLX}
\newlength{\KLY}
\newlength{\KLW}
\newlength{\KLH}
\newlength{\KLCella}
\newlength{\KLCellb}

% 奇数ページの下のある、種目、研究機関名、研究代表者氏名の座標
\newlength{\KLBottomInfoY}
\newlength{\KLBottomInfoH}		\setlength{\KLBottomInfoH}{5mm}
\newlength{\KLBottomKikanX}		\setlength{\KLBottomKikanX}{4.5cm}
\newlength{\KLBottomKikanW}		\setlength{\KLBottomKikanW}{79mm}
\newlength{\KLBottomNameX}		\setlength{\KLBottomNameX}{15.6cm}
\newlength{\KLBottomNameW}		\setlength{\KLBottomNameW}{41mm}

% ===== Global definitions for the Kakenhi form ======================
%　基本情報
\newcommand{\研究開始年度}{2007}
\newcommand{\研究開始元号年度}{19}	%平成
\newcommand{\研究種目}{萌芽研究}
\newcommand{\研究種目後半}{}
\ifthenelse{\isundefined{\研究種別}}{
	\newcommand{\研究種別}{}
}{}%
\newcommand{\KLMainFile}{houga.tex}

%　奇数ページの下に記入される情報
\newcommand{\KLBottomInfo}{
     \WHBLJ{\KLBottomKikanX}{\KLBottomInfoY}{\KLBottomKikanW}{\KLBottomInfoH}{\研究機関名}
     \WHBLJ{\KLBottomNameX}{\KLBottomInfoY}{\KLBottomNameW}{\KLBottomInfoH}{\研究代表者氏名}
}

%================================================================= 
 \begin{document}

%====== Budget Summary cover ==========
\ifthenelse{\boolean{BudgetSummary}}{
	\input{coverpage}
}{%<<<< NOT BudgetSummary <<<<<<

%======= S-1-12 (萌芽) p.1-2 研究目的　========================================
%======= S-1-12 (萌芽) p.1 研究目的　========================================
\section{研究目的}
 \begin{minipage}{\KLMiniPageWidth}
     \WHBP{\KLOddLeftEdge}{6.1cm}{\KLFullWidth}{20.8cm}{
         %begin 研究目的　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
	\研究目的
         %end 研究目的＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
     }
     
     % ----- 下の情報 ------------
    \setlength{\KLBottomInfoY}{27.1cm}
    \KLBottomInfo
     
     %----- 様式 -------------------
     \vspace{\KLGraphicsVspace}
     \hspace{\KLGraphicsHspace}
     \includegraphics{../houga_forms_\KLFormFormat/yoshiki_houga-page1.\KLFormFormat}
 \end{minipage}

%======== S-1-12 (萌芽) p.2 研究目的続き ===================================
\subsection{研究目的つづき}
 \begin{minipage}{\KLMiniPageWidth}
     \WHBP{\KLEvenLeftEdge}{2.6cm}{\KLFullWidth}{25.1cm}{
         %begin 研究目的続き　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
	\研究目的続き
         %end 研究目的続き　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
     }
     
     %----- 様式 -------------------
     \vspace{\KLGraphicsVspace}
     \hspace{\KLGraphicsHspace}
     \includegraphics{../houga_forms_\KLFormFormat/yoshiki_houga-page2.\KLFormFormat}
 \end{minipage}
   
%======== S-1-12 (萌芽) p.3-4 研究計画・方法 ===========================
%======== S-1-12 (萌芽) p.3 研究計画・方法 ===========================
\section{研究計画・方法}
 \begin{minipage}{\KLMiniPageWidth}
     \WHBP{\KLOddLeftEdge}{5.3cm}{\KLFullWidth}{21.8cm}{
         %begin 研究計画・方法　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
	\研究計画
         %end 研究計画・方法　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
     }
     
          % ----- 下の情報 ------------
    \setlength{\KLBottomInfoY}{27.3cm}
    \KLBottomInfo
    
     %----- 様式 -------------------
     \vspace{\KLGraphicsVspace}
     \hspace{\KLGraphicsHspace}
     \includegraphics{../houga_forms_\KLFormFormat/yoshiki_houga-page3.\KLFormFormat}
 \end{minipage}
 
 %======== S-1-12 (萌芽) p.4 研究計画・方法　つづき=====================
\subsection{研究計画・方法つづき}
 \begin{minipage}{\KLMiniPageWidth}
     \WHBP{\KLEvenLeftEdge}{2.4cm}{\KLFullWidth}{25.0cm}{
         %begin 研究計画・方法　つづき　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
	\研究計画つづき
         %end 研究計画・方法 つづき＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
     }

     
     %----- 様式 -------------------
     \vspace{\KLGraphicsVspace}
     \hspace{\KLGraphicsHspace}
     \includegraphics{../houga_forms_\KLFormFormat/yoshiki_houga-page4.\KLFormFormat}

 \end{minipage}
  
%======= S-1-12 (萌芽) p.5 人権、法令、分担金、研究経費の妥当性など =========
\section{人権、法令、分担金、研究経費の妥当性など}
\begin{minipage}{\KLMiniPageWidth}
\subsection{人権の保護及び法令等の遵守への対応}
    \WHBP{\KLOddLeftEdge}{3.3cm}{\KLFullWidth}{5.2cm}{
	%begin 人権の保護及び法令等の遵守への対応　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
	\人権の保護及び法令等の遵守への対応
	%end 人権の保護及び法令等の遵守への対応　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
    }
    
\subsection{研究分担者に分担金を配分する理由}
    \WHBP{\KLOddLeftEdge}{10.3cm}{\KLFullWidth}{5.2cm}{
	%begin 分担金を配分する必要性　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
	\分担金を配分する必要性
	%end 分担金を配分する必要性　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
    }

\subsection{研究経費の妥当性・必要性}
    \WHBP{\KLOddLeftEdge}{18.3cm}{\KLFullWidth}{8.7cm}{
	%begin 研究経費の妥当性・必要性　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
	\研究経費の妥当性と必要性
	%end 研究経費の妥当性・必要性　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
    }


     % ----- 下の情報 ------------
    \setlength{\KLBottomInfoY}{27.1cm}
    \KLBottomInfo
       %----- 様式 -------------------
     \vspace{\KLGraphicsVspace}
     \hspace{\KLGraphicsHspace}
     \includegraphics{../houga_forms_\KLFormFormat/yoshiki_houga-page5.\KLFormFormat}
 \end{minipage}    
  
}%>>>> NOT BudgetSummary

%========= S-1-12 (萌芽) p.6 設備備品費、消耗品費、旅費等の明細 ==================
\section{設備備品費、消耗品費、旅費等の明細}
 \begin{minipage}{\KLMiniPageWidth}
 \begingroup
   \setlength{\tabcolsep}{1mm}
   \begin{small}

\subsection{設備備品費の明細}
     \WHBLJ{1.1cm}{3.3cm}{11.2cm}{8.0cm}{
     	\renewcommand{\KLCostCategory}{KLequipments}
     	\KLResetGrandSum
	 \begin{tabular}{p{7.6mm}p{80mm}p{18mm}}
         		\phantom{年} & \phantom{品名・仕様} & \phantom{1}\\
		% Above line is used to allocate the width for the cost.  DO NOT REMOVE IT.
		%begin 設備備品費の明細　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
		\設備備品費の明細
		%end 設備備品費の明細　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
	 \end{tabular}
     }
     
\subsection{消耗品の明細}
     \WHBLJ{12.2cm}{3.3cm}{6.7cm}{8.0cm}{
     	\renewcommand{\KLCostCategory}{KLexpendables}
     	\KLResetGrandSum
	 \begin{tabular}{p{45mm}p{18mm}}
         		\phantom{品名} & \phantom{1}\\
		% Above line is used to allocate the width for the cost.  DO NOT REMOVE IT.
		%begin 消耗品費の明細　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
		\消耗品費の明細
		%end 消耗品費の明細　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
	 \end{tabular}
     }
  \end{small}
\endgroup
%======== 旅費等の明細===========================
\begingroup
  \setlength{\tabcolsep}{1mm}
  \begin{small}

\subsection{国内旅費}
	\WHBLJ{1.1cm}{12.1cm}{51.5mm}{15.4cm}{
		\renewcommand{\KLCostCategory}{KLtravel}
		\KLResetGrandSum
		\begin{tabular}{p{8mm}p{23.5mm}p{13.5mm}}
			\phantom{18} & \phantom{事項} & \phantom{1}\\
			%begin 国内旅費＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
			\国内旅費
			%end 国内旅費＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
		\end{tabular}
	}

\subsection{外国旅費}
	\WHBLJ{62mm}{12.1cm}{42mm}{15.4cm}{
		\renewcommand{\KLCostCategory}{KLtravel}
		\KLResetGrandSum
		\begin{tabular}{p{23mm}p{14mm}}
			\phantom{事項} & \phantom{1}\\
			%begin 外国旅費＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
			\外国旅費
			%end 外国旅費＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
		\end{tabular}
	}

\subsection{謝金等}
	\WHBLJ{103mm}{12.1cm}{43mm}{15.4cm}{
		\renewcommand{\KLCostCategory}{KLgratitude}
		\KLResetGrandSum
		\begin{tabular}{p{26mm}p{13mm}}
			\phantom{事項} & \phantom{1}\\
			%begin 謝金等 ＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
			\謝金等
			%end 謝金等 ＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
		\end{tabular}
	}

\subsection{その他}
	\WHBLJ{146mm}{12.1cm}{43mm}{15.4cm}{
		\renewcommand{\KLCostCategory}{KLmisc}
		\KLResetGrandSum
		\begin{tabular}{p{25mm}p{14mm}}
			\phantom{事項} & \phantom{1}\\
			%begin その他＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
			\その他
			%end その他＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
		\end{tabular}
	}
  \end{small}
\endgroup
	
 
       %----- 様式 -------------------
     \vspace{\KLGraphicsVspace}
     \hspace{\KLGraphicsHspace}
     \includegraphics{../houga_forms_\KLFormFormat/yoshiki_houga-page6.\KLFormFormat}
 \end{minipage}    

\ifthenelse{\boolean{BudgetSummary}}{
	% do nothing if true
}{%<<<< NOT BudgetSummary

%======== S-1-12 (萌芽) p.7 研究費の応募・受入等の状況・エフォート ==========
\section{研究費の応募・受入等の状況・エフォート}

\KLResetEffort

\subsection{応募中の研究費}
\begin{minipage}{\KLMiniPageWidth}
    \WHBLJ{5.2cm}{8.95cm}{5mm}{5mm}{
    	\研究期間の最終元号年度
    }
    
    \setlength{\KLY}{8.5cm}
    
    \WHBLJ{6.1cm}{\KLY}{40mm}{15mm}{
    	\small{
	\研究課題名（\研究代表者氏名)
	}
    }
    
    \WHBLJ{11.8cm}{\KLY}{16mm}{15mm}{
		\NumC{KLAnnualSum1} \\ (\NumC{KLAnnualSum0})
    }
    
    \WHBLJ{13.9cm}{\KLY}{10mm}{15mm}{
	%begindef 本応募エフォート　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
		\本応募effort
	%enddef 本応募エフォート　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
    }
    
    
    \WHBLJ{2.1cm}{8.8cm}{17.9cm}{18.6cm}{
	\begin{tabular}{p{35mm}p{37mm}p{11mm}p{16mm}p{7mm}p{46mm}}
		\phantom{資金制度}
		&\phantom{研究課題名}
		&\phantom{役割}
		&\phantom{1} % to right-jusify the budget amount
		&\phantom{99}
		&\phantom{相違点}
		\\
		% DO NOT REMOVE ABOVE DUMMY LINES...................................................
		
		%begin 応募中の研究費　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
		\応募中の研究費
		%end 応募中の研究費　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
	\end{tabular}
    }

     % ----- 下の情報 ------------
    \setlength{\KLBottomInfoY}{27.5cm}
    \KLBottomInfo
       
     %----- 様式 -------------------
     \vspace{\KLGraphicsVspace}
     \hspace{\KLGraphicsHspace}
     \includegraphics[]{../houga_forms_\KLFormFormat/yoshiki_houga-page7.\KLFormFormat}
\end{minipage}

%======== S-1-12 (萌芽) p.8 研究費の応募・受入等の状況・エフォート ==========
\subsection{受け入れ予定の研究費}

\begin{minipage}{\KLMiniPageWidth}
    \WHBLJ{1.1cm}{4.1cm}{17.9cm}{21.0cm}{
	\begin{tabular}{p{35mm}p{37mm}p{11mm}p{16mm}p{7mm}p{46.5mm}}
		\phantom{資金制度}
		&\phantom{研究課題名}
		&\phantom{役割}
		&\phantom{1} % to right-jusify the budget amount
		&\phantom{99}
		&\phantom{相違点}
		\\
		% DO NOT REMOVE ABOVE DUMMY LINES...................................................
		
		%begin 受け入れ予定の研究費　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
		\受け入れ予定の研究費
		%end 受け入れ予定の研究費　＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
	\end{tabular}
    }
    
    \WHBC{12.6cm}{25.2cm}{12mm}{14mm}{
	\arabic{KLRemainingEffort}	% その他の活動のエフォート
    }

         
     %----- 様式 -------------------
     \vspace{\KLGraphicsVspace}
     \hspace{\KLGraphicsHspace}
     \includegraphics[]{../houga_forms_\KLFormFormat/yoshiki_houga-page8.\KLFormFormat}
\end{minipage}

}%>>>> NOT BudgetSummary

% Print the Grand Total of the budget to the console. (as requested by the Kakenhi-Macro group).
\KLPrintGrandTotal

%==== Summary Table in DRAFT mode =====
\ifthenelse{\boolean{BudgetSummary}}{
	\newpage
	
	% restore parameters
	\setlength{\topmargin}{-2cm}
	\setlength{\oddsidemargin}{-0.5cm}
	\setlength{\evensidemargin}{-0.5cm}
	\setlength{\textwidth}{16cm}
	\setlength{\linewidth}{16cm}
	\setlength{\textheight}{25cm}

	\newpage	
	\input{summary_table}
	
	\newpage
	\input{group_table}

}{
}

