2013年10月13日日曜日

std::vectorの一部分からstd::stringを生成

std::stringのコンストラクタにイテレータ二つを与えて範囲を指定することができる.
例: std::vector<char> bufの最初の'\n'までをstd::stringとして切り出す

cit = find(buf.begin(), buf.end(), '\n');
std::string s(buf.begin(), cit);

2013年10月2日水曜日

dvipdfmxで日本語フォントを埋め込む

dvipdfmxで日本語フォントを埋め込む
c:/tex/share/texmf-dist/fonts/map/dvipdfmx/base/cid-x.mapを編集する.

rml   H DFMINP3.TTC
gbm   H DFGOTP5.TTC
rmlv  V DFMINP3.TTC
gbmv  V DFGOTP5.TTC

.emacsのyatexの設定

(setq tex-command "c:/tex/bin/ptex2pdf -l -ot \"-kanji=utf8 -no-guess-input-enc\" -od \"-f dlbase14.map\"")
(setq dvi2-command "c:/tex/bin/SumatraPDF.exe")