[作例](https://komalang.org/ja/examples/)

ワークシート

# 単元 4・一次関数

小川学園 数学科

CSS の段組み、全段見出し、罫線入りの解答欄、関数グラフを使った、A4 で 2 ページの架空の数学ワークシートと解答解説。

```koma
===
title: 単元 4・一次関数
type: article
size: A4
lang: ja
css: |
  page {
    --koma-primary: #1b1f24;
    --koma-secondary: #c9a227;
    --koma-line: #8a929b;
    --koma-font-size: 12.5px;
    --ws-rule: #cbd2d9;
    --ws-pitch: 24px;
    --ws-paper: #ffffff;
    background: var(--ws-paper);
    color: #1b1f24;
    font-size: var(--koma-font-size);
    line-height: 1.5;
    /* The page number stands 3% above the foot of the page, the sheet ends 38px above it (THM-024). */
    padding: 34px 38px 3%;
  }
  page-footer { min-height: 4.31px; }
  box.ws-sheet {
    columns: 2;
    column-gap: 28px;
    column-rule: 1px solid var(--koma-line);
    column-fill: auto;
    row-gap: 12px;
    background:
      linear-gradient(to right, transparent calc(50% - 14px), var(--ws-paper) calc(50% - 14px) calc(50% + 14px), transparent calc(50% + 14px)),
      repeating-linear-gradient(to bottom, transparent 0 calc(var(--ws-pitch) - 1px), var(--ws-rule) calc(var(--ws-pitch) - 1px) var(--ws-pitch));
  }
  box.ws-sheet.plain {
    background: var(--ws-paper);
    column-fill: balance;
  }
  .span { column-span: all; }
  box.ws-head {
    background: var(--ws-paper);
    border-bottom: 2px solid #1b1f24;
    padding: 0 0 8px;
  }
  box.ws-head p { font-size: 0.92em; margin: 0; }
  box.ws-head h3 { font-size: 1.55em; margin: 0 0 2px; }
  col.ws-meta { align-items: flex-end; justify-content: flex-end; row-gap: 4px; }
  col.ws-meta p { text-align: right; white-space: nowrap; }
  box.ws-topic {
    background: #1b1f24;
    color: #ffffff;
    font-weight: 700;
    padding: 4px 10px;
    break-after: avoid;
  }
  box.ws-topic.span {
    box-shadow: 0 -10px 0 0 #ffffff;
  }
  box.ws-problem, box.ws-answer, box.ws-key, box.ws-note, box.ws-group, figure {
    break-inside: avoid;
    background: var(--ws-paper);
  }
  box.ws-group { row-gap: 8px; }
  box.ws-problem {
    --ws-space: 5;
    row-gap: 4px;
    border: 1.5px solid #1b1f24;
    padding: 6px 12px 10px;
    margin-block-end: calc(var(--ws-pitch) * var(--ws-space));
  }
  box.ws-problem h3, box.ws-answer h3 {
    font-size: 1em;
    margin: 0 0 4px;
    padding: 2px 0;
    border-bottom: 1px solid #1b1f24;
  }
  box.ws-problem.space-5 { --ws-space: 5; }
  box.ws-problem.space-6 { --ws-space: 6; }
  box.ws-problem.space-7 { --ws-space: 7; }
  box.ws-problem.space-8 { --ws-space: 8; }
  box.ws-problem.space-9 { --ws-space: 9; }
  box.ws-problem.space-10 { --ws-space: 10; }
  box.ws-answer {
    border: 1px solid #1b1f24;
    row-gap: 4px;
    padding: 6px 10px 8px;
    margin-block-end: 10px;
  }
  box.ws-step {
    border-left: 4px solid #1b1f24;
    background: #f1f3f5;
    padding: 2px 8px;
  }
  box.ws-key {
    border: 1.5px solid var(--koma-secondary);
    background: #fff8dc;
    padding: 8px 10px;
    margin-block-end: 12px;
  }
  box.ws-key h3 { font-size: 1em; color: #6b5200; margin: 0 0 4px; }
  box.ws-note {
    border-top: 1px dashed #6b737c;
    color: #3d4550;
    font-size: 0.92em;
    padding: 6px 0 0;
  }
  figure {
    font-size: 0.9em;
    background: var(--ws-paper);
    border: 1px solid #d0d7de;
    padding: 8px 10px 6px;
    margin-block-end: 10px;
  }
  th, td { padding: 0.25em 0.55em; }
  .blank {
    display: inline-block;
    min-width: 7.5em;
    border-bottom: 1px solid #1b1f24;
    margin-left: 6px;
    color: transparent;
  }
  .score-blank {
    display: inline-block;
    min-width: 6.5em;
    border-bottom: 1px solid #1b1f24;
    margin-left: 6px;
    text-align: right;
    color: #57606a;
    font-size: 0.92em;
  }
===

[box .ws-sheet:
  [box .ws-head .span:
    [col weight=3:
      # 単元 4・一次関数

      ワークシート A・練習・30 分
    ]
    [col .ws-meta weight=2:
      名前 [\_\_\_\_\_\_]{.blank}

      得点 [／ 30 点]{.score-blank}
    ]
  ]
  [box .ws-topic .span: トピック 1・傾き・切片と交点]
  [box .ws-key:
    # ポイント

    一次関数は $y = ax + b$ と表せます。傾き $a$ は $x$ が 1 増えたときの $y$ の増え方、切片 $b$ は $x = 0$ のときの $y$ の値です。

    2 点を通るとき：$a = \dfrac{y_2 - y_1}{x_2 - x_1}$。
  ]
  [box .ws-problem .space-9:
    # 問題 1・直線を読む

    直線が $(0, -1)$ と $(2, 3)$ を通ります。
    [box .ws-step: (1) 傾きを求めなさい。]
    [box .ws-step: (2) 直線の式を書きなさい。]
  ]
  [box .ws-problem .space-10:
    # 問題 2・2 点を通る直線

    直線が $(1, 4)$ と $(3, 2)$ を通ります。
    [box .ws-step: (1) 傾きを求めなさい。]
    [box .ws-step: (2) 直線の式を書きなさい。]
    [box .ws-step:
      (3) $x$ 軸と交わる点はどこですか。
    ]
  ]
  [box .ws-problem .space-7:
    # 問題 3・2 直線の交点

    $y = 2x - 1$ と $y = -x + 5$ が交わる点を求め、両方の式に代入して確かめなさい。
  ]
  [box .ws-problem .space-6:
    # 問題 4・表から読む

    | $x$ | 0 | 1 | 2 | 3 |
    | --- | --- | --- | --- | --- |
    | $y$ | 7 | 4 | 1 |   |

    [box .ws-step:
      (1) $y$ が同じ量ずつ変わることを示しなさい。
    ]
    [box .ws-step:
      (2) $y$ を $x$ の式で表し、空欄を埋めなさい。
    ]
  ]
  [box .ws-problem .space-6:
    # 問題 5・水が減る水槽

    水槽に 40 L の水が入っていて、1 分ごとに 2.5 L 減ります。
    [box .ws-step:
      (1) $t$ 分後の水の量 $V$ を式で表しなさい。
    ]
    [box .ws-step: (2) 何分後に空になりますか。]
  ]
]

+++

[box .ws-sheet .plain:
  [box .ws-head .span:
    [col weight=3:
      # 解答と解説

      単元 4・ワークシート A・一次関数
    ]
    [col .ws-meta weight=2:
      配点：各問 6 点（計 30 点）
    ]
  ]
  [box .ws-topic .span: 解答・問題 1〜5]
  [box .ws-answer:
    # 問題 1

    (1) $a = \dfrac{3 - (-1)}{2 - 0} = \dfrac{4}{2} = 2$

    (2) $(0, -1)$ を通るので切片は $b = -1$、よって $y = 2x - 1$。
  ]
  [box .ws-answer:
    # 問題 2

    (1) $a = \dfrac{2 - 4}{3 - 1} = \dfrac{-2}{2} = -1$

    (2) $(1, 4)$ を代入すると $4 = -1 \cdot 1 + b$ より $b = 5$、よって $y = -x + 5$。

    (3) $y = 0$ とおくと $-x + 5 = 0$ より $x = 5$、点 $(5, 0)$。
  ]
  [box .ws-answer:
    # 問題 3

    右辺どうしを等しいとおくと $2x - 1 = -x + 5$、$3x = 6$ より $x = 2$。このとき $y = 2 \cdot 2 - 1 = 3$。

    もう一方の式でも $-2 + 5 = 3$ となり一致。交点は $(2, 3)$ です。
  ]
  [figure:
    [chart h=235px f="2*x - 1; -x + 5" labels=("y = 2x − 1", "y = −x + 5") domain=(-1, 5) range=(-3, 9) x-title="$x$" y-title="$y$":]
    問題 1 と問題 2 の直線は $(2, 3)$ で交わり、問題 2 の直線は $(5, 0)$ で $x$ 軸と交わります。
  ]
  [box .ws-answer:
    # 問題 4

    (1) $x$ が 1 増えるごとに $y$ は 3 ずつ減ります（$7 \to 4 \to 1$）。変化の割合は一定で $-3$ です。

    (2) $x = 0$ のとき $y = 7$ なので $y = -3x + 7$。$x = 3$ のとき $y = -3 \cdot 3 + 7 = -2$。
  ]
  [box .ws-answer:
    # 問題 5

    (1) 40 L から 1 分ごとに 2.5 L 減るので $V = 40 - 2.5t$（$0 \le t \le 16$）。

    (2) $V = 0$ とおくと $40 - 2.5t = 0$ より $t = \dfrac{40}{2.5} = 16$。16 分後に空になります。
  ]
  [box .ws-group:
    [box .ws-topic: まとめと検算のコツ]
    [box .ws-key:
      # 直線の式の 3 つの書き方

      | わかっていること | 式 |
      | --- | --- |
      | 傾き $a$、切片 $b$ | $y = ax + b$ |
      | 傾き $a$、点 $(x_1, y_1)$ | $y - y_1 = a(x - x_1)$ |
      | 2 点 | まず $a = \dfrac{y_2 - y_1}{x_2 - x_1}$ |
    ]
    [box .ws-note:
      **検算のポイント：** 元の 2 点を求めた式に代入して成り立つか確かめましょう。傾き 0 は水平な直線、傾きが等しい 2 直線は平行で交わりません。
    ]
  ]
]
```

> Page 1: ワークシート 1 ページ目：単元 4 一次関数。罫線入り 2 段組みにポイントと 5 つの問題
>
> Page 2: ワークシート 2 ページ目：解答と解説。2 段組みに途中計算、交点のグラフ、まとめ表
