-
-
Save jj1bdx/099ab64490002a6e8ded5ed372c7fef8 to your computer and use it in GitHub Desktop.
ipsj.cls を upLaTeX 用にしてみる(源ノ明朝・源ノ角ゴシックを使う)
This file contains 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
# | |
# ipsj.cls を upLaTeX 用にしてみる(源ノ明朝・源ノ角ゴシックを使う) | |
# https://gist.github.com/trueroad/c44312923bf02226c2274388941d0453 | |
# | |
# ipsj.cls は pLaTeX 専用のようなのですが、 | |
# 試しに upLaTeX で使えるようにした up-ipsj.cls を作ってみました。 | |
# upLaTeX なので pLaTeX では難しかった源ノ明朝・源ノ角ゴシックの利用が | |
# できるようになります。 | |
# | |
# 無保証です。これを使った結果何が起きても責任は取りません。 | |
# | |
# あらかじめ「upTeX 用 jis 互換メトリックセット」と | |
# 「upTeX 用 morisawa パッケージ互換 tfm, vf セット」を | |
# インストールしておいてください。以下が参考になるでしょう。 | |
# https://gist.github.com/trueroad/50db8b8c8152e151dc85aedbc84be173 | |
# https://gist.github.com/trueroad/f71db83ff0781e677af674172f609266 | |
# | |
# 源ノ明朝・源ノ角ゴシックを使うのであれば、 | |
# 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 | |
# ができます。 | |
# この際、 submit オプションを落とし、 | |
# dviware に dvipdfmx を指定するように変更しています。 | |
# | |
# さらに、源ノ明朝・源ノ角ゴシック otf 版が upTeX から見える状態であれば、 | |
# `make pdf` を実行することで upLaTeX と dvipdfmx を使って | |
# up-jsample.pdf | |
# up-tech-jsample.pdf | |
# ができます。 | |
# この際、マップファイルには up-ipsj-sourcehan.map を使います。 | |
# 使用するフォントは up-ipsj-sourcehan.map を参照してください。 | |
# | |
# 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 同梱) | |
# ↓ | |
# ujis, ujisg (upTeX 用 jis 互換メトリック、要インストール) | |
# 太字の明朝体・ゴシック体フォント | |
# FutoMinA101-Bold-J.tfm, FutoGoB101-Bold-J.tfm | |
# (morisawa パッケージの一部、jis メトリックの太ミンと太ゴ) | |
# ↓ | |
# u-FutoMinA101-Bold-J, u-FutoGoB101-Bold-J | |
# (upTeX 用 morisawa パッケージ互換 tfm, vf セットの一部) | |
# 縦書き用 | |
# tmin10 (pTeX 用縦書き、pTeX 同梱) | |
# ↓ | |
# utmin10 (upTeX 用、なぜか upTeX 同梱?) | |
# | |
up-ipsj.cls: ipsj.cls | |
$(SED) -e 's/^\\ProvidesClass{ipsj}/\\ProvidesClass{up-ipsj}/g' \ | |
-e 's/{JY1}/{JY2}/g' \ | |
-e 's/ JY1\// JY2\//g' \ | |
-e 's/{JT1}/{JT2}/g' \ | |
-e 's/jisg/ujisg/g' \ | |
-e 's/\([ >]\)jis/\1ujis/g' \ | |
-e 's/FutoGoB101-Bold-J\.tfm/u-FutoGoB101-Bold-J/g' \ | |
-e 's/FutoMinA101-Bold-J\.tfm/u-FutoMinA101-Bold-J/g' \ | |
-e 's/tmin10/utmin10/g ' \ | |
$< > $@ | |
# | |
# 論文誌用サンプル | |
# | |
up-jsample.tex: jsample.tex | |
$(SED) -e 's/^\\documentclass\[submit\]{ipsj}/%\\documentclass\[submit\]{up-ipsj}/' \ | |
-e 's/^%\\documentclass{ipsj}/\\documentclass{up-ipsj}/' \ | |
-e 's/^\\usepackage{graphicx}/\\usepackage\[dvipdfmx\]{graphicx}/' \ | |
$< > $@ | |
# | |
# 研究報告用サンプル | |
# | |
up-tech-jsample.tex: tech-jsample.tex | |
$(SED) -e 's/^%\\documentclass\[submit,techrep\]{ipsj}/%\\documentclass\[submit,techrep\]{up-ipsj}\r\n%\\documentclass\[techrep\]{up-ipsj}/' \ | |
-e 's/^\\documentclass\[submit,techrep,noauthor\]{ipsj}/%\\documentclass\[submit,techrep,noauthor\]{up-ipsj}\r\n\\documentclass\[techrep,noauthor\]{up-ipsj}/' \ | |
-e 's/^\\usepackage\[dvips\]{graphicx}/\\usepackage\[dvipdfmx\]{graphicx}/' \ | |
$< > $@ | |
# | |
# 論文誌用サンプル依存関係 | |
# | |
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 -f up-ipsj-sourcehan.map $< | |
pdf: up-jsample.pdf up-tech-jsample.pdf | |
clean: | |
$(RM_F) *~ *.log *.aux *.dvi |
This file contains 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
% | |
% ipsj.cls を upLaTeX 用にする(源ノ明朝・源ノ角ゴシックを使う) | |
% https://gist.github.com/trueroad/c44312923bf02226c2274388941d0453 | |
% | |
% map ファイルのサンプル(源ノ明朝・源ノ角ゴシック otf 版を使う) | |
% | |
% このマップファイルでは | |
% Ryumin-Light, GothicBBB-Medium, FutoMinA101-Bold, FutoGoB101-Bold | |
% と見た目のウェイトが同じになる源ノ明朝・源ノ角ゴシックを選びました。 | |
% 詳細は Makefile をご覧ください。 | |
% | |
% Copyright (C) 2019 Masamichi Hosoda. | |
% All rights reserved. | |
% | |
% License: BSD-2-Clause | |
% | |
urml unicode SourceHanSerif-Light.otf -l jp90 | |
ugbm unicode SourceHanSans-Regular.otf -l jp90 | |
u-futomin-b unicode SourceHanSerif-Regular.otf -l jp90 | |
u-futogo-b unicode SourceHanSans-Medium.otf -l jp90 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment