-
-
Save tadd/72fd6cd1efa41ea5b4e38a1cce9c7ad5 to your computer and use it in GitHub Desktop.
ipsj.cls を upLaTeX 用にしてみる(源ノ明朝・源ノ角ゴシックを使う)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Modified by Tadashi Saito (@tadd), 2022 | |
| # https://gist.github.com/tadd/72fd6cd1efa41ea5b4e38a1cce9c7ad5 | |
| # | |
| # ipsj.cls を upLaTeX 用にしてみる(源ノ明朝・源ノ角ゴシックを使う) | |
| # https://gist.github.com/trueroad/c44312923bf02226c2274388941d0453 | |
| # | |
| # ipsj.cls は pLaTeX 専用のようなのですが、 | |
| # 試しに upLaTeX で使えるようにした up-ipsj.cls を作ってみました。 | |
| # upLaTeX なので pLaTeX では難しかった源ノ明朝・源ノ角ゴシックの利用が | |
| # できるようになります。 | |
| # | |
| # 無保証です。これを使った結果何が起きても責任は取りません。 | |
| # | |
| # 源ノ明朝・源ノ角ゴシックを使うのであれば、 | |
| # dvipdfmx から見える状態にしておく必要があります。 | |
| # 以下が参考になるかもしれません。 | |
| # https://gist.github.com/trueroad/51c0d3b5bbf3ad1fe25352858e4e2cff | |
| # | |
| # ipsj_v4.zip (2018 年 11 月 6 日版)を解凍して UTF8 ディレクトリの下にある | |
| # ipsj.cls | |
| # ipsjtech.sty | |
| # jsample.tex | |
| # tech-jsample.tex | |
| # の 4 ファイルを、この Makefile と同じディレクトリに配置してください。 | |
| # その上で `make` を実行すると、 upLaTeX 対応の | |
| # up-ipsj.cls | |
| # up-jsample.tex | |
| # up-tech-jsample.tex | |
| # ができます。 | |
| # この際、dviware に dvipdfmx を指定するように変更しています。 | |
| # | |
| # さらに、源ノ明朝・源ノ角ゴシック otf 版が upTeX から見える状態であれば、 | |
| # `make pdf` を実行することで upLaTeX と dvipdfmx を使って | |
| # up-jsample.pdf | |
| # up-tech-jsample.pdf | |
| # | |
| # Copyright (C) 2019 Masamichi Hosoda. | |
| # All rights reserved. | |
| # | |
| # License: BSD-2-Clause | |
| # | |
| all: up-ipsj.cls up-jsample.tex up-tech-jsample.tex | |
| .PHONY: all pdf clean | |
| # | |
| # コマンド関連 | |
| # | |
| SED = sed | |
| RM = rm | |
| RM_F = $(RM) -f | |
| # | |
| # upLaTeX 用クラスファイル | |
| # | |
| # | |
| # ipsj.cls は pLaTex 専用で upLaTeX には対応していない模様。 | |
| # そこで、何か所か書き換えて upLaTeX で使える up-ipsj.cls を作ります。 | |
| # メトリックは upTeX デフォルトのものではなく、互換のものを使用することとし、 | |
| # pLaTeX での組版結果とほぼ同じになることを目指します。 | |
| # | |
| # 変更点: | |
| # クラス名 | |
| # ipsj → up-ipsj | |
| # エンコーディング名 | |
| # JY1 → JY2 (和文横書き用) | |
| # JT1 → JT2 (和文縦書き用) | |
| # TFM 名 | |
| # 標準の明朝体・ゴシック体フォント | |
| # jis, jisg (pTeX 用 jis メトリック、pTeX 同梱) | |
| # ↓ | |
| # upjisr-h, upjisg-h (upTeX 用 jis 互換メトリック?、 | |
| # TeXLive uptex-fontsパッケージに同梱) | |
| # 縦書き用 | |
| # tmin10 (pTeX 用縦書き、pTeX 同梱) | |
| # ↓ | |
| # utmin10 (upTeX 用、なぜか upTeX 同梱?) | |
| # | |
| up-ipsj.cls: ipsj.cls | |
| $(SED) -e '/^\\ProvidesClass/s/{ipsj}/{up-ipsj}/' \ | |
| -e 's/JY1/JY2/g' \ | |
| -e 's/{JT1}/{JT2}/g' \ | |
| -e 's/jisg/upjisg-h/g' \ | |
| -e 's/\([ >]\)jis/\1upjisr-h/g' \ | |
| -e 's/tmin10/utmin10/g ' \ | |
| $< > $@ | |
| # | |
| # 論文誌用サンプル | |
| # | |
| up-jsample.tex: jsample.tex | |
| $(SED) -e '/^%*\\documentclass/s/{ipsj}/{up-ipsj}/' \ | |
| -e '/^\\usepackage/s/\({graphicx}\)/\[dvipdfmx\]\1/' \ | |
| $< > $@ | |
| # | |
| # 研究報告用サンプル | |
| # | |
| up-tech-jsample.tex: tech-jsample.tex | |
| $(SED) -e '/^%*\\documentclass/s/{ipsj}/{up-ipsj}/' \ | |
| -e '/^\\usepackage/s/dvips/dvipdfmx/' \ | |
| $< > $@ | |
| # | |
| # 論文誌用サンプル依存関係 | |
| # | |
| up-jsample.dvi: up-jsample.tex up-ipsj.cls | |
| # | |
| # 研究報告用サンプル依存関係 | |
| # | |
| up-tech-jsample.dvi: up-tech-jsample.tex up-ipsj.cls ipsjtech.sty | |
| # | |
| # pdf 生成 | |
| # | |
| up-%.dvi: up-%.tex | |
| uplatex $< | |
| uplatex $< | |
| up-%.pdf: up-%.dvi | |
| dvipdfmx $< | |
| pdf: up-jsample.pdf up-tech-jsample.pdf | |
| clean: | |
| $(RM_F) *~ *.log *.aux *.dvi *.fls *.fdb_latexmk | |
| distclean: clean | |
| $(RM_F) *.pdf up-ipsj.cls up-*.dvi up-*.tex |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
2025-11現在のTeXLive 2025とipsj.cls v4.1で動作確認済み.