hikiutils 0.2.3.9 → 0.2.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/hikiutils_bob/.#Rakefile +1 -0
- data/hikiutils_bob/Rakefile +32 -12
- data/hikiutils_bob/latex2hiki.hiki +23 -1
- data/hikiutils_bob/latex_all.hiki +50 -40
- data/hikiutils_bob/latex_dir/hikiutils_bob.log +86 -87
- data/hikiutils_bob/latex_dir/hikiutils_bob.pdf +0 -0
- data/hikiutils_bob/latex_dir/hikiutils_bob.synctex.gz +0 -0
- data/hikiutils_bob/latex_dir/hikiutils_bob.tex +1 -2
- data/hikiutils_bob/latex_dir/hikiutils_bob.toc +11 -7
- data/hikiutils_bob/latex_dir/jlisting.sty +216 -0
- data/hikiutils_bob/latex_dir/latex2hiki.aux +4 -3
- data/hikiutils_bob/latex_dir/latex2hiki.tex +20 -1
- data/hikiutils_bob/latex_dir/latex_all.aux +4 -2
- data/hikiutils_bob/latex_dir/latex_all.tex +57 -45
- data/hikiutils_bob/latex_dir/pre.tex +1 -1
- data/hikiutils_bob/latex_dir/sync.aux +11 -10
- data/hikiutils_bob/latex_dir/sync.tex +27 -20
- data/hikiutils_bob/sync.hiki +23 -14
- data/lib/hikiutils.rb +3 -1
- data/lib/hikiutils.rb~ +1 -1
- data/lib/hikiutils/version.rb +1 -1
- data/lib/templates/Rakefile_hiki_sync +32 -12
- data/lib/templates/jlisting.sty +216 -0
- metadata +4 -1
@@ -17,19 +17,20 @@
|
|
17
17
|
\newlabel{default}{{1}{8}}
|
18
18
|
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.5.2}rake force\_sync}{8}}
|
19
19
|
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.5.3}rake chenv}{8}}
|
20
|
-
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.5.4}rake convert VAL DIR}{
|
20
|
+
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.5.4}rake convert VAL DIR}{8}}
|
21
21
|
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.5.5}rake increment}{9}}
|
22
22
|
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.5.6}rake number}{9}}
|
23
|
-
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.5.7}rake touch}{
|
24
|
-
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.5.8}rake github}{
|
25
|
-
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.5.9}rake reset\_hiki}{
|
23
|
+
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.5.7}rake touch}{9}}
|
24
|
+
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.5.8}rake github}{9}}
|
25
|
+
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.5.9}rake reset\_hiki}{9}}
|
26
26
|
\@writefile{toc}{\contentsline {subsection}{\numberline {2.6}githubによる同期}{10}}
|
27
|
-
\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces 卒論編集時のgithubによる同期のシーケンス図.}}{
|
28
|
-
\newlabel{default}{{4}{
|
27
|
+
\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces 卒論編集時のgithubによる同期のシーケンス図.}}{10}}
|
28
|
+
\newlabel{default}{{4}{10}}
|
29
29
|
\@writefile{toc}{\contentsline {subsection}{\numberline {2.7}hikiutil関連のヘルプ}{11}}
|
30
30
|
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.7.1}hikiで卒論を書くときの初期化と掟}{11}}
|
31
|
-
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.7.2}
|
32
|
-
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.7.3}
|
31
|
+
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.7.2}図表に関する制約}{11}}
|
32
|
+
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.7.3}同期に関する制約}{12}}
|
33
|
+
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.7.4}テキストに関する制約}{12}}
|
33
34
|
\@setckpt{sync}{
|
34
35
|
\setcounter{page}{13}
|
35
36
|
\setcounter{equation}{0}
|
@@ -42,11 +43,11 @@
|
|
42
43
|
\setcounter{part}{0}
|
43
44
|
\setcounter{section}{2}
|
44
45
|
\setcounter{subsection}{7}
|
45
|
-
\setcounter{subsubsection}{
|
46
|
+
\setcounter{subsubsection}{4}
|
46
47
|
\setcounter{paragraph}{0}
|
47
48
|
\setcounter{subparagraph}{0}
|
48
49
|
\setcounter{figure}{4}
|
49
50
|
\setcounter{table}{1}
|
50
|
-
\setcounter{lstnumber}{
|
51
|
+
\setcounter{lstnumber}{10}
|
51
52
|
\setcounter{lstlisting}{0}
|
52
53
|
}
|
@@ -36,7 +36,7 @@ hiki -v
|
|
36
36
|
hiki -i
|
37
37
|
\end{verbatim}\end{quote}
|
38
38
|
によって以下のようなファイルが作成される.
|
39
|
-
\begin{lstlisting}[style=]
|
39
|
+
\begin{lstlisting}[style=customCsh,basicstyle={\scriptsize\ttfamily}]
|
40
40
|
bob% ls -lat
|
41
41
|
total 1072
|
42
42
|
-rw-r--r-- 1 bob 501 99 1 20 12:44 .hikirc
|
@@ -86,7 +86,7 @@ keynoteで図を作成して,hikiutils\_bob.hikiに文章を記述していく
|
|
86
86
|
\end{enumerate}
|
87
87
|
\subsection{rakeが用意しているタスク}
|
88
88
|
rakeの用意しているコマンドは次のとおり.
|
89
|
-
\begin{lstlisting}[style=]
|
89
|
+
\begin{lstlisting}[style=customCsh,basicstyle={\scriptsize\ttfamily}]
|
90
90
|
rake sync # hikiの同期
|
91
91
|
rake force_sync # hikiの強制同期
|
92
92
|
rake chenv # For hiki Errno::ENOENT, Errno::EACCES
|
@@ -134,7 +134,7 @@ rake convert 80 hikiutils_bob
|
|
134
134
|
|
135
135
|
\subsubsection{rake increment}
|
136
136
|
keynoteでページを追加するとhikiでの参照(attach\_view)にずれが生じる.いまのところこれを解消する方法はなく手で修正を加える必要がある.ずれが単純な場合には,
|
137
|
-
\begin{lstlisting}[style=]
|
137
|
+
\begin{lstlisting}[style=,basicstyle={\scriptsize\ttfamily}]
|
138
138
|
cp hikiutils_bob.hiki tmp.hiki
|
139
139
|
rake increment 2 tmp.hiki > tmp2.hiki
|
140
140
|
\end{lstlisting}
|
@@ -142,12 +142,12 @@ rake increment 2 tmp.hiki > tmp2.hiki
|
|
142
142
|
|
143
143
|
\subsubsection{rake number}
|
144
144
|
rake incrementと同じくfigs内の通し番号が変わった時にattach\_viewの通し番号を調整するコマンド.
|
145
|
-
\begin{lstlisting}[style=]
|
145
|
+
\begin{lstlisting}[style=customCsh,basicstyle={\scriptsize\ttfamily}]
|
146
146
|
rake number 3 hikiutils_bob.hiki > tmp.hiki
|
147
147
|
cp tmp.hiki hikiutils_bob.hiki
|
148
148
|
\end{lstlisting}
|
149
149
|
とすると
|
150
|
-
\begin{
|
150
|
+
\begin{lstlisting}[style=customCsh,basicstyle={\scriptsize\ttfamily}]
|
151
151
|
8c8
|
152
152
|
{{attach_view(hikiutils_bob.002.jpeg)}}
|
153
153
|
---
|
@@ -156,7 +156,7 @@ cp tmp.hiki hikiutils_bob.hiki
|
|
156
156
|
{{attach_view(hikiutils_bob.003.jpeg)}}
|
157
157
|
---
|
158
158
|
{{attach_view(hikiutils_bob.004.jpeg)}}
|
159
|
-
\end{
|
159
|
+
\end{lstlisting}
|
160
160
|
などと番号を3から順に振り替えてくれる.
|
161
161
|
|
162
162
|
\subsubsection{rake touch}
|
@@ -167,7 +167,7 @@ git remoteにあるoriginのgithubをsafariでopenします.
|
|
167
167
|
|
168
168
|
\subsubsection{rake reset\_hiki}
|
169
169
|
hikiシステムにあるゴミファイルを掃除します.
|
170
|
-
\begin{
|
170
|
+
\begin{lstlisting}[style=customCsh,basicstyle={\scriptsize\ttfamily}]
|
171
171
|
bob% rake reset_hiki
|
172
172
|
hikiutils: provide utilities for helping hiki editing.
|
173
173
|
"open -a mi"
|
@@ -177,7 +177,7 @@ target_dir : /Users/bob/Sites/nishitani0/Internal/data/text
|
|
177
177
|
-rw-rw-rw- 1 bob staff 10104 2 5 12:03 hikiutils_bob_sync
|
178
178
|
-rw-r--r-- 1 bob staff 944 2 5 12:03 hikiutils_bob_toc
|
179
179
|
remove hikiutils_bob_toc[ynql]?
|
180
|
-
\end{
|
180
|
+
\end{lstlisting}
|
181
181
|
となります.yes, no, quit, listのなかから選んでください.
|
182
182
|
|
183
183
|
\subsection{githubによる同期}
|
@@ -213,7 +213,6 @@ git init, forkが済んでいると仮定して同期の手順を以下に示す
|
|
213
213
|
\subsection{hikiutil関連のヘルプ}
|
214
214
|
\subsubsection{hikiで卒論を書くときの初期化と掟}
|
215
215
|
\begin{itemize}
|
216
|
-
\item 開発メモ:figs,dataも作成
|
217
216
|
\item 目的:西谷が後で迷わないように決まったファイル構造を堅持すべし
|
218
217
|
\item 文書:hikiで書く.のちには,latexに変換するプログラムを提供します
|
219
218
|
\item 図表:すべての図表をkeynoteにまとめる,タイトルを分かりやすく書く
|
@@ -227,25 +226,33 @@ git init, forkが済んでいると仮定して同期の手順を以下に示す
|
|
227
226
|
\item hikiでのurlはテキスト前とディレクトリーから自動生成される
|
228
227
|
\item 例えば,hiki2latex\_saki/introduciton.hikiとするとhiki2latex\_saki\_introducitonと変換される
|
229
228
|
\end{itemize}
|
230
|
-
\subsubsection{
|
231
|
-
\begin{itemize}
|
232
|
-
\item Permission denied - ./data/text/boundary\_narita (Errno::EACCES)->テキストにhikiが書き込めない,chmod a+w FILE
|
233
|
-
\end{itemize}
|
234
|
-
\subsubsection{図表:すべての図表をkeynoteにまとめる,タイトルを分かりやすく書く}
|
229
|
+
\subsubsection{図表に関する制約}
|
235
230
|
\begin{itemize}
|
231
|
+
\item すべての図表をkeynoteにまとめる
|
236
232
|
\item keynoteに書いたスライドはイメージに書き出して,rake convert 80 TARGET\_DIRでfigsに変換
|
237
233
|
\item rake syncでfigsにあるfilesはhiki/target\_dirにcpされる
|
238
234
|
\item \verb|convert #{source} -resize 20% #{target}によって,target=figs/TAERGET.pngに20%に縮小して保存される|
|
239
235
|
\item convert -density 300 view.svg view.pngで300dpiで変換
|
240
|
-
\item attach\_anchorでは
|
241
|
-
\end{itemize}
|
242
|
-
'\verb|{{attach_anchor(test.png, hiki2latex_saki)}}|'
|
243
|
-
と,directory指定しなければならない.
|
244
|
-
|
245
|
-
\begin{itemize}
|
236
|
+
\item attach\_anchorでは'\verb|{{attach_anchor(test.png, hiki2latex_saki)}}|'と,directory指定しなければならない.
|
246
237
|
\item keynoteであとで図を挿入して番号が変わった時の原稿の一括変換
|
247
238
|
\item rake increment 2 boundary\_bob.hiki boundary\_bob > tmp.hiki
|
248
239
|
\item rake convert 60 boundary\_bob
|
249
240
|
\item rake sync
|
250
241
|
\item hiki -u boundary\_bob\_tmp
|
251
242
|
\end{itemize}
|
243
|
+
\subsubsection{同期に関する制約}
|
244
|
+
\begin{itemize}
|
245
|
+
\item hikiはフラットなdirectory構造を取っている
|
246
|
+
\item hikiの文書はスネーク表記(例えば,latex2hiki\_saki)で階層構造に似せている
|
247
|
+
\item hikiのurlの接頭語となる名前をbasenameのdirectory名とする.
|
248
|
+
\item directory名が'hikis'である場合はその親directory名となる.
|
249
|
+
\item ~/.hikircのtarget directoryを同期先のdirectoryとする.
|
250
|
+
\item ~/.hikircがない場合は同期先のdirectoryを聞く.
|
251
|
+
\item それらは./.hikircに保存される
|
252
|
+
\end{itemize}
|
253
|
+
\subsubsection{テキストに関する制約}
|
254
|
+
\begin{itemize}
|
255
|
+
\item テキストの拡張子は'.hiki'としている
|
256
|
+
\item hikiでのurlはテキスト前とディレクトリーから自動生成される
|
257
|
+
\item 例えば,hiki2latex\_saki/introduciton.hikiとするとhiki2latex\_saki\_introducitonと変換される
|
258
|
+
\end{itemize}
|
data/hikiutils_bob/sync.hiki
CHANGED
@@ -30,7 +30,7 @@ hikiuitlsをgemからinstallしておく必要がある.コマンドは以下
|
|
30
30
|
hiki -i
|
31
31
|
によって以下のようなファイルが作成される.
|
32
32
|
|
33
|
-
<<<
|
33
|
+
<<< tcsh
|
34
34
|
bob% ls -lat
|
35
35
|
total 1072
|
36
36
|
-rw-r--r-- 1 bob 501 99 1 20 12:44 .hikirc
|
@@ -68,7 +68,7 @@ keynoteで図を作成して,hikiutils_bob.hikiに文章を記述していく
|
|
68
68
|
!!rakeが用意しているタスク
|
69
69
|
rakeの用意しているコマンドは次のとおり.
|
70
70
|
|
71
|
-
<<<
|
71
|
+
<<< tcsh
|
72
72
|
rake sync # hikiの同期
|
73
73
|
rake force_sync # hikiの強制同期
|
74
74
|
rake chenv # For hiki Errno::ENOENT, Errno::EACCES
|
@@ -114,12 +114,12 @@ rake increment 2 tmp.hiki > tmp2.hiki
|
|
114
114
|
|
115
115
|
!!!rake number
|
116
116
|
rake incrementと同じくfigs内の通し番号が変わった時にattach_viewの通し番号を調整するコマンド.
|
117
|
-
<<<
|
117
|
+
<<< tcsh
|
118
118
|
rake number 3 hikiutils_bob.hiki > tmp.hiki
|
119
119
|
cp tmp.hiki hikiutils_bob.hiki
|
120
120
|
>>>
|
121
121
|
とすると
|
122
|
-
<<<
|
122
|
+
<<< tcsh
|
123
123
|
8c8
|
124
124
|
< {{attach_view(hikiutils_bob.002.jpeg,hikiutils_bob)}}
|
125
125
|
---
|
@@ -139,7 +139,7 @@ git remoteにあるoriginのgithubをsafariでopenします.
|
|
139
139
|
|
140
140
|
!!!rake reset_hiki
|
141
141
|
hikiシステムにあるゴミファイルを掃除します.
|
142
|
-
<<<
|
142
|
+
<<< tcsh
|
143
143
|
bob% rake reset_hiki
|
144
144
|
hikiutils: provide utilities for helping hiki editing.
|
145
145
|
"open -a mi"
|
@@ -174,7 +174,6 @@ git init, forkが済んでいると仮定して同期の手順を以下に示す
|
|
174
174
|
|
175
175
|
!!hikiutil関連のヘルプ
|
176
176
|
!!!hikiで卒論を書くときの初期化と掟
|
177
|
-
*開発メモ:figs,dataも作成
|
178
177
|
*目的:西谷が後で迷わないように決まったファイル構造を堅持すべし
|
179
178
|
*文書:hikiで書く.のちには,latexに変換するプログラムを提供します
|
180
179
|
*図表:すべての図表をkeynoteにまとめる,タイトルを分かりやすく書く
|
@@ -188,19 +187,29 @@ git init, forkが済んでいると仮定して同期の手順を以下に示す
|
|
188
187
|
*hikiでのurlはテキスト前とディレクトリーから自動生成される
|
189
188
|
*例えば,hiki2latex_saki/introduciton.hikiとするとhiki2latex_saki_introducitonと変換される
|
190
189
|
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
!!!図表:すべての図表をkeynoteにまとめる,タイトルを分かりやすく書く
|
190
|
+
!!!図表に関する制約
|
191
|
+
*すべての図表をkeynoteにまとめる
|
195
192
|
*keynoteに書いたスライドはイメージに書き出して,rake convert 80 TARGET_DIRでfigsに変換
|
196
193
|
*rake syncでfigsにあるfilesはhiki/target_dirにcpされる
|
197
194
|
*\verb|convert #{source} -resize 20% #{target}によって,target=figs/TAERGET.pngに20%に縮小して保存される|
|
198
195
|
*convert -density 300 view.svg view.pngで300dpiで変換
|
199
|
-
*attach_anchorでは
|
200
|
-
'{{attach_anchor(test.png, hiki2latex_saki)}}'
|
201
|
-
と,directory指定しなければならない.
|
196
|
+
*attach_anchorでは'{{attach_anchor(test.png, hiki2latex_saki)}}'と,directory指定しなければならない.
|
202
197
|
*keynoteであとで図を挿入して番号が変わった時の原稿の一括変換
|
203
198
|
*rake increment 2 boundary_bob.hiki boundary_bob > tmp.hiki
|
204
199
|
*rake convert 60 boundary_bob
|
205
200
|
*rake sync
|
206
|
-
*hiki -u boundary_bob_tmp
|
201
|
+
*hiki -u boundary_bob_tmp
|
202
|
+
|
203
|
+
!!!同期に関する制約
|
204
|
+
*hikiはフラットなdirectory構造を取っている
|
205
|
+
*hikiの文書はスネーク表記(例えば,latex2hiki_saki)で階層構造に似せている
|
206
|
+
*hikiのurlの接頭語となる名前をbasenameのdirectory名とする.
|
207
|
+
*directory名が'hikis'である場合はその親directory名となる.
|
208
|
+
* ~/.hikircのtarget directoryを同期先のdirectoryとする.
|
209
|
+
* ~/.hikircがない場合は同期先のdirectoryを聞く.
|
210
|
+
* それらは./.hikircに保存される
|
211
|
+
|
212
|
+
!!!テキストに関する制約
|
213
|
+
* テキストの拡張子は'.hiki'としている
|
214
|
+
* hikiでのurlはテキスト前とディレクトリーから自動生成される
|
215
|
+
* 例えば,hiki2latex_saki/introduciton.hikiとするとhiki2latex_saki_introducitonと変換される
|
data/lib/hikiutils.rb
CHANGED
@@ -98,7 +98,9 @@ EOS
|
|
98
98
|
cp_files=[['Rakefile_hiki_sync','Rakefile'],
|
99
99
|
['hiki_help.yml','hiki_help.yml'],
|
100
100
|
['head.tex','latex_dir/head.tex'],
|
101
|
-
['pre.tex','latex_dir/pre.tex']
|
101
|
+
['pre.tex','latex_dir/pre.tex'],
|
102
|
+
['jlisting.sty','latex_dir/jlisting.tex'],
|
103
|
+
]
|
102
104
|
cp_files.each_with_index{|files,i|
|
103
105
|
p source = File.join(File.expand_path('..', __FILE__),'templates',files[0])
|
104
106
|
p target = File.join(Dir.pwd,files[1])
|
data/lib/hikiutils.rb~
CHANGED
@@ -64,7 +64,7 @@ EOS
|
|
64
64
|
opt.on('-r', '--rsync','rsync files') {rsync_files}
|
65
65
|
opt.on('--database FILE','read database file') {|file| db_file(file)}
|
66
66
|
opt.on('--display FILE','display converted hikifile') {|file| display(file)}
|
67
|
-
opt.on('-c', '--checkdb','check database file') {check_db}
|
67
|
+
opt.on('-c', '--checkdb','check database file') {check_db}
|
68
68
|
opt.on('--remove FILE','remove file') {|file| remove_file(file)}
|
69
69
|
opt.on('--move FILES','move file1,file2',Array) {|files| move_file(files)}
|
70
70
|
opt.on('--euc FILE','translate file to euc') {|file| euc_file(file) }
|
data/lib/hikiutils/version.rb
CHANGED
@@ -96,18 +96,38 @@ task :mk_toc do
|
|
96
96
|
File.open("toc.hiki",'w'){|file| file.print cont}
|
97
97
|
end
|
98
98
|
|
99
|
-
desc "hiki
|
99
|
+
desc "FILE.hikiあるいはhikiファイルすべてを最新状態に更新"
|
100
100
|
task :touch do
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
101
|
+
if file=ARGV[1]
|
102
|
+
p target = $basename+"_"+file.split('.')[0]
|
103
|
+
system "hiki -u #{target}"
|
104
|
+
else
|
105
|
+
p target = File.join($hiki_dir,'cache','attach',$basename)
|
106
|
+
system "touch #{target}/*"
|
107
|
+
Dir.entries('.').each{|file|
|
108
|
+
file_split=file.split(".")
|
109
|
+
if file_split[1]=='hiki'
|
110
|
+
next if file_split[0]==$basename
|
111
|
+
p target = $basename+"_"+file_split[0]
|
112
|
+
system "hiki -u #{target}"
|
113
|
+
end
|
114
|
+
}
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
desc "FILE.hikiあるいはhikiファイルをedtiorで開く"
|
119
|
+
task :open do
|
120
|
+
if file=ARGV[1]
|
121
|
+
system "open -a mi #{file}"
|
122
|
+
else
|
123
|
+
Dir.entries('.').each{|file|
|
124
|
+
file_split=file.split(".")
|
125
|
+
if file_split[1]=='hiki'
|
126
|
+
p target = file_split[0]
|
127
|
+
system "open -a mi #{target}"
|
128
|
+
end
|
129
|
+
}
|
130
|
+
end
|
111
131
|
end
|
112
132
|
|
113
133
|
desc "FILE1をlatexに変換"
|
@@ -175,7 +195,7 @@ task :latex_all do
|
|
175
195
|
toc = false
|
176
196
|
File.readlines(File.join($latex_dir,"#{main_file}.tex")).each{|line|
|
177
197
|
line, toc = "", true if line.match(/\\tableofcontents/) and toc == true #only one
|
178
|
-
|
198
|
+
line ="\\usepackage{listings,jlisting}" if line.match(/\\usepackage{listings}/)
|
179
199
|
if line.match(/section{(.+)}/)
|
180
200
|
if m=line.match(/\\verb\|(.+)\((.+)\)\|/)
|
181
201
|
p m
|
@@ -0,0 +1,216 @@
|
|
1
|
+
\NeedsTeXFormat{LaTeX2e}
|
2
|
+
\def\filedate{2006/02/20}
|
3
|
+
\def\fileversion{0.2}
|
4
|
+
\ProvidesPackage{jlisting}[\filedate\space\fileversion\space(Thor)]
|
5
|
+
%
|
6
|
+
\newcount\lst@nextchar
|
7
|
+
\let\lst@@ProcessSpace\lst@ProcessSpace
|
8
|
+
\def\lst@ProcessSpace#1{%
|
9
|
+
\lst@check@chartype{#1}%
|
10
|
+
\lst@@ProcessSpace
|
11
|
+
\lst@whitespacetrue}
|
12
|
+
\let\lst@@ProcessLetter\lst@ProcessLetter
|
13
|
+
\def\lst@ProcessLetter#1#2{%
|
14
|
+
\lst@check@chartype{#2}%
|
15
|
+
{\lst@@ProcessLetter{#1}}%
|
16
|
+
\relax}
|
17
|
+
\let\lst@@ProcessDigit\lst@ProcessDigit
|
18
|
+
\def\lst@ProcessDigit#1#2{%
|
19
|
+
\lst@check@chartype{#2}%
|
20
|
+
{\lst@@ProcessDigit{#1}}%
|
21
|
+
\relax}
|
22
|
+
\let\lst@@ProcessOther\lst@ProcessOther
|
23
|
+
\def\lst@ProcessOther#1#2{%
|
24
|
+
\lst@check@chartype{#2}%
|
25
|
+
{\lst@@ProcessOther{#1}}%
|
26
|
+
\relax}
|
27
|
+
\let\lst@@ProcessTabulator\lst@ProcessTabulator
|
28
|
+
\def\lst@ProcessTabulator#1{%
|
29
|
+
\lst@check@chartype{#1}%
|
30
|
+
\lst@@ProcessTabulator
|
31
|
+
\relax}
|
32
|
+
\def\lst@check@chartype#1#2#3{%
|
33
|
+
\edef\@tempa{\lst@nextchar=`\string#1\relax}%
|
34
|
+
\afterassignment\remove@to@nnil
|
35
|
+
\@tempa\@nnil
|
36
|
+
#2%
|
37
|
+
\ifnum\lst@nextchar<\@cclvi
|
38
|
+
#3%
|
39
|
+
\else
|
40
|
+
\lst@ifletter \else \lst@OutputOther \fi
|
41
|
+
\lst@whitespacefalse
|
42
|
+
\expandafter\lst@AppendJchar
|
43
|
+
\fi
|
44
|
+
#1}
|
45
|
+
\def\lst@AppendJchar#1#2{%
|
46
|
+
\lst@check@chartype{#2}%
|
47
|
+
{\advance\lst@length\@ne\lst@Append{#1}}%
|
48
|
+
\relax}
|
49
|
+
\def\lst@check@chartype@BOL#1{%
|
50
|
+
\edef\@tempa{\lst@nextchar=`\string#1\relax}%
|
51
|
+
\afterassignment\remove@to@nnil
|
52
|
+
\@tempa\@nnil
|
53
|
+
\ifnum\lst@nextchar<\@cclvi\else
|
54
|
+
\lst@whitespacefalse
|
55
|
+
\expandafter\lst@AppendJchar
|
56
|
+
\fi
|
57
|
+
#1}
|
58
|
+
\def\lst@InputListing#1{%
|
59
|
+
\begingroup
|
60
|
+
\lsthk@PreSet \gdef\lst@intname{#1}%
|
61
|
+
\expandafter\lstset\expandafter{\lst@set}%
|
62
|
+
\lsthk@DisplayStyle
|
63
|
+
\catcode\active=\active
|
64
|
+
\lst@Init\relax \let\lst@gobble\z@
|
65
|
+
\lst@SkipToFirst
|
66
|
+
\lst@ifprint \def\lst@next{\lst@get@filecontents{#1}}%
|
67
|
+
\else \let\lst@next\@empty
|
68
|
+
\fi
|
69
|
+
\lst@next
|
70
|
+
\lst@DeInit
|
71
|
+
\endgroup}
|
72
|
+
\newread\lst@inputfile
|
73
|
+
\def\lst@get@filecontents#1{%
|
74
|
+
\let\lst@filecontents\@empty
|
75
|
+
\openin\lst@inputfile=#1\relax
|
76
|
+
\let\@lst@get@filecontents@prevline\relax
|
77
|
+
\lst@get@filecontents@loop
|
78
|
+
\closein\lst@inputfile
|
79
|
+
\lst@filecontents\empty}
|
80
|
+
\def\lst@get@filecontents@loop{%
|
81
|
+
\read\lst@inputfile to\@lst@get@filecontents@currline
|
82
|
+
\ifx\@lst@get@filecontents@prevline\relax\else
|
83
|
+
\expandafter\expandafter\expandafter\def
|
84
|
+
\expandafter\expandafter\expandafter\lst@filecontents
|
85
|
+
\expandafter\expandafter\expandafter{%
|
86
|
+
\expandafter\lst@filecontents\@lst@get@filecontents@prevline}%
|
87
|
+
\fi
|
88
|
+
\let\@lst@get@filecontents@prevline\@lst@get@filecontents@currline
|
89
|
+
\ifeof\lst@inputfile\else
|
90
|
+
\expandafter\lst@get@filecontents@loop
|
91
|
+
\fi}
|
92
|
+
%%% [$B$3$N=hM}$b!$AjEv6/0z$G$9!%(B]
|
93
|
+
\def\lst@BOLGobble{%
|
94
|
+
\ifnum\lst@gobble>\z@
|
95
|
+
\@tempcnta\lst@gobble\relax
|
96
|
+
\expandafter\lst@BOLGobble@
|
97
|
+
\else
|
98
|
+
\expandafter\lst@check@chartype@BOL
|
99
|
+
\fi}
|
100
|
+
\def\lst@BOLGobble@#1{%
|
101
|
+
\let\lst@next#1%
|
102
|
+
\ifx \lst@next\relax\else
|
103
|
+
\ifx \lst@next\lst@MProcessListing\else
|
104
|
+
\ifx \lst@next\lst@ProcessFormFeed\else
|
105
|
+
\ifx \lst@next\lstenv@backslash
|
106
|
+
\let\lst@next\lstenv@BOLGobble@@
|
107
|
+
\else
|
108
|
+
\let\lst@next\lst@BOLGobble@@
|
109
|
+
\ifx #1\lst@ProcessTabulator
|
110
|
+
\advance\@tempcnta-\lst@tabsize\relax
|
111
|
+
\ifnum\@tempcnta<\z@
|
112
|
+
\lst@length-\@tempcnta \lst@PreGotoTabStop
|
113
|
+
\fi
|
114
|
+
\else
|
115
|
+
\edef\@tempa{\lst@nextchar=`\string#1\relax}%
|
116
|
+
\@tempa
|
117
|
+
\ifnum\lst@nextchar<\@cclvi\else
|
118
|
+
\advance\@tempcnta\m@ne
|
119
|
+
\fi
|
120
|
+
\advance\@tempcnta\m@ne
|
121
|
+
\fi
|
122
|
+
\fi \fi \fi \fi
|
123
|
+
\lst@next}
|
124
|
+
\def\lst@BOLGobble@@{%
|
125
|
+
\ifnum\@tempcnta>\z@
|
126
|
+
\expandafter\lst@BOLGobble@
|
127
|
+
\else
|
128
|
+
\expandafter\lst@check@chartype@BOL
|
129
|
+
\fi
|
130
|
+
}
|
131
|
+
%
|
132
|
+
% \begin{$B=$@5;v9`(B}{1.3}
|
133
|
+
% $B$A$g$C$H$7$?=$@5(B
|
134
|
+
\gdef\lst@breakProcessOther#1{\lst@ProcessOther#1}
|
135
|
+
% $B%=!<%9%3!<%IL\<!$K$*$1$kJ8;z$HHV9f$N6u$-(B
|
136
|
+
\let \l@lstlisting = \l@figure
|
137
|
+
% $B%-%c%W%7%g%s$H%=!<%9%3!<%IL\<!$KBP$9$kF|K\8lBP1~(B
|
138
|
+
\def\lstlistingname{$B%=!<%9%3!<%I(B}
|
139
|
+
\def\lstlistlistingname{$B%=!<%9%3!<%IL\<!(B}
|
140
|
+
% \end{$B=$@5;v9`(B}
|
141
|
+
\endinput
|
142
|
+
%
|
143
|
+
%#!platex
|
144
|
+
\documentclass[papersize]{jsarticle}
|
145
|
+
% Macros
|
146
|
+
\IfFileExists{dvipdfmx.def}{%
|
147
|
+
\usepackage[dvipdfmx]{color,graphicx}%
|
148
|
+
}{%
|
149
|
+
\usepackage[dvipdfm]{color,graphicx}%
|
150
|
+
}
|
151
|
+
\usepackage{listings}[2004/09/07]
|
152
|
+
\usepackage{jlisting}[2006/02/20]
|
153
|
+
\usepackage{url}
|
154
|
+
\usepackage{verbatim}
|
155
|
+
|
156
|
+
\makeatletter
|
157
|
+
% Original Macros
|
158
|
+
\def\email#1{\gdef\@email{\texttt{#1}}}
|
159
|
+
\def\homepage#1{\gdef\@homepage{\texttt{#1}}}
|
160
|
+
\def\mac#1{\textsf{#1}}
|
161
|
+
\def\URL#1{\texttt{#1}}
|
162
|
+
\def\src#1{\texttt{#1}}
|
163
|
+
|
164
|
+
% Dvipdfmx.def
|
165
|
+
\def\dvipdfmxDefi{http://tex.dante.jp/ok/dvipdfmx/}
|
166
|
+
\def\dvipdfmxDefii{http://ftp.ktug.or.kr/KTUG/dvipdfmx/contrib/latex/}
|
167
|
+
|
168
|
+
\IfFileExists{dvipdfmx.def}{%
|
169
|
+
\let \IfDvipdfmxDef = \empty \relax}{%
|
170
|
+
\typeout{^^Jget dvipdfmx.def at \dvipdfmxDefi^^J
|
171
|
+
or \dvipdfmxDefii^^J}%
|
172
|
+
\def\IfDvipdfmxDef{Get \src{dvipdfmx.def} at \URL \dvipdfmxDefii \\
|
173
|
+
or \URL \dvipdfmxDefi.}%
|
174
|
+
}
|
175
|
+
|
176
|
+
% Author Info
|
177
|
+
\author {Th\'or Watanabe\thanks \@email \space \thanks \@homepage}
|
178
|
+
\title {\mac{jlisting.sty}\\
|
179
|
+
---Japanese Localized Patch File of \mac{listings}---}
|
180
|
+
\email {thor@tex.dante.jp}
|
181
|
+
\homepage {http://tex.dante.jp/typo/}
|
182
|
+
\date {2006/02/20}
|
183
|
+
|
184
|
+
\makeatother
|
185
|
+
|
186
|
+
\begin{document}
|
187
|
+
\maketitle
|
188
|
+
%\IfDvipdfmxDef
|
189
|
+
|
190
|
+
\section{$B$A$g$C$H$7$?@bL@(B}% Short Description
|
191
|
+
|
192
|
+
$B1|B<@2I';a$N7G<(HD$N!VHFMQE*$JIbF0BN!W$H$$$&0lO"$N=q$-9~$_$+$i(B
|
193
|
+
$BE>:\$7$^$7$?!#(B
|
194
|
+
|
195
|
+
\begin{quote}
|
196
|
+
\url{http://http://cise.edu.mie-u.ac.jp/~okumura/texfaq/qa/21172.html}\\
|
197
|
+
\url{http://http://cise.edu.mie-u.ac.jp/~okumura/texfaq/qa/21184.html}\\
|
198
|
+
\url{http://http://cise.edu.mie-u.ac.jp/~okumura/texfaq/qa/21189.html}\\
|
199
|
+
\url{http://http://cise.edu.mie-u.ac.jp/~okumura/texfaq/qa/21197.html}
|
200
|
+
\end{quote}
|
201
|
+
|
202
|
+
Copyright $B$O5H1JE/H~;a$K$"$k$N$@$H;W$$$^$9!%(B
|
203
|
+
|
204
|
+
\section{$B99?7MzNr(B}% ChageLogs
|
205
|
+
|
206
|
+
\begin{description}
|
207
|
+
\item[ver.~0.1 (2004/03/24)]
|
208
|
+
$B$H$j$"$($:8x3+!%(B
|
209
|
+
\item[ver.~0.2 (2006/02/20)]
|
210
|
+
\verb|\lst@breakProcessOther| $BL?Na$NDj5A$NDI2C!%(B
|
211
|
+
\end{description}
|
212
|
+
|
213
|
+
\section{$B%=!<%9%3!<%I(B}
|
214
|
+
\par\narrowbaselines
|
215
|
+
\verbatiminput{jlisting.sty}
|
216
|
+
\end{document}
|