pyeasyphd 0.0.5__py3-none-any.whl → 0.0.7__py3-none-any.whl
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.
Potentially problematic release.
This version of pyeasyphd might be problematic. Click here for more details.
pyeasyphd/main/pandoc_md_to.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import copy
|
|
2
2
|
import os
|
|
3
3
|
import re
|
|
4
|
+
import subprocess
|
|
4
5
|
import time
|
|
5
6
|
from typing import Dict, List, Optional, Tuple
|
|
6
7
|
|
|
@@ -67,20 +68,20 @@ class PandocMdTo(BasicInput):
|
|
|
67
68
|
if os.path.exists(self.full_csl_style_pandoc):
|
|
68
69
|
cmd = (
|
|
69
70
|
f"pandoc {full_md_one} -t {self.markdown_citation} "
|
|
70
|
-
f
|
|
71
|
-
f"
|
|
71
|
+
f"-o {full_md_two} -M reference-section-title='References' "
|
|
72
|
+
f"--citeproc --bibliography={path_bib} --csl={self.full_csl_style_pandoc} --columns {self.columns_in_md}"
|
|
72
73
|
)
|
|
73
74
|
else:
|
|
74
75
|
cmd = (
|
|
75
76
|
f"pandoc {full_md_one} -t {self.markdown_citation} "
|
|
76
|
-
f
|
|
77
|
-
f"
|
|
77
|
+
f"-o {full_md_two} -M reference-section-title='References' "
|
|
78
|
+
f"--citeproc --bibliography={path_bib} --columns {self.columns_in_md}"
|
|
78
79
|
)
|
|
79
80
|
|
|
80
81
|
try:
|
|
81
|
-
|
|
82
|
-
except
|
|
83
|
-
print("pandoc md to md:", e)
|
|
82
|
+
subprocess.run(cmd, shell=True, check=True, capture_output=True, text=True)
|
|
83
|
+
except subprocess.CalledProcessError as e:
|
|
84
|
+
print("Pandoc error in pandoc md to md:", e.stderr)
|
|
84
85
|
|
|
85
86
|
if not os.path.exists(full_md_two):
|
|
86
87
|
print(f"- pandoc false from md to md: {os.path.basename(full_md_two)}\n")
|
|
@@ -114,13 +115,15 @@ class PandocMdTo(BasicInput):
|
|
|
114
115
|
if not os.path.exists(path_tex := os.path.dirname(full_tex)):
|
|
115
116
|
os.makedirs(path_tex)
|
|
116
117
|
|
|
118
|
+
if template_name.lower() == "beamer":
|
|
119
|
+
cmd = f"pandoc {full_md} -t beamer -o {full_tex} --from markdown "
|
|
120
|
+
else:
|
|
121
|
+
cmd = f"pandoc {full_md} -o {full_tex} --from markdown "
|
|
122
|
+
|
|
117
123
|
try:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
os.system(f"pandoc {full_md} -o {full_tex} --from markdown ")
|
|
122
|
-
except Exception as e:
|
|
123
|
-
print("pandoc md to tex:", e)
|
|
124
|
+
subprocess.run(cmd, shell=True, check=True, capture_output=True, text=True)
|
|
125
|
+
except subprocess.CalledProcessError as e:
|
|
126
|
+
print("Pandoc error in pandoc md to tex:", e.stderr)
|
|
124
127
|
|
|
125
128
|
if not os.path.exists(full_tex):
|
|
126
129
|
print(f"- pandoc false from md to tex: {os.path.basename(full_md)}\n")
|
|
@@ -152,9 +155,9 @@ class PandocMdTo(BasicInput):
|
|
|
152
155
|
cmd = f"pandoc {full_md} -o {full_html} --from markdown "
|
|
153
156
|
|
|
154
157
|
try:
|
|
155
|
-
|
|
156
|
-
except
|
|
157
|
-
print("pandoc md to html:", e)
|
|
158
|
+
subprocess.run(cmd, shell=True, check=True, capture_output=True, text=True)
|
|
159
|
+
except subprocess.CalledProcessError as e:
|
|
160
|
+
print("Pandoc error in pandoc md to html:", e.stderr)
|
|
158
161
|
|
|
159
162
|
if not os.path.exists(full_html):
|
|
160
163
|
return f"- pandoc false from md to html: {os.path.basename(full_md)}\n"
|
|
@@ -189,9 +192,9 @@ class PandocMdTo(BasicInput):
|
|
|
189
192
|
cmd = f"pandoc {full_md} -o {full_pdf} --from markdown --listings --pdf-engine=xelatex"
|
|
190
193
|
|
|
191
194
|
try:
|
|
192
|
-
|
|
193
|
-
except
|
|
194
|
-
print("pandoc md to pdf:", e)
|
|
195
|
+
subprocess.run(cmd, shell=True, check=True, capture_output=True, text=True)
|
|
196
|
+
except subprocess.CalledProcessError as e:
|
|
197
|
+
print("Pandoc error in pandoc md to pdf:", e.stderr)
|
|
195
198
|
|
|
196
199
|
if not os.path.exists(full_pdf):
|
|
197
200
|
return f"- pandoc false from md to pdf: {os.path.basename(full_md)}\n"
|
pyeasyphd/main/python_run_tex.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import re
|
|
3
|
+
import subprocess
|
|
3
4
|
from typing import Any, Dict, List, Optional
|
|
4
5
|
|
|
5
6
|
from pyadvtools import (
|
|
@@ -133,10 +134,11 @@ class PythonRunTex(BasicInput):
|
|
|
133
134
|
# run latex
|
|
134
135
|
if self.run_latex:
|
|
135
136
|
os.chdir(path_output)
|
|
137
|
+
cmd = "latexmk -{} {}".format(self.pdflatex_xelatex, main_name)
|
|
136
138
|
try:
|
|
137
|
-
|
|
138
|
-
except
|
|
139
|
-
print(e)
|
|
139
|
+
subprocess.run(cmd, shell=True, check=True, capture_output=True, text=True)
|
|
140
|
+
except subprocess.CalledProcessError as e:
|
|
141
|
+
print("Error in Run LaTex:", e.stderr)
|
|
140
142
|
|
|
141
143
|
# delete cache
|
|
142
144
|
if self.delete_run_latex_cache:
|
|
@@ -49,10 +49,10 @@ pyeasyphd/bib/core/convert_str_to_library.py,sha256=CNB5UfSOcCqPPypxm9yIY7R7kvLQ
|
|
|
49
49
|
pyeasyphd/bib/core/convert_str_to_str.py,sha256=jUxXD3v7t042OaMXPFlWGHjNNukpuoel12TpYt1krD4,900
|
|
50
50
|
pyeasyphd/main/__init__.py,sha256=7_x6_RNSeha2zrgIbKjJgEvFWK62btOW9v6RUU1Ygm8,390
|
|
51
51
|
pyeasyphd/main/basic_input.py,sha256=b2ilzgslD2W-10gLM3RM3zBn3-MxFkYeHeTzdILzbAU,6794
|
|
52
|
-
pyeasyphd/main/pandoc_md_to.py,sha256=
|
|
52
|
+
pyeasyphd/main/pandoc_md_to.py,sha256=SPbQBlAvfB5hcXmfKlMDc2zoT2nJ_uQNyw8bHeiyy1s,15280
|
|
53
53
|
pyeasyphd/main/python_run_bib.py,sha256=RRVeGXXs1MELpAYex9vT3x97Rqr211TP1aeHhD-8hXU,2891
|
|
54
54
|
pyeasyphd/main/python_run_md.py,sha256=6K4zqYtl298-iS1XVGH4jY9FkDD9ezwpGfZk0NIgk2Q,10353
|
|
55
|
-
pyeasyphd/main/python_run_tex.py,sha256=
|
|
55
|
+
pyeasyphd/main/python_run_tex.py,sha256=BNSXp0KnxvYyXr5q43Sr4NwD32EiGaqZJ0QYDwit0tw,5937
|
|
56
56
|
pyeasyphd/main/python_writers.py,sha256=VQpaAbdNNa1s327ADgl8Wy-rKBZy1alqmtmx6E3RDWI,8510
|
|
57
57
|
pyeasyphd/pyeasyphd.py,sha256=vPM4uPmr6jSxVOy0zYetoijc8wUkQdXExUVdJyWynVQ,2875
|
|
58
58
|
pyeasyphd/pyeasyphd.sublime-settings,sha256=6D5SYWsG6xn8OEu6IchIDGGGH7uLX4v451X28yeAevU,8718
|
|
@@ -75,6 +75,6 @@ pyeasyphd/tools/spider/process_spider_bib.py,sha256=p1UNUaLAxMZPYtuwjNi20e1ms--c
|
|
|
75
75
|
pyeasyphd/tools/spider/process_spider_url.py,sha256=YKG4GER5TiFDjyk94n1ocUQ8bM7ZvXImx0lKNvnyVC4,2970
|
|
76
76
|
pyeasyphd/tools/spider/process_spider_url_bib.py,sha256=1b0FnUlTt5BzaOqFZJmnY5gnAhdD4pbQolHR1e3wiyE,2705
|
|
77
77
|
pyeasyphd/utils/utils.py,sha256=yuHy6D2mTsd2aAwNBSMC7CU4LV-MkWwzKeO_0Iehbyg,1655
|
|
78
|
-
pyeasyphd-0.0.
|
|
79
|
-
pyeasyphd-0.0.
|
|
80
|
-
pyeasyphd-0.0.
|
|
78
|
+
pyeasyphd-0.0.7.dist-info/METADATA,sha256=fIdfrpMy6EOHcn2gMKMiiVsXb5uhqkdx2BjM1l9v8H8,1043
|
|
79
|
+
pyeasyphd-0.0.7.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
80
|
+
pyeasyphd-0.0.7.dist-info/RECORD,,
|
|
File without changes
|