Skip to content

Instantly share code, notes, and snippets.

@yuw
yuw / gist:b47f3b7960585f5e97df014ad687f5d4
Created August 29, 2023 10:10
graphicsパッケージのdraftオプションでファイル名に加えて縦横のサイズを表示する
% from graphics.sty 2022/03/10 v1.4e Standard LaTeX Graphics (DPC,SPQR)
\def\Gin@setfile#1#2#3{%
\ifx\\#2\\\Gread@false\fi
\ifGin@bbox\else
\ifGread@
\csname Gread@%
\expandafter\ifx\csname Gread@#1\endcsname\relax
eps%
\else
#1%
@yuw
yuw / detect-blankpages.rb
Created June 15, 2019 02:49
Detect blank pages in PDF
#! /usr/bin/env ruby
require "open3"
out, status = Open3.capture2e("gs -o /dev/null -sDEVICE=bbox '#{ARGV[0]}'")
array = out.rstrip.split(/\r?\n/).map {|line| line.chomp }
count = 0
blankpage_list = []
@yuw
yuw / pdfx-mathaccent.patch
Last active May 7, 2019 02:21
amsmath.sty + pdfx.styで\hat{\hat{f}}等がエラーになる問題へのpatch(いきおい)
--- /usr/local/texlive/2019/texmf-dist/tex/latex/pdfx/pdfx.sty 2019-03-12 07:01:25.000000000 +0900
+++ ./pdfx.sty 2019-05-07 11:15:38.000000000 +0900
@@ -31,7 +31,7 @@
}{}%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{pdfx}
- [2019/02/27 v1.6.3 PDF/X and PDF/A support (CVR/HTH/RRM/PS)]
+ [2019/05/07 v1.6.3.1-test PDF/X and PDF/A support (CVR/HTH/RRM/PS)]
\newif\ifpdfx@noBOM \pdfx@noBOMfalse % use a BOM in the XMP packet
@yuw
yuw / w3c-japanese-gap-analysis.csv
Last active October 3, 2018 01:58
CSV list of Japanese Gap Analysis
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 1 column, instead of 4. in line 3.
# Japanese Gap Analysis
# W3C Editor's Draft 27 September 2018
# https://w3c.github.io/jlreq/gap-analysis/
section,id,status,class
Encoding considerations,encoding,OK,ok
Fonts,fonts,Needs research,tbd
Font styles,fontstyle,Needs research,tbd
Glyph control,glyphs,Not applicable,na
Cursive text,cursive,Not applicable,na
Quotations,quotations,Needs work for advanced level support,advanced
@yuw
yuw / greek-math.tex
Created September 13, 2018 02:48
LuaLaTeXで数式内のギリシア文字を変更
\documentclass{article}
\usepackage{unicode-math}
\setmathfont{latinmodern-math.otf}
\setmathfont{CollectorComic}[range=up]
\setmathfont{CollectorComic-Italic}[range=it->up]
\setmathfont{CollectorComic-Bold}[range=bfup->up]
\setmathfont{CollectorComic-BoldItalic}[range=bfit->up]
\begin{document}
@yuw
yuw / gist:48764995abf8ed7ab3525fb34fec107f
Created April 8, 2018 02:17
参考文献の行長を字幅の整数倍にする
\documentclass{jlreq}
\makeatletter
\renewenvironment{thebibliography}[1]{%
\jlreq@oldfontcommand@enable
\section*{\refname}%
\@mkboth{\refname}{\refname}%
\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\@tempdimb\labelwidth
@yuw
yuw / several_fonts_path_macOS_10.12_Sierra.csv
Last active June 14, 2018 00:04
macOS 10.12 Sierraのいくつかのフォントファイルの場所
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 8.
"/System/Library/Assets/com_apple_MobileAsset_Font3/1f24432ba1a0e8c8507719302610b05c7f5e1b95.asset/AssetData/LingWaiTC-Medium.otf",
"/System/Library/Assets/com_apple_MobileAsset_Font3/20d2e557b080b38599efc6c4e7945218db3f3b3d.asset/AssetData/ToppanBunkyuMincho-Regular.otf",
"/System/Library/Assets/com_apple_MobileAsset_Font3/264bb88366e4d8eb5b8c9e7ebe17434d85fbd56c.asset/AssetData/WeibeiTC-Bold.otf",
"/System/Library/Assets/com_apple_MobileAsset_Font3/31446e511030d504d82943f715bb763066d52fdd.asset/AssetData/YuppySC-Regular.otf",
"/System/Library/Assets/com_apple_MobileAsset_Font3/3464d468aaf3415bded5c10f7ae71b0252ee389b.asset/AssetData/ToppanBunkyuMidashiGothic-ExtraBold.otf",
"/System/Library/Assets/com_apple_MobileAsset_Font3/45282121ba76bb2e9985123c4ef8327f74d39305.asset/AssetData/LingWaiSC-Medium.otf",
"/System/Library/Assets/com_apple_MobileAsset_Font3/456f218aaaff310805fa4003038e593c9db93d8b.asset/AssetData/YuppyTC-Regular.otf",
"/System/Library/Assets/com_apple_MobileAsset_Font3/6da938c9f7fa36cae9ee066f
@yuw
yuw / general-conf_ja.xml
Last active July 11, 2016 08:46
RedPenの設定
<redpen-conf lang="ja" type="zenkaku2">
<validators>
<!--Rules on sentence length-->
<validator name="SentenceLength">
<property name="max_len" value="114"/>
</validator>
<validator name="CommaNumber" />
<!--Rules on expressions-->
<validator name="ParagraphNumber"/>
@yuw
yuw / DefaultKeyBinding.dict
Created June 28, 2016 12:47
OSX上のemacsでバックスラッシュが入力できない問題をシステム側で¥と\をいれかえることで解消
{
"¥" = ("insertText:", "\\");
"~\\" = ("insertText:", "¥");
}
@yuw
yuw / uppgfmark.tex
Created January 8, 2016 14:12
uplatexとdipsによるtikzのオプションremember pictureの利用
\documentclass{ujarticle}
\usepackage{array}
\usepackage{tikz}
\makeatletter
\def\pgfsys@markposition#1{%
\pdfsavepos%
\edef\pgf@temp{#1}%
\expandafter\pgfutil@writetoaux\expandafter{%