hwp_script_to_latex 1.3.1 → 1.3.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/lib/hwp_script_to_latex/converter.rb +5 -1
- data/lib/hwp_script_to_latex/version.rb +1 -1
- data/rules.json +24 -16
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9457b27d76521004d597bf1727c63134750f4ec2c97d37f09376c07621bc6393
|
4
|
+
data.tar.gz: 64a1a847acb472acf5832d7e49fb7c4f0320241523d3d07472c1e68404f74759
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6ebdb46f5cd1d58d46043b4ba5bb06474cab35dfbd5fd40c263b28914e7a79b0c2ca3390b5829690df698789291daf0f764a475f199f1db1f32f3df4516d4ac
|
7
|
+
data.tar.gz: c946d7e91427f6963a3a9d250f9b03b1569aee8315aee35042d631ef0c98631182328dfe30a39170b91db39b2dc08c2f41ecda25daf65874a1d6b734d45f7da4
|
@@ -67,6 +67,10 @@ module HwpScriptToLatex
|
|
67
67
|
script = script.gsub(/\s+/, " ").strip
|
68
68
|
# 백슬래시를 rm으로 치환
|
69
69
|
script = script.gsub(/\\/, " \\rm ")
|
70
|
+
# 위, 아래 첨자 명령어로 변경
|
71
|
+
script = script.gsub(/_/, " sub ")
|
72
|
+
script = script.gsub(/\^/, " sup ")
|
73
|
+
|
70
74
|
return script
|
71
75
|
end
|
72
76
|
|
@@ -86,7 +90,7 @@ module HwpScriptToLatex
|
|
86
90
|
match_data = script.match(command_regex)
|
87
91
|
while match_data
|
88
92
|
right_term = remove_curly_brackets(match_data[right_term_group_name])
|
89
|
-
script = script.sub(command_regex, "
|
93
|
+
script = script.sub(command_regex, " #{command[:latex]} {%{#{right_term_group_name}}} " % {
|
90
94
|
"#{right_term_group_name}".to_sym => right_term
|
91
95
|
})
|
92
96
|
match_data = script.match(command_regex)
|
data/rules.json
CHANGED
@@ -9,69 +9,77 @@
|
|
9
9
|
],
|
10
10
|
"command": {
|
11
11
|
"simple": [
|
12
|
+
{
|
13
|
+
"script": "sub",
|
14
|
+
"latex": "_"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"script": "sup",
|
18
|
+
"latex": "^"
|
19
|
+
},
|
12
20
|
{
|
13
21
|
"script": "box",
|
14
|
-
"latex": "fbox"
|
22
|
+
"latex": "\\fbox"
|
15
23
|
},
|
16
24
|
{
|
17
25
|
"script": "arch",
|
18
|
-
"latex": "stackrel\\frown"
|
26
|
+
"latex": "\\stackrel\\frown"
|
19
27
|
},
|
20
28
|
{
|
21
29
|
"script": "bar",
|
22
|
-
"latex": "overline"
|
30
|
+
"latex": "\\overline"
|
23
31
|
},
|
24
32
|
{
|
25
33
|
"script": "overline",
|
26
|
-
"latex": "overline"
|
34
|
+
"latex": "\\overline"
|
27
35
|
},
|
28
36
|
{
|
29
37
|
"script": "acute",
|
30
|
-
"latex": "acute"
|
38
|
+
"latex": "\\acute"
|
31
39
|
},
|
32
40
|
{
|
33
41
|
"script": "grave",
|
34
|
-
"latex": "grave"
|
42
|
+
"latex": "\\grave"
|
35
43
|
},
|
36
44
|
{
|
37
45
|
"script": "check",
|
38
|
-
"latex": "check"
|
46
|
+
"latex": "\\check"
|
39
47
|
},
|
40
48
|
{
|
41
49
|
"script": "breve",
|
42
|
-
"latex": "breve"
|
50
|
+
"latex": "\\breve"
|
43
51
|
},
|
44
52
|
{
|
45
53
|
"script": "tilde",
|
46
|
-
"latex": "tilde"
|
54
|
+
"latex": "\\tilde"
|
47
55
|
},
|
48
56
|
{
|
49
57
|
"script": "hat",
|
50
|
-
"latex": "hat"
|
58
|
+
"latex": "\\hat"
|
51
59
|
},
|
52
60
|
{
|
53
61
|
"script": "widehat",
|
54
|
-
"latex": "widehat"
|
62
|
+
"latex": "\\widehat"
|
55
63
|
},
|
56
64
|
{
|
57
65
|
"script": "vec",
|
58
|
-
"latex": "vec"
|
66
|
+
"latex": "\\vec"
|
59
67
|
},
|
60
68
|
{
|
61
69
|
"script": "dot(?!eq)",
|
62
|
-
"latex": "dot"
|
70
|
+
"latex": "\\dot"
|
63
71
|
},
|
64
72
|
{
|
65
73
|
"script": "ddot(?!s)",
|
66
|
-
"latex": "ddot"
|
74
|
+
"latex": "\\ddot"
|
67
75
|
},
|
68
76
|
{
|
69
77
|
"script": "dyad",
|
70
|
-
"latex": "overleftrightarrow"
|
78
|
+
"latex": "\\overleftrightarrow"
|
71
79
|
},
|
72
80
|
{
|
73
81
|
"script": "under",
|
74
|
-
"latex": "underline"
|
82
|
+
"latex": "\\underline"
|
75
83
|
}
|
76
84
|
],
|
77
85
|
"matrix": [
|