hwp_script_to_latex 1.3.3 → 1.3.4
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 +4 -0
- data/lib/hwp_script_to_latex/version.rb +1 -1
- data/rules.json +13 -3
- 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: 522017c4a1e98470ae701964b297ac90b3907e2ad6a2fc3210a9af6c20453cd9
|
4
|
+
data.tar.gz: 657dce68cf0043a13db0e999f1a10556cd8b0bce9899fbf3624f7b5b6d211845
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3aa22b50be009b53bbc0369725348d7a754e1574cd36c2ecfacee62898dce63634fc7211e565d414687ef691dfdfe0582fe77354fc71b3b1de8ed21c93e43edc
|
7
|
+
data.tar.gz: e0d050f995d6c92f99bba993bc6d0d384255460dafed58f5153233f618f49fa5a93e30bcb0e35333984565f2ea63fa25dc68367c2c884c7091e8b0af50e6d17a
|
@@ -24,6 +24,7 @@ module HwpScriptToLatex
|
|
24
24
|
def convert(script, math_mode: false, display_mode: false)
|
25
25
|
# Sanitize for starting convert
|
26
26
|
result = pre_sanitize(script)
|
27
|
+
puts result
|
27
28
|
# 키워드 치환
|
28
29
|
result = replace_keywords(result)
|
29
30
|
# Simple Command 치환
|
@@ -67,6 +68,9 @@ module HwpScriptToLatex
|
|
67
68
|
script = script.gsub(/\s+/, " ").strip
|
68
69
|
# 백슬래시를 rm으로 치환
|
69
70
|
script = script.gsub(/\\/, " \\rm ")
|
71
|
+
# 꺽쇠 치환
|
72
|
+
script = script.gsub(/</, "<")
|
73
|
+
script = script.gsub(/>/, ">")
|
70
74
|
# 위, 아래 첨자 명령어로 변경
|
71
75
|
script = script.gsub(/_/, " sub ")
|
72
76
|
script = script.gsub(/\^/, " sup ")
|
data/rules.json
CHANGED
@@ -104,10 +104,20 @@
|
|
104
104
|
"keyword": {
|
105
105
|
"meta": [
|
106
106
|
{
|
107
|
-
"regex": "(?<![a-zA-Z])(?i:left|right)\\b\\s*+(?:(?=[^{}\\[\\]\\|\\(\\)])|(?:$))",
|
107
|
+
"regex": "(?<![a-zA-Z])(?i:left|right)\\b\\s*+(?:(?=[^{}\\[\\]\\|\\(\\)<>])|(?:$))",
|
108
108
|
"latex": "",
|
109
109
|
"alphabetic": false
|
110
110
|
},
|
111
|
+
{
|
112
|
+
"regex": "(?<![a-zA-Z])(?i:left)\\s*<",
|
113
|
+
"latex": " \\langle ",
|
114
|
+
"alphabetic": false
|
115
|
+
},
|
116
|
+
{
|
117
|
+
"regex": "(?<![a-zA-Z])(?i:right)\\s*>",
|
118
|
+
"latex": " \\rangle ",
|
119
|
+
"alphabetic": false
|
120
|
+
},
|
111
121
|
{
|
112
122
|
"regex": "(?<![a-zA-Z])(?i:left)\\s*\\[",
|
113
123
|
"latex": " \\left [ ",
|
@@ -588,12 +598,12 @@
|
|
588
598
|
"alphabetic": false
|
589
599
|
},
|
590
600
|
{
|
591
|
-
"regex": "(?<![
|
601
|
+
"regex": "(?<![>\\-])(?:(?<!\\s)>|>(?!\\s))(?![=>])",
|
592
602
|
"latex": " > ",
|
593
603
|
"alphabetic": false
|
594
604
|
},
|
595
605
|
{
|
596
|
-
"regex": "(?<![
|
606
|
+
"regex": "(?<![s<])(?:(?<!\\s)<|<(?!\\s))(?![<=])",
|
597
607
|
"latex": " < ",
|
598
608
|
"alphabetic": false
|
599
609
|
},
|