| 1 |
\documentclass[luatex,fontsize=8pt,paper=b5,twoside]{jlreq}% |
| 2 |
\usepackage{amsmath,amssymb} |
| 3 |
\usepackage{booktabs,caption} |
| 4 |
\usepackage{luwa-ul, KKluaverb} |
| 5 |
\usepackage[most]{tcolorbox} |
| 6 |
\usepackage{luatexja-ruby} |
| 7 |
\usepackage{KKran} |
| 8 |
|
| 9 |
% You can omit these font settings. |
| 10 |
\makeatletter |
| 11 |
\RequirePackage[no-math]{fontspec} |
| 12 |
\RequirePackage[no-math,match,scale=1]{luatexja-fontspec} |
| 13 |
\RequirePackage[hiragino-pro,deluxe,expert]{luatexja-preset} |
| 14 |
\setmainfont{HiraMinPro-W3}[BoldFont=HiraMinPro-W6] |
| 15 |
\setmainjfont{HiraMinPro-W3}[BoldFont=HiraMinPro-W6] |
| 16 |
\newfontfamily{\sfhira@pre}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6] |
| 17 |
\newjfontfamily{\sfhiraj@pre}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6] |
| 18 |
\newfontfamily{\mchira@pre}{HiraMinPro-W3}[BoldFont=HiraMinPro-W6] |
| 19 |
\newjfontfamily{\mchiraj@pre}{HiraMinPro-W3}[BoldFont=HiraMinPro-W6] |
| 20 |
\newfontfamily{\gthira@pre}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6,FontFace={eb}{\shapedefault}{HiraKakuStd-W8}] |
| 21 |
\newjfontfamily{\gthiraj@pre}{HiraKakuPro-W3}[BoldFont=HiraKakuPro-W6,FontFace={eb}{\shapedefault}{HiraKakuStd-W8}] |
| 22 |
\newfontfamily{\mghira@pre}{HiraMaruPro-W4} |
| 23 |
\newjfontfamily{\mghiraj@pre}{HiraMaruPro-W4} |
| 24 |
\renewcommand{\sffamily}{\sfhira@pre\sfhiraj@pre} |
| 25 |
\renewcommand{\mcfamily}{\mchira@pre\mchiraj@pre} |
| 26 |
\renewcommand{\gtfamily}{\gthira@pre\gthiraj@pre} |
| 27 |
\renewcommand{\mgfamily}{\mghira@pre\mghiraj@pre} |
| 28 |
\makeatother |
| 29 |
%%% |
| 30 |
|
| 31 |
|
| 32 |
\usepackage{hyperref} |
| 33 |
\hypersetup{ |
| 34 |
luatex, pdfencoding=auto, |
| 35 |
colorlinks=true, |
| 36 |
linkcolor=black, |
| 37 |
citecolor=black, |
| 38 |
urlcolor=DeepSkyBlue3, |
| 39 |
pdfborder={0 0 0}, |
| 40 |
} |
| 41 |
|
| 42 |
\colorlet{grayLight}{white!80!black} |
| 43 |
|
| 44 |
\NewTCBListing{SourceCode}{ m m !o !O{DeepSkyBlue3} }{% |
| 45 |
enhanced, colback=black!70, colframe=Snow4, |
| 46 |
toptitle=-1mm, bottomtitle=-1mm, |
| 47 |
righttitle=-1mm, lefttitle=-1mm, |
| 48 |
arc=.5mm, |
| 49 |
title={\tcbox[on line, arc=.5mm, boxsep=0pt, boxrule=0pt, top=1mm, bottom=0.8mm, left=2mm, right=2.2mm, colback=gray!80, coltext=white]{\raisebox{-0.1ex}{\vphantom{羅}\vphantom{j}#1}}},fonttitle=\gtfamily\footnotesize,boxrule=0.8pt, |
| 50 |
breakable,before upper={\color{white}},top=-0.5mm,bottom=-0.5mm, |
| 51 |
after title=\IfNoValueTF{#3}{}{{\hfill\tcbox[on line, arc=.5mm, boxsep=0pt, boxrule=0pt, top=1mm, bottom=0.8mm, left=2mm, right=2.2mm, colback=white!80!black, coltext=#4]{\raisebox{-0.1ex}{\vphantom{羅}\vphantom{j}#3}}}}, |
| 52 |
listing only, |
| 53 |
listing options={ |
| 54 |
language={#2}, |
| 55 |
basicstyle=\ttfamily, |
| 56 |
keywordstyle=\ttfamily\color{white}, |
| 57 |
stringstyle=\itshape\color{white}, |
| 58 |
commentstyle=\small\gtfamily\color{DeepSkyBlue2}, |
| 59 |
showspaces=false,showtabs=false, |
| 60 |
breaklines=true,breakindent=0pt, |
| 61 |
showstringspaces=false, |
| 62 |
columns=fullflexible, |
| 63 |
tabsize=2, |
| 64 |
numbers=left,numbersep=1.5pt, |
| 65 |
numberstyle=\scriptsize\gtfamily\color{gray}, |
| 66 |
} |
| 67 |
} |
| 68 |
|
| 69 |
\NewTColorBox{OutPut}{ m !o !O{DeepSkyBlue3} }{% |
| 70 |
enhanced, colframe=Snow4, |
| 71 |
toptitle=-1mm, bottomtitle=-1mm, |
| 72 |
righttitle=-1mm, lefttitle=-1mm, |
| 73 |
arc=.5mm, colback=white, |
| 74 |
title={\tcbox[on line, arc=.5mm, boxsep=0pt, boxrule=0pt, top=1mm, bottom=0.8mm, left=2mm, right=2.2mm, colback=gray!40, coltext=DeepSkyBlue3]{\raisebox{-0.1ex}{\vphantom{羅}\vphantom{j}#1}}},fonttitle=\gtfamily\footnotesize,boxrule=0.8pt, |
| 75 |
breakable,top=-0.5mm,bottom=-0.5mm, |
| 76 |
after title=\IfNoValueTF{#2}{}{{\hfill\tcbox[on line, arc=.5mm, boxsep=0pt, boxrule=0pt, top=1mm, bottom=0.8mm, left=2mm, right=2.2mm, colback=white!80!black, coltext=#3]{\raisebox{-0.1ex}{\vphantom{羅}\vphantom{j}#2}}}}, bottom=2mm, top=2mm, |
| 77 |
} |
| 78 |
|
| 79 |
\title{\texttt{KKran} Package Documentation} |
| 80 |
\author{Kosei Kawaguchi a.k.a. KKTeX} |
| 81 |
\date{Version 1.1.6 (2026/02/20)} |
| 82 |
|
| 83 |
\begin{document} |
| 84 |
\begin{titlepage} |
| 85 |
\maketitle |
| 86 |
\end{titlepage} |
| 87 |
\newpage |
| 88 |
\tableofcontents |
| 89 |
\newpage |
| 90 |
|
| 91 |
\section{Outline in English} |
| 92 |
This is a package that offers commands for generating answer fields used in tests and exams. It is compatible with both vertical and horizontal text formatting. Using Lua and tikz, I made it possible to generate answer-boxes very easily. By the way, the naming may seem a bit odd, but the package name comes from ``欄 (ran)'' meaning ``a small space.'' I hope this package will be helpful to you. |
| 93 |
|
| 94 |
\section{はじめに} |
| 95 |
このパッケージは、オーソドックスなフォーマットの解答欄を作成するためのコマンドを提供するパッケージです。横書きと縦書きの両方に対応しています。内部的にLuaの構文を使用しているので、\namiKK{LuaLaTeX限定}です。 |
| 96 |
|
| 97 |
本パッケージによって、以下のような解答欄を作成することが可能です。サンプルのソースコードは本マニュアル末のセクションにあります。 |
| 98 |
|
| 99 |
\begin{center} |
| 100 |
\includegraphics[width=.9\columnwidth]{kkran-sample.pdf} |
| 101 |
\end{center} |
| 102 |
|
| 103 |
\section{依存性} |
| 104 |
内部的に読み込むパッケージは |
| 105 |
\begin{itemize}\ttfamily |
| 106 |
\item calc, tikz |
| 107 |
\item xcolor, KKsymbols |
| 108 |
\item kvoptions, luacode |
| 109 |
\end{itemize} |
| 110 |
\noindent となります。 |
| 111 |
|
| 112 |
\section{設置・オプション} |
| 113 |
しかるべき場所に\texttt{KKran.sty}が置かれている下で、\verb|\usepackage[オプション]{KKran}|により読み込みます。 |
| 114 |
|
| 115 |
パッケージオプションは |
| 116 |
|
| 117 |
\begin{description} |
| 118 |
\item[\KKverb|kaitouhyouji|] 解答欄上に模範解答を出力するか否かを指定します。"0"なら出力せず、"1"なら出力します。デフォルトは1です。 |
| 119 |
\item[\KKverb|kaitoucolor|] 模範解答の文字の色を指定します。デフォルトはredです。 |
| 120 |
\item[\KKverb|gridmax|] マス目を出力するコマンドである\verb|\小問マス目| において、1行当たりの最大マス目数を指定します。デフォルトは20です。 |
| 121 |
\item[\KKverb|nongridmax|] 記述解答欄を出力するコマンドである\verb|\小問記述| において、1行当たりの最大マス目数を指定します。ただし、このコマンドではマス目は可視化されません。デフォルトは20です。 |
| 122 |
\item[\KKverb|unit|] 本パッケージでは「マス目単位で」各解答欄の位置を制御します。その際の1マスの幅を指定するのがこのオプションです。デフォルトは\verb|2\zw|です。 |
| 123 |
\item[\KKverb|wakuwidth|] 解答欄の枠線の太さを指定します。デフォルトは\verb|.7pt|です。 |
| 124 |
\item[\KKverb|tensenwakuwidth|] 欄の一部に使われている点線部分の太さを指定します。デフォルトは\verb|.7pt|です。 |
| 125 |
\item[\KKverb|tensenon|] 欄の一部に使われている点線部分のdash-patternを決めるためのもので、線の最小単位の長さを指定できます。デフォルトは\verb|1pt|です。 |
| 126 |
\item[\KKverb|tensenoff|] 欄の一部に使われている点線部分のdash-patternを決めるためのもので、最小単位の配置間隔を指定できます。デフォルトは\verb|1pt|です。 |
| 127 |
\item[\KKverb|clsadjust|] jlreqクラス以外を指定する場合は、\verb|clsadjust=1|を指定します。一部クラスにおいて\verb|\小問マス目|に解答を入力した際、字間の調整が適切になされない事例があるためです。この値のデフォルトは0になっています。このオプションは内部的に、\verb|clsadjust=1|のとき |
| 128 |
\KKcodeS+ |
| 129 |
\RequirePackage[scale=1]{luatexja-fontspec} |
| 130 |
\RequirePackage[deluxe,expert]{luatexja-preset} |
| 131 |
\KKcodeE |
| 132 |
\noindent を読み込むという処理をしています。したがって、より詳細にこれらのオプションを設定したい場合には\verb|clsadjust=0|とし、適宜設定をしてください。 |
| 133 |
\item[\KKverb|fontdaimonbangou/fontshoumonbangou|] 大問番号/小問番号のフォントを\verb|\gtfamily|や\verb|\small|のような形式で指定します。デフォルトは\verb|\relax|(つまり指定なし)です。 |
| 134 |
\item[\KKverb|styledaimonbangou/styleshoumonbangou|] 大問番号/小問番号のスタイルを指定します。指定するのは「制御綴名」です。例えば``\verb|\maru{引数}|''(\verb|KKsymbols|パッケージが提供)を使用して大問番号を丸数字にしたいという場合、\verb|styleshoumonbangou=maru|とします。デフォルトは\verb|kakko|となっています。特に括弧や丸などをつけたくない場合、\verb|全角幅固定|と指定するのが推奨されます。 |
| 135 |
\end{description} |
| 136 |
|
| 137 |
\section{使い方} |
| 138 |
\subsection{\KKverb|\KKran|} |
| 139 |
このパッケージを使って解答欄を出力する場合、解答欄は\verb|\KKran[オプション]{引数}|の\verb|{引数}|に入れていくという形をとります。 |
| 140 |
|
| 141 |
\begin{SourceCode}{Input}{TeX} |
| 142 |
\KKran[解答欄の外枠を囲む線の太さ]{引数}[ナンバリングのオプション] |
| 143 |
\end{SourceCode} |
| 144 |
|
| 145 |
\noindent という構文です。 |
| 146 |
|
| 147 |
ナンバリングのオプションとは、番号をどの形式で進めるかを指定するもので、 |
| 148 |
|
| 149 |
\begin{SourceCode}{Input}{TeX} |
| 150 |
\KKran[解答欄の外枠を囲む線の太さ]{引数}[% |
| 151 |
daimon=いろは, shoumon=一 |
| 152 |
] |
| 153 |
\end{SourceCode} |
| 154 |
|
| 155 |
\noindent のような書き方をします。それぞれ何も指定しない場合は、アラビア数字でカウントされますが、そうでないカウント方法を取りたい場合、以下の選択肢から選ぶことになります。 |
| 156 |
|
| 157 |
\begin{description} |
| 158 |
\item[\KKverb|daimon|] a, A, あ, ア, いろは, イロハ, 一, ロ小, ロ大を取れる。それぞれ、abc\dots, ABC\dots, あいう\dots, アイウ\dots, いろは\dots, イロハ\dots, 一二三\dots, \Rrnum{1} \ \Rrnum{2} \ \Rrnum{3}\dots, \Rrnum*{1} \ \Rrnum*{2} \ \Rrnum*{3}\dots というカウント形式です。 |
| 159 |
\item[\KKverb|shoumon|] 上に同じです。 |
| 160 |
\end{description} |
| 161 |
|
| 162 |
\subsection{小問} |
| 163 |
小問を構成する際は、\verb|\小問番号|で番号を、\verb|\小問欄|と\verb|\小問中欄|で欄をつけるという形です。 |
| 164 |
|
| 165 |
\begin{SourceCode}{Input}{TeX} |
| 166 |
% 構文 |
| 167 |
\小問番号[横幅]{縦幅}[番号] |
| 168 |
% デフォルト |
| 169 |
% 横幅:.5 |
| 170 |
% 番号:アラビア数字(\kakkoに入っている) |
| 171 |
|
| 172 |
% 使用例 |
| 173 |
\KKran{% |
| 174 |
\小問番号[1]{2}\小問番号{2}[A]\小問番号{2}[B]\小問番号[1]{2}\小問番号[1]{2} |
| 175 |
} |
| 176 |
\end{SourceCode} |
| 177 |
|
| 178 |
\noindent が基本構文です。 |
| 179 |
|
| 180 |
出力は |
| 181 |
|
| 182 |
\begin{OutPut}{Output} |
| 183 |
\KKran{% |
| 184 |
\小問番号[1]{2}\小問番号{2}[A]\小問番号{2}[B]\小問番号[1]{2}\小問番号[1]{2} |
| 185 |
} |
| 186 |
\end{OutPut} |
| 187 |
|
| 188 |
\noindent のようになります。 |
| 189 |
|
| 190 |
第3引数を指定しない場合、小問番号のカウンタは自動で進みますが、ここを手動で書いた場合はカウンタが進みません。 |
| 191 |
カウンタを強制的にある値にしたい場合には、\verb|\SetShoumon{99}|のように変更できるようにしてあります。 |
| 192 |
|
| 193 |
また、当然ながら大問が変わると値はリセットされます(大問の分け方は後述)。 |
| 194 |
|
| 195 |
ここに、\verb|\小問欄|および\verb|小問中欄|を組み合わせます。 |
| 196 |
|
| 197 |
\begin{SourceCode}{Input}{TeX} |
| 198 |
% 構文 |
| 199 |
\小問欄{横幅}{縦幅}[欄内記入] |
| 200 |
\小問中欄{横幅}{縦幅}[欄内記入] |
| 201 |
% デフォルト |
| 202 |
% 欄内記入:空集合 |
| 203 |
|
| 204 |
% 使用例 |
| 205 |
\KKran{% |
| 206 |
\小問番号{2}\小問中欄{3}{2}\小問中欄{3}{2}\小問欄{4}{2}[south east={$\mathrm{mm}$}, west={$x=$}]\小問番号{2}\小問欄{4}{2} |
| 207 |
} |
| 208 |
\end{SourceCode} |
| 209 |
|
| 210 |
\begin{OutPut}{Output} |
| 211 |
\KKran{% |
| 212 |
\小問番号{2}\小問中欄{3}{2}\小問中欄{3}{2}\小問欄{4}{2}[south east={$\mathrm{mm}$}, west={$x=$}]\小問番号{2}\小問欄{4}{2} |
| 213 |
} |
| 214 |
\end{OutPut} |
| 215 |
|
| 216 |
基本的には\verb|\小問欄|を使いますが、同一の小問内で複数解答欄を用意する時などは、最後の欄以外を\verb|\小問中欄|にしても良いでしょう。 |
| 217 |
|
| 218 |
欄内記入に関して、オプションとして\KKverb|center,east,west,north east, north west, south east, south west|をとることができ、各key名に対応する箇所をアンカーポイントとしてその引数が出力されます。tikzにおけるnodeのオプションと全く同様です。 |
| 219 |
|
| 220 |
引数には何を挿入してもよく、図表も挿入可能です。 |
| 221 |
|
| 222 |
\begin{SourceCode}{Input}{TeX} |
| 223 |
\KKran{ |
| 224 |
\小問番号{6}\小問欄{8}{6}[center={% |
| 225 |
\begin{tabular}{|l|c|r|} |
| 226 |
\hline |
| 227 |
列1 & 列2 & 列3 \\ \hline |
| 228 |
データA & 100 & 5.5 \\ \hline |
| 229 |
データB & 200 & 9.8 \\ \hline |
| 230 |
データC & 300 & 12.3 \\ \hline |
| 231 |
\end{tabular} |
| 232 |
}] |
| 233 |
\小問番号{6}\小問欄{9}{6}[center={% |
| 234 |
\begin{tikzpicture} |
| 235 |
\draw[->] (0, -.3) -- (0, 2.5) node[above] {$y$}; |
| 236 |
\draw[->] (-2, 0) -- (2, 0) node[right] {$x$}; |
| 237 |
\filldraw (0, 0) circle (.5pt) node[below left] {$\mathrm{O}$}; |
| 238 |
\draw[domain=-1.5:1.5, samples=100, thick] plot (\x, {\x*\x}); |
| 239 |
\end{tikzpicture} |
| 240 |
}] |
| 241 |
} |
| 242 |
\end{SourceCode} |
| 243 |
|
| 244 |
\begin{OutPut}{Output} |
| 245 |
\KKran{ |
| 246 |
\小問番号{6}\小問欄{8}{6}[center={% |
| 247 |
\begin{tabular}{|l|c|r|} |
| 248 |
\hline |
| 249 |
列1 & 列2 & 列3 \\ \hline |
| 250 |
データA & 100 & 5.5 \\ \hline |
| 251 |
データB & 200 & 9.8 \\ \hline |
| 252 |
データC & 300 & 12.3 \\ \hline |
| 253 |
\end{tabular} |
| 254 |
}] |
| 255 |
\小問番号{6}\小問欄{9}{6}[center={% |
| 256 |
\begin{tikzpicture} |
| 257 |
\draw[->] (0, -.3) -- (0, 2.5) node[above] {$y$}; |
| 258 |
\draw[->] (-2, 0) -- (2, 0) node[right] {$x$}; |
| 259 |
\filldraw (0, 0) circle (.5pt) node[below left] {$\mathrm{O}$}; |
| 260 |
\draw[domain=-1.5:1.5, samples=100, thick] plot (\x, {\x*\x}); |
| 261 |
\end{tikzpicture} |
| 262 |
}] |
| 263 |
} |
| 264 |
\end{OutPut} |
| 265 |
|
| 266 |
\subsection{模範解答入力} |
| 267 |
模範解答を入力する場合、その部分を\verb|\KaitouInput{引数}|によって入力しておくと、パッケージオプションである\texttt{kaitouhyouji}が1の時だけ表示されるようになります。ただし、この効果は\verb|\color|コマンドによる色の変更が可能な範囲に限ります。 |
| 268 |
|
| 269 |
tikzの描画も当然解答として入力可能ですが、 |
| 270 |
|
| 271 |
\begin{SourceCode}{Input}{TeX} |
| 272 |
\KKran{ |
| 273 |
\小問番号{6}\小問欄{9}{6}[center={\KaitouInput{% |
| 274 |
\begin{tikzpicture} |
| 275 |
\draw[->] (0, -.3) -- (0, 2.5) node[above] {$y$}; |
| 276 |
\draw[->] (-2, 0) -- (2, 0) node[right] {$x$}; |
| 277 |
\filldraw (0, 0) circle (.5pt) node[below left] {$\mathrm{O}$}; |
| 278 |
\draw[domain=-1.5:1.5, samples=100, thick, blue] plot (\x, {\x*\x}); % ここ! |
| 279 |
\end{tikzpicture} |
| 280 |
}}] |
| 281 |
} |
| 282 |
\end{SourceCode} |
| 283 |
|
| 284 |
\begin{OutPut}{Output} |
| 285 |
\KKran{ |
| 286 |
\小問番号{6}\小問欄{9}{6}[center={\KaitouInput{% |
| 287 |
\begin{tikzpicture} |
| 288 |
\draw[->] (0, -.3) -- (0, 2.5) node[above] {$y$}; |
| 289 |
\draw[->] (-2, 0) -- (2, 0) node[right] {$x$}; |
| 290 |
\filldraw (0, 0) circle (.5pt) node[below left] {$\mathrm{O}$}; |
| 291 |
\draw[domain=-1.5:1.5, samples=100, thick, blue] plot (\x, {\x*\x}); % ここ! |
| 292 |
\end{tikzpicture} |
| 293 |
}}] |
| 294 |
} |
| 295 |
\end{OutPut} |
| 296 |
|
| 297 |
のように明示的に色を指定した場合、そこだけは\verb|\KaitouInput|の効果範囲外となることに注意しましょう。 |
| 298 |
|
| 299 |
\section{大問ごとの組み方} |
| 300 |
大問を組むとなる場合、\verb|\大問番号|というコマンドで番号をつけ、段ごとに\verb|\小問欄|などを並べていきます。段をずらす際には\verb|\GoDown|というコマンドを使用していきます。 |
| 301 |
|
| 302 |
\begin{SourceCode}{Input}{TeX} |
| 303 |
% 構文 |
| 304 |
\大問番号[横幅]{縦幅}[番号] |
| 305 |
% デフォルト |
| 306 |
% 横幅:.5 |
| 307 |
% 番号:アラビア数字(\kakkoに入っている) |
| 308 |
|
| 309 |
\GoDown{下に降りたいマス目数} |
| 310 |
|
| 311 |
% 使用例 |
| 312 |
\KKran[3pt]{% |
| 313 |
\大問番号[1]{9} |
| 314 |
\小問番号{2}\小問欄{2}{2}\小問番号{2}\小問欄{4}{2}\GoDown{2} |
| 315 |
\小問番号{4}\小問欄{8}{4}\GoDown{4} |
| 316 |
\小問番号{3}\小問欄{3}{3}\小問番号{3}\小問欄{2}{3} |
| 317 |
}[shoumon=いろは,daimon=ア] |
| 318 |
\end{SourceCode} |
| 319 |
|
| 320 |
\begin{OutPut}{Output} |
| 321 |
\KKran[3pt]{% |
| 322 |
\大問番号[1]{9} |
| 323 |
\小問番号{2}\小問欄{2}{2}\小問番号{2}\小問欄{4}{2}\GoDown{2} |
| 324 |
\小問番号{4}\小問欄{8}{4}\GoDown{4} |
| 325 |
\小問番号{3}\小問欄{3}{3}\小問番号{3}\小問欄{2}{3} |
| 326 |
}[shoumon=いろは,daimon=ア] |
| 327 |
\end{OutPut} |
| 328 |
|
| 329 |
大問番号をある値にしたいという場合、\verb|\SetDaimon{99}|のように指定します。 |
| 330 |
|
| 331 |
\section{記述解答欄} |
| 332 |
記述問題専用の解答欄として、マス目ありのもの、なしのものの2種類の解答欄を用意しています。 |
| 333 |
|
| 334 |
注意点として、\verb|\linewidth|を上回る横幅を解答欄が占めるような組み方をしてはならないというものがあります。エラーにはなりませんが、大問と大問との間隔が余計に1行分大きくなってしまいます。 |
| 335 |
|
| 336 |
\begin{SourceCode}{Input}{TeX} |
| 337 |
% 構文 |
| 338 |
\小問マス目[文字数下限]{文字数上限}[欄内記入] |
| 339 |
\小問記述{文字数上限}[欄内記入] |
| 340 |
% デフォルト |
| 341 |
% 文字数下限:文字数上限と同じ値 |
| 342 |
% 欄内記入:空集合 |
| 343 |
|
| 344 |
% 使用例 |
| 345 |
\KKran[3pt]{% |
| 346 |
\大問番号[1]{7} |
| 347 |
\小問番号{1}\小問マス目[4]{6}\GoDown{1} |
| 348 |
\小問番号{2}\小問記述{40}\GoDown{2} |
| 349 |
\小問番号{4}\小問マス目[50]{75} |
| 350 |
} |
| 351 |
\end{SourceCode} |
| 352 |
|
| 353 |
\begin{OutPut}{Output} |
| 354 |
\KKran[3pt]{% |
| 355 |
\大問番号[1]{7} |
| 356 |
\小問番号{1}\小問マス目[4]{6}\GoDown{1} |
| 357 |
\小問番号{2}\小問記述{40}\GoDown{2} |
| 358 |
\小問番号{4}\小問マス目[50]{75} |
| 359 |
} |
| 360 |
\end{OutPut} |
| 361 |
|
| 362 |
また、ここに模範解答を入力する際は半角英数字や約物を全角1マスに適切に拡大縮小するため、必要に応じて\verb|\全角幅固定|というコマンドを使用します。 |
| 363 |
|
| 364 |
\begin{SourceCode}{Input}{TeX} |
| 365 |
% 使用例 |
| 366 |
\KKran[3pt]{% |
| 367 |
\大問番号[1]{3} |
| 368 |
\小問番号{1}\小問マス目[4]{6}[\KaitouInput{\全角幅固定{12}\全角幅固定{3}番目\全角幅固定{。}}]\GoDown{1} |
| 369 |
\小問番号{2}\小問マス目{40}[\KaitouInput{\全角幅固定{「}日本に\全角幅固定{Ma}\全角幅固定{tt}\全角幅固定{he}\全角幅固定{w\phantom{w}}=\全角幅固定{Pe}\全角幅固定{rr}\全角幅固定{y\phantom{y}}提督が来たから。\全角幅固定{」}という話であります。}] |
| 370 |
} |
| 371 |
\end{SourceCode} |
| 372 |
|
| 373 |
\begin{OutPut}{Output} |
| 374 |
\KKran[3pt]{% |
| 375 |
\大問番号[1]{3} |
| 376 |
\小問番号{1}\小問マス目[4]{6}[\KaitouInput{\全角幅固定{12}\全角幅固定{3}番目\全角幅固定{。}}]\GoDown{1} |
| 377 |
\小問番号{2}\小問マス目{40}[\KaitouInput{\全角幅固定{「}日本に\全角幅固定{Ma}\全角幅固定{tt}\全角幅固定{he}\全角幅固定{w\phantom{w}}=\全角幅固定{Pe}\全角幅固定{rr}\全角幅固定{y\phantom{y}}提督が来たから。\全角幅固定{」}という話であります。}] |
| 378 |
} |
| 379 |
\end{OutPut} |
| 380 |
|
| 381 |
\section{マークシート} |
| 382 |
マークシートの作り方は、\verb|\MarkArrayMake|でひとまず必要な配列を作成しておき、\verb|\マークシート|コマンドで配置します。この機能に関しては、横書きモードでのみ使用されることを想定していることに注意してください\footnote{縦書き環境に入っても出力が著しく乱れたりエラーになったりはしませんが、そもそもマークシートは横に楕円を並べるものであるため、縦書きの文書と併用する場合にはlltjextなどと併用し部分横書きを使うことを推奨します。}。 |
| 383 |
|
| 384 |
\begin{SourceCode}{Input}{TeX} |
| 385 |
% 構文 |
| 386 |
\MarkArrayMake{配列名}{|要素1|要素2|...|要素n|} |
| 387 |
\マークシート{配置幅}{配列格納}[正解番号] |
| 388 |
|
| 389 |
% 使用例 |
| 390 |
\MarkArrayMake{テストA}{|$\pm$|0|1|2|3|} |
| 391 |
\MarkArrayMake{テストB}{|ア|イ|ウ|エ|オ|} |
| 392 |
\KKran[3pt]{% |
| 393 |
\大問番号[1]{8} |
| 394 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストAマーク配列}[4]]\GoDown{1} |
| 395 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストAマーク配列}[1]]\GoDown{1} |
| 396 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストAマーク配列}[4]]\GoDown{1} |
| 397 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストBマーク配列}[3]]\GoDown{1} |
| 398 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストBマーク配列}[2]]\GoDown{1} |
| 399 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストBマーク配列}[3]]\GoDown{1} |
| 400 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストBマーク配列}[4]]\GoDown{1} |
| 401 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストBマーク配列}[3]]\GoDown{1} |
| 402 |
}[shoumon=一,daimon=ア] |
| 403 |
\end{SourceCode} |
| 404 |
|
| 405 |
\begin{OutPut}{Output} |
| 406 |
\MarkArrayMake{テストA}{|$\pm$|0|1|2|3|} |
| 407 |
\MarkArrayMake{テストB}{|ア|イ|ウ|エ|オ|} |
| 408 |
\KKran[3pt]{% |
| 409 |
\大問番号[1]{8} |
| 410 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストAマーク配列}[4]]\GoDown{1} |
| 411 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストAマーク配列}[1]]\GoDown{1} |
| 412 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストAマーク配列}[4]]\GoDown{1} |
| 413 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストBマーク配列}[3]]\GoDown{1} |
| 414 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストBマーク配列}[2]]\GoDown{1} |
| 415 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストBマーク配列}[3]]\GoDown{1} |
| 416 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストBマーク配列}[4]]\GoDown{1} |
| 417 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストBマーク配列}[3]]\GoDown{1} |
| 418 |
}[shoumon=一,daimon=ア] |
| 419 |
\end{OutPut} |
| 420 |
|
| 421 |
\verb|\マークシート{配置幅}{配列格納}[正解番号]|の第3引数で指定した番号を$n \in \mathbb{N}$として、作成した配列の$n$番目が黒く塗られる仕様となっており、模範解答の入力はこれで行います。\verb|kaitouhyouji=0|の時は塗られず、\verb|kaitouhyouji=1|のときにのみ黒く塗った部分が表示されます。 |
| 422 |
|
| 423 |
\section{サンプル} |
| 424 |
\begin{SourceCode}{Input}{TeX} |
| 425 |
\documentclass[paper=a4]{jlreq} |
| 426 |
|
| 427 |
\usepackage[ |
| 428 |
kaitouhyouji=1, |
| 429 |
gridmax=20, |
| 430 |
kaitoucolor=red, |
| 431 |
fontdaimonbangou=\gtfamily, |
| 432 |
styledaimonbangou=全角幅固定 |
| 433 |
]{KKran} |
| 434 |
|
| 435 |
\begin{document} |
| 436 |
\KKran{% |
| 437 |
\大問番号{9} |
| 438 |
\小問番号{2}\小問欄{2}{2}[center=\KaitouInput{ア}]\小問番号{2}\小問中欄{5}{2}[west=人物:,center=\KaitouInput{松尾},east=芭蕉]\小問欄{6}{2}[west=作品:,center=\KaitouInput{奥の細道}]\GoDown{2} |
| 439 |
\小問番号{2}\小問欄{4}{2}[center=\KaitouInput{つわもの}]\小問番号{2}\小問欄{2}{2}[center=\KaitouInput{ウ}]\小問番号{2}\小問欄{2}{2}[center=\KaitouInput{エ}] |
| 440 |
\小問番号{2}\小問欄{4}{2}[center=\KaitouInput{片雲の風}] |
| 441 |
\小問番号{2}\小問欄{5}{2}[center=\KaitouInput{春夜宴桃李園序}]\GoDown{2} |
| 442 |
\小問番号{4}\小問マス目[45]{65}[\KaitouInput{李白の著名な詩を元にした\全角幅固定{「}月日は百代の過客\全角幅固定{」}という表現を引いて旅に主題を仄めかしつつ\全角幅固定{、}滑らかにに自身の紀行文に主眼を移す役割\全角幅固定{。}}]\GoDown{4} |
| 443 |
\小問番号{1}\小問マス目{7}[\KaitouInput{道祖神の招き}] |
| 444 |
}[shoumon=a,daimon=ア] |
| 445 |
\bigskip |
| 446 |
|
| 447 |
\KKran{% |
| 448 |
\大問番号{10}\小問番号{2}\小問欄{3}{2}[center=\KaitouInput{144}]\小問番号{2}\小問欄{4}{2}[south east={$\mathrm{mm}$},center=\KaitouInput{$3.0$}, west={$x=$}]\GoDown{2} |
| 449 |
\小問番号{8}\小問欄{9}{8}[center={\KaitouInput{% |
| 450 |
\begin{tikzpicture} |
| 451 |
\draw[domain=-1.5:1.5, samples=100, thick] plot (\x, {\x*\x}); |
| 452 |
\draw[->,, black] (0, -.3) -- (0, 2.5) node[above] {$y$}; |
| 453 |
\draw[->,, black] (-2, 0) -- (2, 0) node[right] {$x$}; |
| 454 |
\filldraw[black] (0, 0) circle (.5pt) node[below left] {$\mathrm{O}$}; |
| 455 |
\end{tikzpicture}}}] |
| 456 |
}[shoumon=一,daimon=ア] |
| 457 |
\bigskip |
| 458 |
|
| 459 |
\MarkArrayMake{テストA}{|$\pm$|0|1|2|3|} |
| 460 |
\MarkArrayMake{テストB}{|ア|イ|ウ|エ|オ|} |
| 461 |
\KKran{% |
| 462 |
\大問番号{8} |
| 463 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストAマーク配列}[4]]\GoDown{1} |
| 464 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストAマーク配列}[1]]\GoDown{1} |
| 465 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストAマーク配列}[4]]\GoDown{1} |
| 466 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストBマーク配列}[3]]\GoDown{1} |
| 467 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストBマーク配列}[2]]\GoDown{1} |
| 468 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストBマーク配列}[3]]\GoDown{1} |
| 469 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストBマーク配列}[4]]\GoDown{1} |
| 470 |
\小問番号{1}\小問欄{6}{1}[center=\マークシート{5}{\テストBマーク配列}[3]]\GoDown{1} |
| 471 |
}[shoumon=ロ小,daimon=ア] |
| 472 |
|
| 473 |
\end{document} |
| 474 |
\end{SourceCode} |
| 475 |
|
| 476 |
\begin{OutPut}{Output} |
| 477 |
\begin{center} |
| 478 |
\includegraphics[width=.7\columnwidth]{kkran-sample.pdf} |
| 479 |
\end{center} |
| 480 |
\end{OutPut} |
| 481 |
|
| 482 |
\section{Version History} |
| 483 |
\begin{itemize} |
| 484 |
\item \textbf{v1.0.0 (2025/11/23)} --- Initial public release. |
| 485 |
\item \textbf{v1.1.0 (2025/12/23)} --- Changed internal behavior in order to follow KKsymbols v2.0.0 |
| 486 |
\item \textbf{v1.1.2 (2026/01/02)} --- Added license file and improved README file. In addition, the manual has been updated to reflect bug fixes introduced in luatexja version 20260107.0. |
| 487 |
\item \textbf{v1.1.4 (2026/02/15)} --- I changed the following points: |
| 488 |
\begin{itemize} |
| 489 |
\item Fixed a bug where the left border of \verb|\小問欄|, \verb|\小問中欄|, \verb|\小問マス目|, and \verb|\小問記述| produce unwanted thin line. |
| 490 |
\item Add some package options in order to set font and style of ``大問番号'' and ``小問番号''. |
| 491 |
\item Add a new command \verb|\全角幅固定| to input ``半角英数字'' to the optional argument of \verb|\小問マス目|. |
| 492 |
\item Changed some dafault values of package options. |
| 493 |
\end{itemize} |
| 494 |
\item \textbf{v1.1.5 (2026/02/17)} --- Fixed a bug where unwanted ``\KKverb|*|'' is output when \KKverb|styledaimon/shoumonbangou=全角幅固定| is specified and the optional argument of \KKverb|\KKran| is set as \KKverb|[shoumon=a]| or \KKverb|[daimon=a]|. |
| 495 |
\item \textbf{v1.1.6 (2026/02/20)} --- Improved the output of the dashed lines of \KKverb|\小問マス目|. |
| 496 |
\end{itemize} |
| 497 |
|
| 498 |
\end{document} |