-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
152 lines (83 loc) · 4.38 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
TeXMathSym2PDF
Extract and translate Math expressions/symbols in TeX files to PDF files
one by one
* Author:
shigeyas, Septermber 2009
Contact via http://github.com/shigeyas/
* Credits:
This work is inspired by OmniGraffle Equation support:
http://macinscience.org/?p=12
* Requirements:
Ruby 1.9
latex (LaTeX2e)
dvips
epstopdf
Assuming latex, dvips and epstopdf are in invoker's shell path.
* Running:
Run by
ruby extmath.rb TeX-Files
Default action is, scan given TeX file and creating PDF file in ./Temp
directory, one by one, under the name with the hash(MD5) value of the
TeX representation of the symbol. For example,
C_n
will generate
0a22604c6270cafda16d1bee51963ab4.pdf
Note that, C_n and C_{n} will create same output but this program does
not detect braces nor spaces which TeX will ignore in glyph sense, but
it will cause create different file. Note that multiple white-spaces
in the expression are compressed into single space, before use as
symbol value.
All of the mapping of the hash (file name and the symbol will be
written in symbol-map.txt file. This file contains tab separated values
of hash value and the symbol, in the order of hash (alphabetically sorted).
Additionally, you can create math-preamble.tex in the PDF output
directory which will be included in the preamble of each TeX run (file
name can be specified via -i option). Using this, you can use some
macros in the math descriptions.
* Options
-F, --force Force recreate all files
By default, this program do not re-create PDF if there is one for that
symbol. This option override that behavior to force create all outputs.
(Since file name is created from hash of the TeX math representation,
it is safe to assume output is same unless resolution parameter is same)
-N, --no-map Don't create symbol-map.txt file
Do not create math-index.map file
-m, --map MAP create map file with name (Default: symbol-map.txt)
Specify file name of the file name to symbol map text file and create it.
-o, --tex-map TEX create map file with name (Default: symbol-map.tex)
Specify file name of the file name to symbol map TeX file and create it.
-s, --size SIZE specify size parameter (default:Huge)
Specify the font parameter to be used. Use LaTeX size spec here
-r, --resolution RESOLUTION Output resolution (default:600)
Specify the output resolution in dots per inch, which passed to dvips command.
-p, --path PATH Directory to generate PDF (default: ./Temp)
Specify the path of the directory for the output.
-i, --include PREAMBLE Include this file in TeX preamble if exists (default: math-preamble.tex)
Specify the file to be included as the preamble section of TeX file to be processed,
if the file exists. You can specify macros and such in this file.
-T, --retain-tex Retain TeX output file
Don't remove .tex file after processing.
-E, --retain-ps Retain PS output file
Don't remove .ps file after processing
-P, --no-pdf don't output PDF file
Don't create PDF files. You may combine -E -P to create PostScript file only.
-J, --japanese Configure for Japanese environment
Use 'platex' instead of 'latex'
-L, --by-line Output only by line in eqnarray
-B, --by-box Output only by box in eqnarray
-A, --by-box-line Output both box and line-by-line in eqnarray
-I, --by-box-line-item Output each item in eqnarray row/column
By default all of the eqnarray output will be generated per eqnarray block.
-L force output by line by line only. -B specify output in box only(default)
And -A output both boxes and lines, -S output boxes, lines and items.
* Japanese Support
Use '-J' option to use platex instead of latex. The code have support
for character encodings, but it is currently configured to treat all
external files as binary file and does not translate any.
* MacOS X NOTE
I observed if I open folder which is the target folder of this script,
Finder of the Snow Leopard might stop responding, while it is keep trying
to detect status of appearing/disappearing of temporary files. If
such happen, just re-launch Finder.
* TODO:
- Possibly provide support for other eqnarray like environment.