pandoc_refeq_mathml 0.1 → 0.2
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/.gitignore +1 -0
- data/ChangeLog +7 -0
- data/README.en.rdoc +31 -10
- data/doc/PandocRefeqMathml.html +1428 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +497 -0
- data/doc/file.README.en.html +262 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +262 -0
- data/doc/js/app.js +314 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +139 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/pandoc_refeq_mathml.rb +38 -11
- data/pandoc_refeq_mathml.gemspec +9 -9
- data/test/data/.gitignore +10 -0
- data/test/data/Makefile +32 -0
- data/test/data/shifted-numbered-headings.lua +17 -0
- data/test/data/try01.html +115 -0
- data/test/data/try01_latex.aux +32 -0
- data/test/data/try01_tmpl.tex +96 -0
- data/test/test_pandoc_refeq_mathml.rb +22 -15
- metadata +24 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fccfc0c2de3bd94a386b58eecb7b7935958f3823909ab6f4cd2fa9d53d627c1
|
4
|
+
data.tar.gz: 5ff2f67a9d5b076a82a716b8a2e8fb9fab9ced72744ad1400125d7c67774e8d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0be3c4c19a93cf55eac01488bc35845638209d5a34a99e408610bbb139e2206f3e410424b08560539ed62ce866bb1cb14520521bdb6e4fbf0ed6dedc4fc16db9
|
7
|
+
data.tar.gz: b3a64421f62bd0b1b8d5afe7dc154abac8a4a633d252805f4673450f2a1db1b61f77a1558b1fcccfb3551cf3df22dba410c36b2d9e1c84bddca12452f18f74b1
|
data/.gitignore
CHANGED
data/ChangeLog
CHANGED
data/README.en.rdoc
CHANGED
@@ -18,8 +18,7 @@ Another caveat is the alignments of equations in the <tt>eqnarray</tt> environme
|
|
18
18
|
|
19
19
|
This tool is a bit of ad hoc (dirty) hack to correct these points
|
20
20
|
*in some basic situations*. "Basic" here means just the standard
|
21
|
-
LaTeX commands, not some package-specific commands.
|
22
|
-
correctly handle complicated formats of equations, using arrays etc.
|
21
|
+
LaTeX commands, not some external package-specific commands.
|
23
22
|
|
24
23
|
The full package of this module is found in
|
25
24
|
{PandocRefeqMathml Ruby Gems page}[http://rubygems.org/gems/pandoc_refeq_mathml]
|
@@ -29,16 +28,33 @@ in {Github}[https://github.com/masasakano/pandoc_refeq_mathml]
|
|
29
28
|
== Background and constraints
|
30
29
|
|
31
30
|
Pandoc-converted MathML.html from LaTeX lacks equation numbers that
|
32
|
-
are present in the original LaTeX.
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
31
|
+
are present in the original LaTeX. The {pandoc-crossref}[https://github.com/lierdakil/pandoc-crossref]
|
32
|
+
offers a way to tackle the problem; however its fix is far from
|
33
|
+
perfect with three or four major caveats.
|
34
|
+
|
35
|
+
1. A single number is assigned to the whole set of equations in an
|
36
|
+
+eqnarray+ environment, which is inconsistent with LaTeX.
|
37
|
+
2. The LaTeX +\\nonumber+ is not taken into account.
|
38
|
+
3. Referencing text to an equation displays the original LaTeX label, as opposed to
|
39
|
+
the equation number, which makes no sense to readers.
|
40
|
+
4. Because of points (1) and (2), the given equation numbers usually do not
|
41
|
+
agree at all with the original document compiled by LaTeX.
|
42
|
+
|
43
|
+
In LaTeX, you may reference equation 1 and 3 in a single +eqnarray+
|
44
|
+
environment separately. However, because of point (1), it would not be possible
|
45
|
+
in pandoc-generated MathML. Besides, since they are not referenced
|
46
|
+
with equation numbers in the MathML (point 3) in the first place.
|
47
|
+
|
48
|
+
This tool (command-line command) offers a way to fix these problems, albeit in a crude way.
|
49
|
+
The command adds equation numbers that are guessed from the text in
|
50
|
+
the annotation fields in +<math>+ and LaTeX aux file (the latter of
|
51
|
+
which is automatically generated as a byproduct when you compile a
|
52
|
+
LaTeX document). Not all the numbers are recovered but only those
|
53
|
+
that are referenced somewhere in the MathML file.
|
38
54
|
|
39
55
|
(Note that in principle, it should not be too difficult to modify the program so
|
40
56
|
that all the labelled equations in LaTeX are labelled again in
|
41
|
-
MathML.
|
57
|
+
MathML. Nevertheless, it would be tricky to label equations that are not
|
42
58
|
explicitly labelled in LaTeX because implicit numbering information is not
|
43
59
|
available in the LaTeX aux file.)
|
44
60
|
|
@@ -123,7 +139,7 @@ equations that contains the relevant equation (for LaTeX
|
|
123
139
|
numbers inside a pair of parentheses are always located at the right
|
124
140
|
edge of a page in default.
|
125
141
|
|
126
|
-
== How to use
|
142
|
+
== How to use the command
|
127
143
|
|
128
144
|
Once you have installed it according to the standard RubyGems procedure
|
129
145
|
(see section Install), the main Ruby executable (command) <tt>pandoc_refeq_mathml</tt>
|
@@ -169,6 +185,11 @@ The help doc for the command-line interface is displayed with +-h+ (or +--help+)
|
|
169
185
|
% pandoc_refeq_mathml --aux=mydoc.aux --log=error.log mydoc.html > revised1.html
|
170
186
|
% head -n 90 mydoc.html | pandoc_refeq_mathml --aux=mydoc.aux --no-fixalign > revised2.html
|
171
187
|
|
188
|
+
Also, in the +test/data/+ directory, there is a sample LaTeX file. You
|
189
|
+
can run +make+ in the directory to generate and correct a HTML/MathML
|
190
|
+
file. Read the comment in the +Makefile+ to see options, such as the
|
191
|
+
LaTeX executable in your environment.
|
192
|
+
|
172
193
|
== Install
|
173
194
|
|
174
195
|
Standard Ruby-gem install procedure is suffice
|