Skip to content

Instantly share code, notes, and snippets.

View munepi's full-sized avatar

Munehiro Yamamoto munepi

View GitHub Profile
@munepi
munepi / test-ltx-crop-jisb5-a4.tex
Created April 30, 2016 13:33
On adding crop marks with existing PDF files - JIS B5のPDFファイルにトンボをつけてA4のPDFファイルを生成する方法について
%#!pdflatex
\documentclass[pdftex,% b5paper%<- ISO B5
]{article}
\setlength{\paperwidth}{182mm}\setlength{\paperheight}{257mm}%<- JIS B5
\usepackage[cam,a4,center]{crop}
\usepackage{pdfpages}
\pagestyle{empty}
\begin{document}
\includepdf[pages=-,noautoscale]{foo-jisb5.pdf}
\end{document}
@munepi
munepi / tlpdbinfo.sh
Last active May 11, 2016 13:58
tlpdbinfo reports information about given TeX Live Package Database (texlive.tlpdb) to standard output.
#!/bin/bash
# tlpdbinfo
#
# Copyright 2016 Munehiro Yamamoto <munepi@vinelinux.org>
# This file is licensed under the GNU General Public License version 2
# or any later version.
Usage(){
cat<<EOF
$(basename $0) 2016-1
@munepi
munepi / texqa-d1971.tex
Last active July 8, 2016 04:46
dvipdfmx.def 2016/07/02 v4.10でjsclass, jsclassesのトンボがズレる件のad-hoc対応案
% #!/opt/texlive/2015/bin/x86_64-darwin/uplatex texqa-d1971 && dvipdfmx texqa-d1971
\documentclass[uplatex,tombo,dvipdfmx,a5paper,papersize]{jsbook}
\makeatletter
\newlength{\stockheight}
\newlength{\stockwidth}
\@ifundefined{ifGin@setpagesize}{}{%
\iftombow
\stockheight\@@paperheight \stockwidth\@@paperwidth
\fi}
\makeatother
@munepi
munepi / mod_ursfs.tex
Created July 18, 2016 08:02
Modified ursfs.fd 1998/03/24 rsfs font definition file (jk)
%% modified ursfs.fd 1998/03/24 rsfs font definition file (jk)
\DeclareFontFamily{U}{rsfs}{\skewchar\font127 }
\DeclareFontShape{U}{rsfs}{m}{n}{%
<5> <6> rsfs5
<7> rsfs7
<8> <9> <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88> rsfs10
<-> rsfs10
}{}
@munepi
munepi / list-cid-otf-moripass.txt
Created September 27, 2016 09:34
モリサワパスポート2016に含まれる{A,AP,G}-OTF*.otfに対する family name, CIDFont name, full path のリスト
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
@munepi
munepi / pdf2pdfx1a.applescript
Last active December 4, 2024 17:20
A command line interface that can convert PDF to PDF/X-1a via Adobe PostScript with Adobe Acrobat X Pro
#!/usr/bin/osascript
-- This apple script is a command line interface
-- that can convert PDF to PDF/X-1a via Adobe PostScript with Adobe Acrobat X Pro.
on run argv
if (count of argv) < 1 then
do shell script "echo " & "\"pdf2pdfx1a.applescript path/to/input.pdf\""
else
set p to item 1 of argv
set pcurrentFile to do shell script "[[ \"" & p & "\" = /* ]] && echo \"" & p & "\" || echo \"$PWD/\"" & p & "\"\""
@munepi
munepi / pdf2pdfx1a.sh
Created February 24, 2017 05:45
a command line interface that can convert PDF to PDF/X-1a via Adobe PostScript with Adobe Acrobat X Pro
#!/bin/bash
set -e
showHelp(){
echo usage: $(basename $0) path/to/input.pdf
return 0
}
if [ $# -ne 1 ]; then
@munepi
munepi / Build-Llanfairapp.sh
Created June 14, 2017 02:23
A script to build Llanfair.app http://jenmaarai.com/llanfair/en/ for Mac OS X
#!/bin/bash -x
set -e
APPNAME=Llanfair
rm -rf ${APPNAME}.app
osacompile -o ${APPNAME}.app <<__APPLESCRIPT__
try
@munepi
munepi / UniSourceHanSansCN-UTF16-H
Last active August 19, 2017 14:26
Unofficial CMap files for Source Han Sans/Serif JP (UTF16-V): needing Adobe's original CMap files UniSourceHan{Sans,Serif}JP-UTF16-H; We automatically generated UniSourceHan{Sans,Serif}{CN,KR,TW}-UTF16-V from features.{CN,KR,TW}. We will modify these CMap files sometimes soon.
%!PS-Adobe-3.0 Resource-CMap
%%DocumentNeededResources: ProcSet (CIDInit)
%%IncludeResource: ProcSet (CIDInit)
%%BeginResource: CMap (UniSourceHanSansCN-UTF16-H)
%%Title: (UniSourceHanSansCN-UTF16-H Adobe Identity 0)
%%Version: 1.002
%%Copyright: -----------------------------------------------------------
%%Copyright: Copyright 1990-2015 Adobe Systems Incorporated
%%Copyright:
%%Copyright: Licensed under the Apache License, Version 2.0 (the
@munepi
munepi / docker-machine.bash-completion-line86.patch
Created August 23, 2017 03:20
ad-hoc patch for docker-machine.bash-completion
diff -u /Applications/Docker.app/Contents/Resources/etc/docker-machine.bash-completion\~ /Applications/Docker.app/Contents/Resources/etc/docker-machine.bash-completion
--- /Applications/Docker.app/Contents/Resources/etc/docker-machine.bash-completion~ 2017-07-13 18:02:08.000000000 +0900
+++ /Applications/Docker.app/Contents/Resources/etc/docker-machine.bash-completion 2017-07-16 09:03:15.000000000 +0900
@@ -83,7 +83,7 @@
[ "${words[$glob_pos]}" = "=" ] && ((glob_pos--)) # --option=key=value syntax
- [[ ${words[$glob_pos]} == @($glob) ]] && echo "$key"
+ [[ ${words[$glob_pos]} == $glob ]] && echo "$key"
}