diff --git a/flake.nix b/flake.nix index 0761c6b..6964aef 100644 --- a/flake.nix +++ b/flake.nix @@ -159,6 +159,8 @@ xstring xpatch blindtext + multirow + etoolbox ] ++ [ ps.import ]); in { diff --git a/tex/coms.sty b/tex/coms.sty index ea8c168..c270dfb 100644 --- a/tex/coms.sty +++ b/tex/coms.sty @@ -24,9 +24,17 @@ \def\@turninday{#3} } +\newcommand{\duedate}[3]{ + \def\@dueyear{#1} + \def\@duemonth{#2} + \def\@dueday{#3} +} + \newcommand{\schoolname}[1]{\def\@schoolname{#1}} \newcommand{\studentid}[1]{\def\@studentid{#1}} \newcommand{\seatingnum}[1]{\def\@seatingnum{#1}} \newcommand{\department}[1]{\def\@department{#1}} \newcommand{\subject}[1]{\def\@subject{#1}} \newcommand{\professor}[1]{\def\@professor{#1}} +\newcommand{\schoolyear}[1]{\def\@schoolyear{#1}} +\newcommand{\grade}[1]{\def\@grade{#1}} diff --git a/tex/experiment-title.sty b/tex/experiment-title.sty new file mode 100644 index 0000000..b795ab4 --- /dev/null +++ b/tex/experiment-title.sty @@ -0,0 +1,80 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{experimentTitle} + +\usepackage{tex/coms} +\usepackage{multirow} +\usepackage{array} +\usepackage{etoolbox} +\usepackage{ifthen} + +\makeatletter +\newcounter{researchercount} +\setcounter{researchercount}{1} +\newcommand{\addResearcher}[1]{\listadd{\researchers}{#1}} +\newcommand{\researchercs}[1]{ + \ifthenelse{\isodd{\theresearchercount}} + { + & \underline{(\theresearchercount) #1} + } + { + & \underline{(\theresearchercount) #1} \@arraycr + } + \stepcounter{researchercount} +} + +\newcounter{expdatecount} +\setcounter{expdatecount}{0} +\newcommand{\expdates}{} +\newcommand{\addExperimentDate}[1]{\listadd{\expdates}{#1}} +\newcommand{\expdatecs}[1]{\stepcounter{expdatecount} & \underline{\theexpdatecount. #1} \@arraycr} + +\newcommand{\expgroup}[1]{\def\@expgroup{#1}} +\newcommand{\reportid}[1]{\def\@reportid{#1}} + +\newcommand{\experimentTitle}{ + \begin{titlepage} + \thispagestyle{empty} + \begin{flushright} + 提出締切\hspace{2em}{\@dueyear \@duemonth \@dueday} + + 提出\qquad\hspace{1.84375em}{\@turninyear \@turninmonth \@turninday} + \end{flushright} + + \vspace{2em} + + \begin{center} + {\Large {\@schoolyear}年度 {\@department}\quad {\@grade}年} + + \vspace{2em} + + {\Huge {\@subject}レポート} + \end{center} + + \begin{flushleft} + \vspace{1em} + + レポート記号:\qquad {\@reportid} + + \vspace{1em} + + 実験テーマ名:\qquad {\@title} + + \vspace{1em} + + 提出者:\quad \underline{実験班:\quad \@expgroup}\quad \underline{名列番号\quad \@seatingnum}\quad \underline{氏名\quad \@author} + + \vspace{1em} + + \hspace{-0.5625em}\begin{tabular}{ lp{5em}p{5em} } + \multirow[t]{3}{7.3125em}{共同実験者:} \forlistloop{\researchercs}{\researchers} + \end{tabular} + + \vspace{5em} + + \hspace{-0.5625em}\begin{tabular}{ lp{5em} } + \multirow[t]{3}{7.3125em}{実験実施日:} \forlistloop{\expdatecs}{\expdates} + \end{tabular} + \end{flushleft} + \end{titlepage} +} +\makeatother