Macにjlisting.styを導入 (Tex)

jlistingを使うためにいろいろと苦労したのでそのメモ

環境

OS : Mac OS X Yosemite 10.10.1


$ platex --version

e-pTeX 3.1415926-p3.4-110825-2.6 (utf8.euc) (TeX Live 2013)
kpathsea version 6.1.1
ptexenc version 1.3.1
Copyright 2013 D.E. Knuth.
There is NO warranty. Redistribution of this software is
covered by the terms of both the e-pTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the e-pTeX source.
Primary author of e-pTeX: Peter Breitenlohner.

あと他に何の情報を書けばいいのか分からないから、記事を書いた日付を見て自分の環境とあってるか参考にしてください 。。。

構築したのは2015/1/2で成功しました^^。(正月から意識の高い…

 

導入方法

jlisting.styをダウンロード[http://prdownloads.sourceforge.jp/mytexpert/26068/jlisting.sty.bz2]

ダウンロードしてきたjlisting.sty.bz2を解凍


bunzip2 jlisting.sty.bz2

解凍したjlisting.styを/usr/local/texlive/2013/texmf-dist/tex/latex/listings/にコピー

( 2013の所はいろいろ違うらしい 2012だったり2011だったり…)


sudo mv jlisting.sty /usr/local/texlive/2013/texmf-dist/tex/latex/listings/

そして、導入したのを反映?させるためのコマンド


sudo mktexlsr

Password: (パスワードを入力)

これで無事に…できませんでした(・_・)

 

パーミッションの変更


platex -kanji=utf-8 ./hoge.tex

…

/usr/local/texlive/2013/texmf-dist/tex/latex/listings/jlisting.sty: Permission denied

/usr/local/texlive/2013/texmf-dist/tex/latex/listings/jlisting.sty: Permission denied

/usr/local/texlive/2013/texmf-dist/tex/latex/listings/jlisting.sty: Permission denied

…

つまり、「権限がねぇ」って言われてました。(このエラーメッセージを読んでなくてかなり時間を使ってしまった。


ls -l /usr/local/texlive/2013/texmf-dist/tex/latex/listings/jlisting.sty

-rw-r-----@    1 root  wheel    6230  1  2 15:55 jlisting.sty

なるほど。その他に読みの権限が無いわけですね。

読み込み権限を与えよう。。。


sudo chmod +r /usr/local/texlive/2013/texmf-dist/tex/latex/listings/jlisting.sty

 

ってことで、無事にtexをコンパイルできるようになりました♪

めでたしめでたし。

 

ちょっとメモ

サイトによってlistingsの導入から始めているサイトがいろいろありましたが、自分はlistingsはすでに入っていたためそこはスルーしました。

jlisting.styをインストールする際にlistingsディレクトリも関係があるのかと思って、listingsもダウンロードしてきて元あったlistingsに上書きしたりしました。

 

参考にさせていただいたサイト

Mac(OS X 10.8)にTeX環境インストール | 気まぐれに<span class="su-quote-cite"><a href="http://chococo.tk/2013/01/171" target="_blank">Mac(OS X 10.8)にTeX環境インストール</a></span>
拡張子が.bz2のファイルを圧縮・展開するには(CUI編) | @IT<span class="su-quote-cite"><a href="http://www.atmarkit.co.jp/flinux/rensai/linuxtips/454expbz2cui.html" target="_blank">拡張子が.bz2のファイルを圧縮・展開するには(CUI編)</a></span>

 

2 thoughts on “Macにjlisting.styを導入 (Tex)

  1. esehiyoko

    ありがとうございます.助かりました!
    なぜか ls-R を見ても登録されていないのではまっていました

  2. Pingback: Re:VIEWでHighlight - IT記事まとめ

esehiyoko へ返信する コメントをキャンセル

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください