-
文書ファイル shiftjis.tex をUTF-8からShift_JISに変換する
-
入力・内部の漢字コードがsjisのplatexでコンパイルする
platex -kanji=sjis -kanji-internal=sjis shiftjis
↑ここで -kanji-internal
を使うのもアレだけど、元々バッドなので……。
% bxoldfontcmd.sty | |
%% package declaration | |
\NeedsTeXFormat{LaTeX2e} | |
\ProvidesPackage{bxoldfontcmd} | |
\def\bxof@pkgname{bxoldfontcmd} | |
%% code guards | |
\@onlypreamble\bxof@restore@codes | |
\edef\bxof@restore@codes{% | |
\catcode33=\the\catcode33% |
A-OTF A1 Mincho Std Bold A1MinchoStd-Bold /Library/Fonts/A-OTF-A1MinchoStd-Bold.otf | |
A-OTF Akashi Std L AkashiStd-Light /Library/Fonts/A-OTF-AkashiStd-Light.otf | |
A-OTF Antique Std AN1 AntiqueStd-AN1 /Library/Fonts/A-OTF-AntiqueStd-AN1.otf | |
A-OTF Antique Std AN2 AntiqueStd-AN2 /Library/Fonts/A-OTF-AntiqueStd-AN2.otf | |
A-OTF Antique Std AN3 AntiqueStd-AN3 /Library/Fonts/A-OTF-AntiqueStd-AN3.otf | |
A-OTF Antique Std AN4 AntiqueStd-AN4 /Library/Fonts/A-OTF-AntiqueStd-AN4.otf | |
A-OTF Antique Std AN B AntiqueStd-ANB /Library/Fonts/A-OTF-AntiqueStd-ANB.otf | |
A-OTF Antique Std AN DB AntiqueStd-ANDB /Library/Fonts/A-OTF-AntiqueStd-ANDB.otf | |
A-OTF Antique Std AN H AntiqueStd-ANH /Library/Fonts/A-OTF-AntiqueStd-ANH.otf | |
A-OTF Antique Std AN L AntiqueStd-ANL /Library/Fonts/A-OTF-AntiqueStd-ANL.otf |
-- 文字コードはCP932 | |
function basename(path) | |
if type(path) ~= "string" or not lfs.isfile(path) then | |
return path -- 引数が不適切 | |
end | |
local k, cs = 0, path:gsub("/", "\\"):explode("\\") | |
for i = 1, #cs - 1 do | |
local d = table.concat({ table.unpack(cs, 1, i) }, "\\") | |
if lfs.isdir(d) then k = i end |
-- 文字コードはCP932 | |
function slashify(str) | |
return (tostring(str):gsub("[\x81-\x9f\xe0-\xfc]?.", { ["\\"] = "/" })) | |
end | |
print(slashify([[ふが\ほげ/予定表\アレ/コレ\ソレ]])) | |
-- ふが/ほげ/予定表/アレ/コレ/ソレ |
\documentclass{tarticle} | |
\usepackage[word]{continue}% これは atbegshi 依存 | |
\usepackage{etoolbox} | |
\makeatletter | |
\patchcmd{\AtBegShi@Output}% | |
{\let\AtBegShi@OrgProtect\protect}% | |
{\setbox\z@\hbox\bgroup\yoko\let\AtBegShi@OrgProtect\protect}% | |
{}{} |
% fixjfm.sty | |
% Copyright 2017 Yue ZHANG | |
% License: Knuth License (https://ctan.org/license/knuth) | |
\csname ENDINPUTFIXJFMDOTSTY\endcsname | |
\let\ENDINPUTFIXJFMDOTSTY=\endinput |
#!/usr/bin/env texlua | |
-- | |
-- This is file 'sctexdoc.lua'. | |
-- | |
-- Copyright 2017-2020 Takuto ASAKURA (wtsnjp) | |
-- GitHub: https://github.com/wtsnjp | |
-- Twitter: @wtsnjp | |
-- | |
-- This package is distributed under the MIT License. |
% upLaTeX文書; 文字コードはUTF-8 | |
\documentclass[uplatex,a5paper]{utarticle} | |
\usepackage[utf8]{inputenc} | |
\usepackage[T1]{fontenc} | |
\usepackage{lmodern} | |
\usepackage{otf}% <?>で自動空白挿入 | |
\usepackage[prefercjkvar]{pxcjkcat} | |
\usepackage{zrjapunct1} | |
\cjkcategory{latn1}{noncjk}% <é>は欧文 | |
\begin{document} |
文書ファイル shiftjis.tex をUTF-8からShift_JISに変換する
入力・内部の漢字コードがsjisのplatexでコンパイルする
platex -kanji=sjis -kanji-internal=sjis shiftjis
↑ここで -kanji-internal
を使うのもアレだけど、元々バッドなので……。
% LaTeX + dvips | |
\documentclass[a4paper]{article} | |
\textwidth=250bp \oddsidemargin=-1in \evensidemargin=-1in | |
\textheight=250bp \topmargin=-1in \headheight=0pt \headsep=0pt | |
\AtBeginDvi{% | |
\special{papersize=250bp 250bp}% | |
\special{ps:SDict begin | |
[ /CropBox [0 0 200 200] /PAGE pdfmark | |
[ /BleedBox [0 0 150 150] /PAGE pdfmark | |
[ /TrimBox [0 0 100 100] /PAGE pdfmark |