0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

鉄テキの表紙を完全再現(非公式)

0
Posted at

鉄テキの表紙を再現

この記事は、鉄緑会とは全く関係のない一個人による組版技術に関する記事であることをご理解ください。

今回は、メルカリでよく見る「あの」表紙を、TeX Liveのみで完全再現します。ただし、本家はフォントがヒラギノですから、そこだけHaranoajiという誰でも使えるフォントに置き換えています。

maina5.jpg

コード

どうやって書くかですが、まずそもそも原本がどうやって描かれているかを逆変換してみる必要があります。

要件

完成品は、

  • 四隅のpaddingを固定値に
  • タイトル部分の線の高さは、フレーム左辺を1:7に内分している(ように見える)
  • タイトル部分の線の長さは、タイトルの長さに応じた変数値
  • フレームには、影付きにするための少しだけ太い折れ線が入っている
  • a5、b5両方に対応したい
    の要件を満たすものとします。

コード

これらを満たすコードを書くと以下のようになります。

\documentclass[
  paper=a5,
  fontsize=10pt
]{jlreq}

\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{KKsymbols}

\usepackage[no-math]{fontspec}
\usepackage[no-math,match,scale=1]{luatexja-fontspec}
\usepackage[haranoaji,deluxe]{luatexja-preset}
\newfontfamily\HaranoMinchoLatinWOne{HaranoAjiMincho-ExtraLight}
\newjfontfamily\HaranoMinchoJapaneseWOne{HaranoAjiMincho-ExtraLight}
\newfontfamily\HaranoMinchoLatinWTwo{HaranoAjiMincho-Light}
\newjfontfamily\HaranoMinchoJapaneseWTwo{HaranoAjiMincho-Light}
\newfontfamily\HaranoMinchoLatinWThree{HaranoAjiMincho-Regular}
\newjfontfamily\HaranoMinchoJapaneseWThree{HaranoAjiMincho-Regular}
\newfontfamily\HaranoMinchoLatinWFour{HaranoAjiMincho-Medium}
\newjfontfamily\HaranoMinchoJapaneseWFour{HaranoAjiMincho-Medium}
\newfontfamily\HaranoMinchoLatinWFive{HaranoAjiMincho-SemiBold}
\newjfontfamily\HaranoMinchoJapaneseWFive{HaranoAjiMincho-SemiBold}
\newfontfamily\HaranoMinchoLatinWSix{HaranoAjiMincho-Bold}
\newjfontfamily\HaranoMinchoJapaneseWSix{HaranoAjiMincho-Bold}
\newfontfamily\HaranoMinchoLatinWSeven{HaranoAjiMincho-Heavy}
\newjfontfamily\HaranoMinchoJapaneseWSeven{HaranoAjiMincho-Heavy}

\newfontfamily\HaranoGothicLatinWOne{HaranoAjiGothic-ExtraLight}
\newjfontfamily\HaranoGothicJapaneseWOne{HaranoAjiGothic-ExtraLight}
\newfontfamily\HaranoGothicLatinWTwo{HaranoAjiGothic-Light}
\newjfontfamily\HaranoGothicJapaneseWTwo{HaranoAjiGothic-Light}
\newfontfamily\HaranoGothicLatinWThree{HaranoAjiGothic-Normal}
\newjfontfamily\HaranoGothicJapaneseWThree{HaranoAjiGothic-Normal}
\newfontfamily\HaranoGothicLatinWFour{HaranoAjiGothic-Regular}
\newjfontfamily\HaranoGothicJapaneseWFour{HaranoAjiGothic-Regular}
\newfontfamily\HaranoGothicLatinWFive{HaranoAjiGothic-Medium}
\newjfontfamily\HaranoGothicJapaneseWFive{HaranoAjiGothic-Medium}
\newfontfamily\HaranoGothicLatinWSix{HaranoAjiGothic-Bold}
\newjfontfamily\HaranoGothicJapaneseWSix{HaranoAjiGothic-Bold}
\newfontfamily\HaranoGothicLatinWSeven{HaranoAjiGothic-Heavy}
\newjfontfamily\HaranoGothicJapaneseWSeven{HaranoAjiGothic-Heavy}

\newcommand\HaranoAjiMinchoExtraLight{\mdseries\HaranoMinchoLatinWOne\HaranoMinchoJapaneseWOne}
\newcommand\HaranoAjiMinchoLight{\mdseries\HaranoMinchoLatinWTwo\HaranoMinchoJapaneseWTwo}
\newcommand\HaranoAjiMinchoRegular{\mdseries\HaranoMinchoLatinWThree\HaranoMinchoJapaneseWThree}
\newcommand\HaranoAjiMinchoMedium{\mdseries\HaranoMinchoLatinWFour\HaranoMinchoJapaneseWFour}
\newcommand\HaranoAjiMinchoSemiBold{\mdseries\HaranoMinchoLatinWFive\HaranoMinchoJapaneseWFive}
\newcommand\HaranoAjiMinchoBold{\mdseries\HaranoMinchoLatinWSix\HaranoMinchoJapaneseWSix}
\newcommand\HaranoAjiMinchoHeavy{\mdseries\HaranoMinchoLatinWSeven\HaranoMinchoJapaneseWSeven}
\newcommand\HaranoAjiGothicExtraLight{\mdseries\HaranoGothicLatinWOne\HaranoGothicJapaneseWOne}
\newcommand\HaranoAjiGothicLight{\mdseries\HaranoGothicLatinWTwo\HaranoGothicJapaneseWTwo}
\newcommand\HaranoAjiGothicNormal{\mdseries\HaranoGothicLatinWThree\HaranoGothicJapaneseWThree}
\newcommand\HaranoAjiGothicRegular{\mdseries\HaranoGothicLatinWFour\HaranoGothicJapaneseWFour}
\newcommand\HaranoAjiGothicMedium{\mdseries\HaranoGothicLatinWFive\HaranoGothicJapaneseWFive}
\newcommand\HaranoAjiGothicBold{\mdseries\HaranoGothicLatinWSix\HaranoGothicJapaneseWSix}
\newcommand\HaranoAjiGothicHeavy{\mdseries\HaranoGothicLatinWSeven\HaranoGothicJapaneseWSeven}

\newcommand\HaranoAjiMincho[1]{\ifcase#1\or\HaranoAjiMinchoExtraLight\or\HaranoAjiMinchoLight\or\HaranoAjiMinchoRegular\or\HaranoAjiMinchoMedium\or\HaranoAjiMinchoSemiBold\or\HaranoAjiMinchoBold\or\HaranoAjiMinchoHeavy\fi}
\newcommand\HaranoAjiGothic[1]{\ifcase#1\or\HaranoAjiGothicExtraLight\or\HaranoAjiGothicLight\or\HaranoAjiGothicNormal\or\HaranoAjiGothicRegular\or\HaranoAjiGothicMedium\or\HaranoAjiGothicBold\or\HaranoAjiGothicHeavy\fi}

\setmainfont{HaranoAjiMincho-Light}[BoldFont=HaranoAjiMincho-Regular]
\setmainjfont{HaranoAjiMincho-Light}[BoldFont=HaranoAjiMincho-Regular]
\newfontfamily\standalonegothiclatin{HaranoAjiGothic-Normal}
  [BoldFont=HaranoAjiGothic-Regular]
\newjfontfamily\standalonegothicjapanese{HaranoAjiGothic-Normal}
  [BoldFont=HaranoAjiGothic-Regular]
\renewcommand\gtfamily{\standalonegothiclatin\standalonegothicjapanese}

\pagestyle{empty}

\def\titletext{\LARGE\HaranoAjiGothic{5} 和文組版確認シリーズ}
\def\subtitletext{\large\HaranoAjiGothic{3} 大学組版}
\newlength{\titlewidth}
\settowidth{\titlewidth}{\titletext}

\begin{document}
\begin{tikzpicture}[overlay, remember picture]

  % フレーム四隅
  \coordinate (frameNW) at
    ([xshift=1.5cm,yshift=-1.5cm]current page.north west);

  \coordinate (frameNE) at
    ([xshift=-1.5cm,yshift=-1.5cm]current page.north east);

  \coordinate (frameSE) at
    ([xshift=-1.5cm,yshift=1.5cm]current page.south east);

  \coordinate (frameSW) at
    ([xshift=1.5cm,yshift=1.5cm]current page.south west);

  \coordinate (P) at ($(frameNW)!1/7!(frameSW)$);

  \draw[
    draw=none,
    fill=cyan!30
  ]
    (current page.north west)
    --
    (current page.north east)
    --
    (current page.south east)
    --
    (current page.south west)
    --
    cycle;

  % 右辺・下辺の影
  % 1.5pt → 2.25pt(1.5倍)
  \draw[
    color=black,
    line width=2.25pt
  ]
  ([xshift=1.375pt,yshift=-2.25pt]frameNE)
  --
  ([xshift=1.375pt,yshift=-1.375pt]frameSE)
  --
  ([xshift=2.25pt,yshift=-1.375pt]frameSW);

  % 本体フレーム
  \draw[
    color=black,
    line width=.5pt
  ]
    (frameNW)
    --
    (frameNE)
    --
    (frameSE)
    --
    (frameSW)
    --
    cycle;

  \draw[
    color=black,
    line width=3.25pt
  ] (P) -- ([xshift=\dimexpr\titlewidth+10mm\relax]P);

  \node[
    anchor=north west
  ] at ([xshift=4mm, yshift=-2mm]P) {\titletext};

  \node[
    anchor=south west
  ] at ([xshift=4mm, yshift=2mm]P) {\subtitletext};

  \node[
    anchor=north east
  ] at ([yshift=-2mm]frameSE) {XXXX-XXXX};

  \node[
    anchor=south east
  ] at ([xshift=-4mm, yshift=4mm]frameSE) {{\large\HaranoAjiGothic{5}\zenkakuhabafixer{マネ}}{\large\HaranoAjiGothic{3}組版科}};

\end{tikzpicture}
\end{document}

解説

プリアンブル

最初のプリアンブルですが、

\documentclass[
  paper=a5,
  fontsize=10pt
]{jlreq}

これで近年のオーソドックスなjlreqクラスを指定します。
紙のサイズはa5ないしはb5です。

それ以下で、tikzパッケージなど必要なファイルを読み込み、フォント設定もします。
本来はフォント設定を別ファイルに置くものですが、今回も執筆の都合で、プリアンブルに入れています。

本文に入ります。

\pagestyle{empty}

によってノンブルなどが入らないようにします。

冒頭

タイトルなど使い回すテキストは

\def\titletext{\LARGE\HaranoAjiGothic{5} 和文組版確認シリーズ}
\def\subtitletext{\large\HaranoAjiGothic{3} 大学組版}
\newlength{\titlewidth}
\settowidth{\titlewidth}{\titletext}

で変数にしておきましょう。

tikz環境

いよいよtikzpicture環境で、実際に描画していきます。

四隅のpaddingを固定値に

を満たしたいですから、まず点をプロットします。paddingを1.5cmにします。

  % フレーム四隅
  \coordinate (frameNW) at
    ([xshift=1.5cm,yshift=-1.5cm]current page.north west);

  \coordinate (frameNE) at
    ([xshift=-1.5cm,yshift=-1.5cm]current page.north east);

  \coordinate (frameSE) at
    ([xshift=-1.5cm,yshift=1.5cm]current page.south east);

  \coordinate (frameSW) at
    ([xshift=1.5cm,yshift=1.5cm]current page.south west);

  \coordinate (P) at ($(frameNW)!1/7!(frameSW)$);

あとで何度も使い回す点は、さっさと\coordinateですぐ呼べるようにしておくのが鉄則です。

次に

  %%% 背景の塗り
  \draw[
    draw=none,
    fill=cyan!30
  ]
    (current page.north west)
    --
    (current page.north east)
    --
    (current page.south east)
    --
    (current page.south west)
    --
    cycle;

  % 右辺・下辺の影
  % 1.5pt → 2.25pt(1.5倍)
  \draw[
    color=black,
    line width=2.25pt
  ]
  ([xshift=1.375pt,yshift=-2.25pt]frameNE)
  --
  ([xshift=1.375pt,yshift=-1.375pt]frameSE)
  --
  ([xshift=2.25pt,yshift=-1.375pt]frameSW);

  % 本体フレーム
  \draw[
    color=black,
    line width=.5pt
  ]
    (frameNW)
    --
    (frameNE)
    --
    (frameSE)
    --
    (frameSW)
    --
    cycle;

  %%% タイトルの線
  \draw[
    color=black,
    line width=3.25pt
  ] (P) -- ([xshift=\dimexpr\titlewidth+10mm\relax]P);

背景の塗りをfillで、線をdrawで書きます。

影だけ注意です。
この値は適当に決めた値ではなく、太線を細枠の外側にちょうど接するように置くための値です。

TikZ の線は「パスを中心にして左右半分ずつ」太くなるので、細線と太線を重ならないように隣接させるには、それぞれの線幅の半分ずつを足した距離だけ、太線のパスを外側へずらす必要があります。

たとえば、枠線の太さを $0.5\mathrm{pt}$、影として描く太線の太さを $2.25\mathrm{pt}$ とすると、必要なずらし量は$\frac{0.5,\mathrm{pt}}{2}+\frac{2.25,\mathrm{pt}}{2}=1.375\mathrm{pt}$となります。

したがって、右辺の影は元の右辺から右方向へ 1.375pt、下辺の影は元の下辺から下方向へ 1.375pt ずらして描けば、細枠と太線がちょうど接する配置になります。

\draw[
  color=black,
  line width=2.25pt
]
  ([xshift=1.375pt,yshift=-2.25pt]frameNE)
  --
  ([xshift=1.375pt,yshift=-1.375pt]frameSE)
  --
  ([xshift=2.25pt,yshift=-1.375pt]frameSW);

あとは、\nodeで文字をおいて完成です。

宣伝

11月21日、TeXConf2026が開催されます。筆者は「リアルタイムTeXプレビュー」について約30分の登壇することとなりました!ぜひお越しください🙇

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?