$ sudo updmap-sys --setoption kanjiEmbed hiragino
shell_escape_commands = \ bibtex,bibtex8,\ kpsewhich,\ makeindex,\ mpost,\ repstopdf,\の部分を
shell_escape_commands = \ bibtex,bibtex8,bibtexu,pbibtex,upbibtex,biber,\ kpsewhich,\ makeindex,mendex,texindy,\ mpost,pmpost,\ repstopdf,epspdf,extractbb,\に書き換える(\の部分は実際にはバックスラッシュ)。
$ sudo updmap-sys --setoption kanjiEmbed hiragino
hminrn-h | ヒラギノ明朝 Pro W3・横 |
hminrn-v | ヒラギノ明朝 Pro W3・縦 |
hminrbn-h | ヒラギノ明朝 Pro W6・横 |
hminrbn-v | ヒラギノ明朝 Pro W6・縦 |
hgothrn-h | ヒラギノ角ゴ Pro W3・横 |
hgothrn-v | ヒラギノ角ゴ Pro W3・縦 |
hgothrbn-h | ヒラギノ角ゴ Pro W6・横 |
hgothrbn-v | ヒラギノ角ゴ Pro W6・縦 |
hgothrebn-h | ヒラギノ角ゴ Std W8・横 |
hgothrebn-v | ヒラギノ角ゴ Std W8・縦 |
hmgothrn-h | ヒラギノ丸ゴ Pro W4・横 |
hmgothrn-v | ヒラギノ丸ゴ Pro W4・縦 |
#!/bin/sh curl http://psitau.kitunebi.com/otfstable.zip > ~/Desktop/otfstable.zip sudo unzip ~/Desktop/otfstable.zip -d /usr/local/texlive/texmf-local/tex/latex/ cd /usr/local/texlive/texmf-local/tex/latex/otfstable sudo ./makeotf cd /usr/local/texlive/texmf-local/fonts/tfm sudo ln -s ../../tex/latex/otfstable/tfm otfstable cd ../vf sudo ln -s ../../tex/latex/otfstable/vf otfstable sudo mkdir /usr/local/texlive/texmf-local/fonts/map sudo mkdir /usr/local/texlive/texmf-local/fonts/map/dvipdfm cd /usr/local/texlive/texmf-local/fonts/map/dvipdfm/ sudo ln -s "../../../tex/latex/otfstable/fontmap/hiraginox.map(for dvipdfmx)" hiraginox.map sudo mkdir /usr/local/texlive/texmf-local/fonts/opentype sudo mkdir /usr/local/texlive/texmf-local/fonts/opentype/public sudo mkdir /usr/local/texlive/texmf-local/fonts/opentype/public/hiragino cd /usr/local/texlive/texmf-local/fonts/opentype/public/hiragino/ sudo ln -s "/Library/Fonts/ヒラギノ明朝 Pro W3.otf" HiraMinPro-W3.otf sudo ln -s "/Library/Fonts/ヒラギノ明朝 Pro W6.otf" HiraMinPro-W6.otf sudo ln -s "/Library/Fonts/ヒラギノ角ゴ Pro W3.otf" HiraKakuPro-W3.otf sudo ln -s "/Library/Fonts/ヒラギノ角ゴ Pro W6.otf" HiraKakuPro-W6.otf sudo ln -s "/Library/Fonts/ヒラギノ角ゴ Std W8.otf" HiraKakuStd-W8.otf sudo ln -s "/Library/Fonts/ヒラギノ丸ゴ Pro W4.otf" HiraMaruPro-W4.otf sudo texhash
\usepackage[dvips]{graphics}で、epsファイルを(たとえばそれが hogehoge.eps ならば)
\includegraphics{hogehoge}によって取り入れることが出来る。
convert hogehoge.jpg hogehoge.epsとすれば、hogehoge.jpg というjpeg画像ファイルを hogehoge.eps というepsファイルに変換してくれる。
ebb hogehoge.pdfとして hogehoge.ebb というファイルを生成する必要がある。
Version of PDF file (1.4) is newer than version limit specification. Can't handle file type for file named hogehoge.pdfというエラーメッセージが返される.
sed s/PDF-1.4/PDF-1.3/ hogehoge.pdf > fuwafuwa.pdfとすることで得られる fuwafuwa.pdf では ebb によって bounding box が取得できる.
\DeclareFontShape{JT1}{gt}{m}{it}{<->ssub*gt/m/n}{} \DeclareFontShape{JT1}{mc}{m}{it}{<->ssub*mc/m/n}{} \DeclareFontShape{JT1}{mc}{m}{sl}{<->ssub*mc/m/n}{} \DeclareFontShape{JT1}{mc}{m}{sc}{<->ssub*mc/m/n}{} \DeclareFontShape{JY1}{gt}{m}{it}{<->ssub*gt/m/n}{} \DeclareFontShape{JY1}{mc}{m}{it}{<->ssub*mc/m/n}{} \DeclareFontShape{JY1}{mc}{m}{sl}{<->ssub*mc/m/n}{} \DeclareFontShape{JY1}{mc}{m}{sc}{<->ssub*mc/m/n}{}という8行のおまじないを貼付けると良い。
\DeclareFontShape{JT1}{mg}{bx}{n}{<->ssub*mg/m/n}{} \DeclareFontShape{JY1}{mg}{bx}{n}{<->ssub*mg/m/n}{}の2行も付け加えておくと良いかも。
\usepackage[deluxe,expert]{otf}を読み込むことで、ヒラギノフォントが使える。
\documentclass{jsarticle} \usepackage[deluxe,expert]{otf} \begin{document} \begin{itemize} \item {\rmfamily ヒラギノ明朝ProW3} \item {\rmfamily\bfseries ヒラギノ明朝ProW6} \item {\gtfamily ヒラギノ角ゴProW3} \item {\gtfamily\bfseries ヒラギノ角ゴProW6} \item {\gtfamily\ebseries ヒラギノ角ゴStdW8} \item {\mgfamily ヒラギノ丸ゴProW4} \end{itemize} \end{document}
--Applescript direct set Source to "~/Documents/TeXstyles/" set Destination to "/usr/local/share/texmf/ptex/platex/misc/mystyle/" set Extentions to {".sty", ".cls"} repeat with ext in Extentions set ext to "*" & ext & " " do shell script "cp " & Source & ext & Destination with administrator privileges end repeat do shell script "/usr/local/bin/mktexlsr" with administrator privileges
--Applescript direct set Directory to "~/Documents/TeXstyles/" do shell script "open " & Directory
--Applescript direct set Directory to "~/Documents/memo/" set today to current date set y to (year of today) as text set y to (character 3 of y) & (character 4 of y) set m to (month of today) as integer if m < 10 then set m to "0" & (m as text) set d to (day of today) as text set ToBeOpen to "memo" & y & m & d & ".tex" set ToBeOpen to Directory & ToBeOpen do shell script "touch " & ToBeOpen do shell script "open " & ToBeOpen & " -a TeXShop"
--Applescript direct set Environments to {"pmatrix", "equation", "proof", "enumerate"} tell application "TeXShop" set Selected to the content of the selection of the front document choose from list Environments with prompt "選んで。" set env to result set Selected to "\\begin{" & env & "}\n" & Selected & "\n\\end{" & env & "}\n" set the content of the selection of the front document to Selected tell application "System Events" repeat with i from 1 to 2 keystroke "p" using control down end repeat end tell end tell
#!/bin/tcsh set path= ($path /usr/texbin /usr/local/bin) set tex_source = $argv[1]:r platex $tex_source.tex dvipdfmx -l -o $tex_source.pdf $tex_source.dvi※ 最後の空行も含めること。
%!TEX TS-program = Landscapeというコメント行を加えておくと、
\usepackage[reset,papersize={297truemm,210truemm},vmargin=2truecm,hmargin=3truecm]{geometry} \AtBeginDvi{\special{pdf: pagesize width 297truemm height 210truemm}}などと書き込んでおけば良い。
\usepackage[a4paper,landscape]{geometry}などとすれば出力されるPDFファイルもちゃんと横置きになっている.
#!/bin/tcsh set path= ($path /usr/texbin /usr/local/bin /sw/bin) set tex_source = $argv[1]:r set temp_ps = temp.ps platex $tex_source dvips -P pdf -f -t a4 -o $temp_ps $tex_source.dvi psnup -1 -W128mm -H96mm -pa4 $temp_ps $tex_source.ps rm $temp_ps ps2pdfwr -sPAPERSIZE=a4 $tex_source.ps $tex_source.pdfTeXソースファイルの先頭の行に
%!TEX TS-program = Beamerというコメント行を加えておくと、
%!TEX encoding = UTF-8 Unicode %!TEX TS-program = XeLaTeXというコメント行を加えておくと良い。
if [ -f ~/.bashrc ] ; then . ~/.bashrc fi★参考にしたページ:
alias platex-utf8='platex -kanji=utf8'★参考にしたページ:
\newcommand{\set}[2] {\setbox1=\hbox{$\displaystyle\left\{#1#2\right\}$} \left\{#1\hskip0.35em\vrule height\ht1\hskip0.35em#2\right\}}※e-TeXを使っているならば、\middleというプリミティブが使えるので次のようでも良い。
\newcommand{\set}[2]{\left\{#1\,\middle\vert\,#2\right\}}
\makeatletter \def\permat#1{% \newcount\tempi% \newcount\tempj% \newcount\matsize% \@tfor\temp:=#1\do{\advance\matsize by 1}% \tempi=\matsize \multiply\tempi by 15 \advance\tempi by -8\relax% \tempj=\matsize \multiply\tempj by 7\relax \left(\begin{picture}(\tempi,\tempj)(-1,0)% \@tempcnta=0% \@tfor\temp:=#1\do{% \advance\@tempcnta by 1\relax\@tempcntb=1\relax% \tempi=\@tempcnta \multiply\tempi by 15 \advance\tempi by -15\relax% \tempj=\temp \multiply\tempj by -2 \advance\tempj by 1\relax \advance\tempj by \matsize \multiply\tempj by 6\relax% \put(\tempi,\tempj){$1$} } % \end{picture}\right)} \makeatother使用例:
$$ \permat{123},\quad \permat{132},\quad \permat{213},\quad \permat{231},\quad \permat{312},\quad \permat{321} $$成分は0は省略して1だけを書く仕様。
\@ifundefined{csname}{未定義の場合}{定義済みの場合}というコマンドによって実行できる。
\def\高{\@ifundefined{CID}{高}{\CID{8705}}}これは、OTFパッケージを読み込んでいる場合には \CID というコマンドが定義されているので \CID{8705} という命令を実行(いわゆる「はしご高」を出力)し、そうでなければ普通の「高」を出力するようなマクロである。
\makeatletter \newcount\@permlength% \newcommand{\@prepermcount}[1]{% \@permlength=0\relax% \@tfor\temp:=#1\do{% \advance\@permlength by 1\relax% }% } \newcommand{\@permupper}[1]{% \@tempcnta=0% \,\@tfor\temp:=#1\do{% \advance\@tempcnta by 1\relax% \the\@tempcnta% \ifnum\@tempcnta<\@permlength% \ \ % \fi% }\,% } \newcommand{\@permlower}[1]{% \@tempcnta=0% \,\@tfor\temp:=#1\do{% \advance\@tempcnta by 1\relax% \temp% \ifnum\@tempcnta<\@permlength% \ \ % \fi}\,% } \newcommand{\perm}[1]{% \@prepermcount{#1}% \genfrac{(}{)}{0pt}{0}{\@permupper{#1}}{\@permlower{#1}}% } \makeatotherたとえば \perm{35124} のように使う。
% 前提となるパッケージ \usepackage{framed,color} % 左線を書く (needs framed, color) \newenvironment{myleftbar}[1]{ \def\FrameCommand{{\color{#1}\vrule width 3pt }\hspace{10pt}}% \MakeFramed {\advance\hsize-\width \FrameRestore}}% {\endMakeFramed\par} % 左線付き定理環境を定義するためのマクロ \newcommand{\newtheorembar}[2][black]{ \newenvironment{#2}{\begin{myleftbar}{#1}\begin{vir#2}} {\end{vir#2}\end{myleftbar}} \newtheorem{vir#2}} % 定義の例 \newtheorembar[cyan]{ex}{例}
% 前提となるパッケージ \usepackage{amsthm,framed,color} % 定理のスタイル (needs amsthm) \newtheoremstyle{frame} {\topsep}{\topsep}{\rmfamily\mcfamily} {0pt}{\sffamily\gtfamily\bfseries}{.}{.5em} {\thmname{#1} \thmnumber{#2}\thmnote{ (#3)}\rmfamily} % 左線を書く (needs framed, color) \newenvironment{myleftbar}[1]{ \def\FrameCommand{{\color{#1}\vrule width 3pt }\hspace{10pt}}% \MakeFramed {\advance\hsize-\width \FrameRestore}}% {\endMakeFramed\par} % 左線付き定理環境を定義するためのマクロ \newcommand{\newtheorembar}[2][black]{ \newenvironment{#2}{\begin{myleftbar}{#1}\begin{vir#2}} {\end{vir#2}\end{myleftbar}} \theoremstyle{frame} \newtheorem{vir#2}} % 定義の例 \newtheorembar[cyan]{ex}{例}otf パッケージを使う場合,デフォルトだと定理の見出しのフォントが太い明朝体になるので,
\makeatletter \newif\iffirstterm \newcount\c@varindex \newcount\coefficient \def\@pls{&{}+{}&} \def\@mns{&{}-{}&} \def\@eq{&{}={}&} \def\@void{&{}&} \def\suffix{{\@arabic{\c@varindex}}} \def\which#1{\ifcase\c@varindex\or #1\else?\fi} % 未知変数の命名規則 \def\unknown#1{\gdef\@unknown{#1}} \unknown{x_\suffix} % デフォルトの変数名は x_i \def\eq#1;#2 { \global\c@varindex=1\relax \global\firsttermtrue \@for\temp:=#1\do{ \global\coefficient=\temp\relax \ifnum\coefficient=0 \@void \else \ifnum\coefficient<0 \global\multiply\coefficient by -1\relax \iffirstterm \global\firsttermfalse - \else \@mns \fi \else \iffirstterm \global\firsttermfalse \else \@pls \fi \fi \ifnum\coefficient=1 \else \@arabic{\coefficient} \fi \@unknown \fi \global\advance\c@varindex by 1\relax } \@eq #2 } \def\lineq#1{\global\let\oldslash=\\\gdef\\{\oldslash\eq}\eq#1\global\let\\=\oldslash\global\let\oldslash=\relax} \makeatother
\begin{alignat*}{5} \lineq{ 1, 0, 1, 2; 6 \\ -2, 1, 4, 1; 3 \\ 4, -3, -4, 1; -3 \\ -1, 1, 2, 1; 4 } \end{alignat*} \unknown{z_\suffix} \begin{alignat*}{5} \lineq{ 1, 0, 1, 2; 6 \\ -2, 1, 4, 1; 3 \\ 4, -3, -4, 1; -3 \\ -1, 1, 2, 1; 4 } \end{alignat*} \unknown{\which{x\or y\or z\or u}} \begin{alignat*}{5} \lineq{ 1, 0, 1, 2; 6 \\ -2, 1, 4, 1; 3 \\ 4, -3, -4, 1; -3 \\ -1, 1, 2, 1; 4 } \end{alignat*}
\NeedsTeXFormat{pLaTeX2e} \ProvidesPackage{default}[2009/12/21 v1.0 written by fuhmi] % 2行目 \RequirePackage{amsmath,amsthm,amssymb} \RequirePackage{stmaryrd,pifont,okumacro} \RequirePackage[deluxe,expert]{otf} % 5行目 \RequirePackage{type1cm} % Avoid unexpected font warnings by pTeX \DeclareFontShape{JT1}{gt}{m}{it}{<->ssub*gt/m/n}{} \DeclareFontShape{JT1}{mc}{m}{it}{<->ssub*mc/m/n}{} \DeclareFontShape{JT1}{mc}{m}{sl}{<->ssub*mc/m/n}{} \DeclareFontShape{JT1}{mc}{m}{sc}{<->ssub*mc/m/n}{} \DeclareFontShape{JY1}{gt}{m}{it}{<->ssub*gt/m/n}{} \DeclareFontShape{JY1}{mc}{m}{it}{<->ssub*mc/m/n}{} \DeclareFontShape{JY1}{mc}{m}{sl}{<->ssub*mc/m/n}{} \DeclareFontShape{JY1}{mc}{m}{sc}{<->ssub*mc/m/n}{} \DeclareFontShape{JT1}{mg}{bx}{n}{<->ssub*mg/m/n}{} % 18行目 \DeclareFontShape{JY1}{mg}{bx}{n}{<->ssub*mg/m/n}{} % 19行目 % PostScript Fonts: % Avant Garde, Bookman, Courier, Helvetica % New Century, Palatino, Times, Zapf Chancery \newcommand{\agfamily}{\fontfamily{pag}\selectfont} \newcommand{\bkfamily}{\fontfamily{pbk}\selectfont} \newcommand{\crfamily}{\fontfamily{pcr}\selectfont} \newcommand{\hvfamily}{\fontfamily{phv}\selectfont} \newcommand{\ncfamily}{\fontfamily{pnc}\selectfont} \newcommand{\plfamily}{\fontfamily{ppl}\selectfont} \newcommand{\tmfamily}{\fontfamily{ptm}\selectfont} \newcommand{\zcfamily}{\usefont{OT1}{pzc}{m}{n}} \newcommand{\textag}[1]{{\agfamily#1}} \newcommand{\textbk}[1]{{\bkfamily#1}} \newcommand{\textcr}[1]{{\crfamily#1}} \newcommand{\texthv}[1]{{\hvfamily#1}} \newcommand{\textnc}[1]{{\ncfamily#1}} \newcommand{\textpl}[1]{{\plfamily#1}} \newcommand{\texttm}[1]{{\tmfamily#1}} \newcommand{\textzc}[1]{{\zcfamily#1}} % Modification \numberwithin{equation}{section} \renewcommand{\labelenumi}{{\upshape(\theenumi)}} \renewcommand{\emph}[1]{{\gtfamily\sffamily\bfseries\boldmath#1}} % Frequently used \newcommand{\N}{\mathbb{N}} \newcommand{\Z}{\mathbb{Z}} \newcommand{\Q}{\mathbb{Q}} \newcommand{\R}{\mathbb{R}} \newcommand{\C}{\mathbb{C}} \newcommand{\e}{\varepsilon} \newcommand{\abs}[1]{\left|#1\right|} \newcommand{\floor}[1]{\left\lfloor#1\right\rfloor} \newcommand{\ceil}[1]{\left\lceil#1\right\rceil} \newcommand{\set}[2] {\setbox1=\hbox{$\displaystyle\left\{#1#2\right\}$}% \left\{#1\hskip0.35em\vrule height\ht1\hskip0.35em#2\right\}} \newcommand{\then}{\DOTSB \;\Longrightarrow \;} % implication arrow "==>" % log-type operators \let\Re = \relax \let\Im = \relax \DeclareMathOperator{\Re}{Re} \DeclareMathOperator{\Im}{Im} \DeclareMathOperator*{\Res}{Res} \DeclareMathOperator{\tr}{tr}
\usepackage[reset,papersize={297truemm,210truemm},vmargin=2truecm,hmargin=3truecm]{geometry} \AtBeginDvi{\special{pdf: pagesize width 297truemm height 210truemm}}などと書き込んでおけば横置き(ランドスケープ)のA4用紙となる。
\usepackage[a4paper,margin=0mm]{geometry}% A4用紙,マージンなしとすれば良い。
\begin{document} \noindent \unitlength=1truemm \begin{picture}(210,297) % A4用紙のサイズは 210mm × 297mm \put(0,0){\includegraphics{form.pdf}} % pdf ファイルを読み込む % \put 命令でモノを配置する \end{picture} \end{document}のようにすれば、form.pdf というPDFファイルの上に文字などを書き込んだPDFファイルを作ることが出来る。
\begin{enumerate} \item TeX \item LaTeX \item XeTeX \item Omega \end{enumerate}などと書くと、デフォルトでは
1. TeX 2. LaTeX 3. XeTeX 4. Omegaのような出力が得られる。
\renewcommand{\theenumi}{\Alph{enumi}} \renewcommand{\labelenumi}{【\,\theenumi\,】}のようにプリアンブルに書いておくと、上と同じソースの出力は
【A】 TeX 【B】 LaTeX 【C】 XeTeX 【D】 Omegaのようになる。
\makeatletter \def\th@comment{ \thm@headfont {\sffamily\gtfamily\bfseries }\gtfamily \thm@preskip \topsep \divide \thm@preskip \tw@ \thm@postskip \thm@preskip } \makeatotherと書いておくと、\theoremstyle{comment} とすることで
\documentclass[a4paper,12pt]{jsarticle} \usepackage[papersize={210truemm,297truemm}, top=3truecm,bottom=3truecm,left=2truecm,right=2truecm]{geometry}とすれば、A4サイズ(210mm×297mm)の紙で上下に 3cm、左右に 2cm のマージンを設ける、
\csname コマンド名\endcsnameによって表現することが出来る.たとえば
\csname textbf\endcsname{hoge}は
\textbf{hoge}と等価である.
\newcommand{\set}[3][big] {\csname#1l\endcsname\{#2\,\csname#1\endcsname|\,#3\csname#1r\endcsname\}}これは集合の内包的記述 { #2 | #3 } を表すマクロで,
#!/usr/local/bin/perl open(IN,$ARGV[0]) || die "しかし $ARGV[0] が見当たらなかった!\n"; while ($_ = <IN>) { if ($_ =~ /%%BoundingBox:/) { $_ =~ s/%%BoundingBox: //g; $_ =~ s/ /,/g; @data = split(/,/,$_); $picturewidth = $data[2]-$data[0]; $pictureheight = $data[3]-$data[1]; $paperwidth = $picturewidth+10; $paperheight = $pictureheight+10; print "%!TEX encoding = UTF-8 Unicode\n"; print "%!TEX TS-program = XeLaTeX\n"; print "\\documentclass{minimal}\n"; print "\\usepackage[dvipdfm]{graphicx}\n"; print "\\usepackage[cm-default]{fontspec}\n"; print "\\usepackage{type1cm}\n"; print "\\usepackage{amsmath,amsthm,amssymb}\n"; print "\\usepackage{stmaryrd,pifont}\n"; print "\\usepackage{ifthen}\n"; print "\\usepackage[paperwidth=$paperwidth"; print "pt,paperheight=$paperheight"; print "pt,margin=5pt]{geometry}\n"; print "\\begin{document}\n"; print "\\noindent%\n"; print "\\begin{picture}($picturewidth,$pictureheight)($data[0],$data[1])\n"; print "\\put($data[0],$data[1]){\\makebox{\\includegraphics{$ARGV[0]}}}%\n"; print "\\end{picture}%\n"; print "\\end{document}\n"; } } close(IN);特に何も工夫はない。
perl ps2pict.pl hoge.mps > out.texなどとやると、同じフォルダ内に
%!TEX encoding = UTF-8 Unicode %!TEX TS-program = XeLaTeX \documentclass{minimal} \usepackage[dvipdfm]{graphicx} \usepackage[cm-default]{fontspec} \usepackage{type1cm} \usepackage{amsmath,amsthm,amssymb} \usepackage{stmaryrd,pifont} \usepackage{ifthen} \usepackage[paperwidth=150pt,paperheight=169pt,margin=5pt]{geometry} \begin{document} \noindent% \begin{picture}(140,159)(-70,-89) \put(-70,-89){\makebox{\includegraphics{hoge.mps}}}% \end{picture}% \end{document}といった感じの内容を持つ out.tex というファイルが生成される。
import urllib2,os;pf='Package Control.sublime-package';ipp=sublime.installed_packages_path();os.makedirs(ipp) if not os.path.exists(ipp) else None;open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read())を実行する(一行で).
"cmd": ["latexmk", "-e", "\\$pdflatex = 'pdflatex %O -interaction=nonstopmode -synctex=1 %S'", //"-silent", "-f", "-pdf"],の最後の "-pdf" を "-pv" に変更する.
#!/bin/sh if [ "$2" = "" ]; then dvipdfmx $1 else dvipdfmx -o $2 $1 fi(最後の空行を忘れないように)
$latex ="platex"; $bibtex = "pbibtex"; $makeindex = "mendex"; $dvipdf = "sh ~/myscripts/dvipdfmx_call.sh"; $dvips = "dvipsk"; $pdf_mode = 3; $pdf_previewer = "open -a preview.app";