Skip to content

Instantly share code, notes, and snippets.

@doraTeX
doraTeX / randomshuffle.sty
Last active Jan 18, 2019
A LaTeX package for random shuffling
View randomshuffle.sty
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{randomshuffle}[2019/01/18 v0.2]
\RequirePackage{keyval}
\ifdefined\pdfuniformdeviate
\let\randomshuffle@uniformdeviate\pdfuniformdeviate
\let\randomshuffle@setrandomseed\pdfsetrandomseed
\else\ifdefined\uniformdeviate
\let\randomshuffle@uniformdeviate\uniformdeviate
\let\randomshuffle@setrandomseed\setrandomseed
@doraTeX
doraTeX / currentpage.tex
Last active Nov 25, 2018
jsarticle + mag + gentombow + pdfbox + pxpgfmark の両立実験
View currentpage.tex
% (u)pLaTeX + dvipdfmx
\documentclass[8pt,b6paper,dvipdfmx,autodetect-engine,tombo]{jsarticle}
\usepackage[pdfbox]{gentombow}
\usepackage{tikz}
\usepackage{pxpgfmark}
\def\test{%
\begin{tikzpicture}[remember picture, overlay]
\coordinate (NE) at (current page.north east);
@doraTeX
doraTeX / generateQRcode.swift
Last active Feb 15, 2019
QR Code Generator written in Swift 4
View generateQRcode.swift
import Quartz
extension CGImage {
class func qrCodeImage(from string: String, scale: CGFloat = 1) -> CGImage? {
let stringData = string.data(using: .utf8)
let transform = CGAffineTransform(scaleX: scale, y: scale)
guard let filter = CIFilter(name: "CIQRCodeGenerator") else {
return nil
}
View Sierra-FontList.txt
32 /System/Library/Fonts/Apple Braille Outline 6 Dot.ttf
36 /System/Library/Fonts/Apple Braille Outline 8 Dot.ttf
24 /System/Library/Fonts/Apple Braille Pinpoint 6 Dot.ttf
24 /System/Library/Fonts/Apple Braille Pinpoint 8 Dot.ttf
16 /System/Library/Fonts/Apple Braille.ttf
88304 /System/Library/Fonts/Apple Color Emoji.ttc
532 /System/Library/Fonts/Apple Symbols.ttf
17096 /System/Library/Fonts/AppleSDGothicNeo.ttc
12980 /System/Library/Fonts/AquaKana.ttc
64 /System/Library/Fonts/ArialHB.ttc
View HighSierra-fcquery.txt
File: /Library/Fonts/AppleGothic.ttf
id 0
Name: AppleGothic
Format: TrueType
Lang: de|fj|ho|ia|ig|ie|io|ko|nds|nr|om|so|ss|st|sw|ts|uz|vo|xh|yap|zu|kj|kwm|lg|ms|ng|rn|rw|sn|za
File: /Library/Fonts/AppleMyungjo.ttf
id 0
Name: AppleMyungjo
View HighSierra-FontList.txt
196 /System/Library/Fonts/SFCompactDisplay-Heavy.otf
200 /System/Library/Fonts/SFCompactText-Medium.otf
212 /System/Library/Fonts/SFCompactRounded-Bold.otf
152 /System/Library/Fonts/SFNSTextCondensed-Bold.otf
17420 /System/Library/Fonts/AppleSDGothicNeo.ttc
472 /System/Library/Fonts/SFNSDisplay.ttf
972 /System/Library/Fonts/Menlo.ttc
32772 /System/Library/Fonts/STHeiti Medium.ttc
212 /System/Library/Fonts/SFCompactRounded-Medium.otf
136 /System/Library/Fonts/SFNSTextCondensed-Medium.otf
@doraTeX
doraTeX / chemfig_hiragino.tex
Created May 3, 2017
chemfig の原子出力にヒラギノ従属欧文を使う例 (LuaLaTeX)
View chemfig_hiragino.tex
%! lualatex
\documentclass{ltjsarticle}
\usepackage{chemfig}
\usepackage[hiragino-pron]{luatexja-preset}
\usepackage{unicode-math}
\setmathfontface\chemrm{HiraginoSans-W3.ttc} %% ヒラギノ角ゴシック W3 で数式の文字を出す命令 \chemrm を定義
\def\printatom#1{\ensuremath{\chemrm{#1}}} %% chemfig の原子出力命令を \chemrm に変更
\begin{document}
@doraTeX
doraTeX / Sierra-CK-ttcinfo.txt
Created Dec 13, 2016
Sierraの中韓TTCフォントの詳細情報
View Sierra-CK-ttcinfo.txt
$ texlua ttcinfo.lua /Library/Fonts/Songti.ttc
ttcinfo: tag: ttcf
ttcinfo: version: 131072
ttcinfo: #fonts: 8
ttcinfo: offset: {56,276,528,780,1032,1284,1536,1788}
ttcinfo: Font #1: Songti_1.ttf
ttcinfo: Font #2: Songti_2.ttf
ttcinfo: Font #3: Songti_3.ttf
ttcinfo: Font #4: Songti_4.ttf
@doraTeX
doraTeX / ModifiedNFD-test.m
Created Oct 12, 2016
Test of Modified-NFD (HFS+ style Unicode normalization)
View ModifiedNFD-test.m
// clang -lobjc -framework Foundation -o ModifiedNFD-test ModifiedNFD-test.m
#import <Foundation/Foundation.h>
#import <stdio.h>
void dump(NSString* str) {
for (NSUInteger i = 0; i < str.length; i++) {
puts([NSString stringWithFormat:@"U+%04X", [str characterAtIndex:i]].UTF8String);
}
}
@doraTeX
doraTeX / ttcinfo.lua
Created Oct 4, 2016
Show information of a TTC file (derived from zrdecompttc.lua https://gist.github.com/zr-tex8r/7058922 )
View ttcinfo.lua
-- ttcinfo.lua
prog_name = "ttcinfo"
version = "0.1"
mod_date = "2016/10/05"
verbose = true
----------------------------------------
ttc_file, ttf_base, ttf_ext, ttf_idb = nil
----------------------------------------
do
local reader_meta = {
You can’t perform that action at this time.