Skip to content

Instantly share code, notes, and snippets.

@zr-tex8r
Last active July 13, 2025 09:12
Show Gist options
  • Save zr-tex8r/dea486d59aeba14fa59a8ab4d748d25e to your computer and use it in GitHub Desktop.
Save zr-tex8r/dea486d59aeba14fa59a8ab4d748d25e to your computer and use it in GitHub Desktop.
LaTeX:数式中でフェニキア文字を出力する

tcmathphnx パッケージ

LaTeX: 数式中でフェニキア文字を出力する

前提環境

  • フォーマット: LaTeX
  • エンジン/DVIウェア: 不問
  • 依存パッケージ:
    • archaicパッケージ
      ※このパッケージが収録するフェニキア文字フォントを使用している。

インストール

  • *.sty → $TEXMF/tex/latex/tcmathphnx/

ライセンス

MITライセンスの下で配布される。

tcmathphnx パッケージ ー 本体

パッケージ読込

\usepackage{tcmathphnx}

機能

数式中において\phnx~という命令でフェニキア文字を入力できる。 の部分は当該の文字の名称(alephbeth、…)を入れる。
※文字名称はphoenicianパッケージで使用しているものに合わせている。 vafvavはvavの異なる字形を表す。

具体的な命令名は以下の通り。

  • \phnxaleph
  • \phnxbeth
  • \phnxgimel
  • \phnxdaleth
  • \phnxhe
  • \phnxvaf
  • \phnxzayin
  • \phnxheth
  • \phnxteth
  • \phnxyod
  • \phnxkaph
  • \phnxlamed
  • \phnxmem
  • \phnxnun
  • \phnxsamekh
  • \phnxayin
  • \phnxpe
  • \phnxsade
  • \phnxqoph
  • \phnxresh
  • \phnxshin
  • \phnxtav
  • \phnxvav

この他に、\phnxAleph\phnxBethのように 「文字名の部分を大文字始まりにした名前の命令」があり、 これは「左横書き時の字形」を出力する。

更新履歴

  • Version 0.2 〈2025/07/13〉
    • 最初の公開版。

Takayuki YATO (aka. "ZR")
https://github.com/zr-tex8r

\documentclass{article}
\usepackage{amsmath}
\usepackage{tcmathphnx}
\begin{document}
\begin{gather*}
\int_0^1 6\phnxhe^2 + 8\phnxhe + 3\,d\phnxhe
= \Bigl[ 2\phnxhe^3 + 4\phnxhe^2 + 3\phnxhe \Bigr]_0^1
= 9
\\
\begin{pmatrix}
\phnxaleph & 0 \\ 0 & \phnxbeth
\end{pmatrix}^\phnxnun
= \begin{pmatrix}
\phnxaleph^\phnxnun & 0 \\ 0 & \phnxbeth^\phnxnun
\end{pmatrix}
\\
\bigotimes_{\phnxayin=1}^{\phnxzayin} \phnxteth_\phnxayin
= \phnxteth_1 \otimes \phnxteth_2 \otimes \cdots
\otimes \phnxteth_\phnxzayin
\end{gather*}
\end{document}
%%
%% This is file 'tcmathphnx.sty'.
%%
%% Copyright (c) 2025 Takayuki YATO (aka. "ZR")
%% GitHub: https://github.com/zr-tex8r
%% Twitter: @zr_tex8r
%%
%% This package is distributed under the MIT License.
%%
%% package declaration
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{tcmathphnx}[2025/07/13 v0.2]
\def\tczpx@pkgname{tcmathphnx}
%--------------------------------------- math font declaration
\def\tczpx@pfx{phnx}
\def\tczpx@msname{tczpx}
\DeclareSymbolFont{\tczpx@msname}{OT1}{phnc}{m}{n}
%--------------------------------------- command definitions
%% \tczpx@do
\@onlypreamble\tczpx@do
\def\tczpx@do#1#2#3{%
\tczpx@do@a#3:{#1}{#2}%
}
\@onlypreamble\tczpx@do@a
\def\tczpx@do@a#1#2:{%
\uppercase{\expandafter\tczpx@do@b\csname\tczpx@pfx#1}%
#2\expandafter\endcsname
\csname \tczpx@pfx#1#2\endcsname
}
\@onlypreamble\tczpx@do@b
\def\tczpx@do@b#1#2#3#4{%
\DeclareMathSymbol{#2}{\mathord}{\tczpx@msname}{`#3}%
\DeclareMathSymbol{#1}{\mathord}{\tczpx@msname}{`#4}%
}
%% all letters
\tczpx@do{A}{a}{aleph}
\tczpx@do{B}{b}{beth}
\tczpx@do{G}{g}{gimel}
\tczpx@do{d}{d}{daleth}
\tczpx@do{e}{h}{he}
\tczpx@do{F}{f}{vaf}
\tczpx@do{z}{z}{zayin}
\tczpx@do{E}{H}{heth}
\tczpx@do{T}{T}{teth}
\tczpx@do{Y}{y}{yod}
\tczpx@do{K}{k}{kaph}
\tczpx@do{L}{l}{lamed}
\tczpx@do{M}{m}{mem}
\tczpx@do{N}{n}{nun}
\tczpx@do{s}{s}{samekh}
\tczpx@do{o}{o}{ayin}
\tczpx@do{P}{p}{pe}
\tczpx@do{X}{x}{sade}
\tczpx@do{q}{q}{qoph}
\tczpx@do{R}{r}{resh}
\tczpx@do{S}{S}{shin}
\tczpx@do{t}{t}{tav}
\tczpx@do{w}{w}{vav}
%--------------------------------------- all done
\endinput
%% EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment