|
@@ -206,11 +206,11 @@ class Ruku():
|
|
imgname_online = "/zyk/uploadfiles/wording/" + str(self.wordid) + "/{}".format(os.path.basename(img_path))
|
|
imgname_online = "/zyk/uploadfiles/wording/" + str(self.wordid) + "/{}".format(os.path.basename(img_path))
|
|
put_key_mjmath.append(imgname_online)
|
|
put_key_mjmath.append(imgname_online)
|
|
mj_ltx = svgp_ltx[img_path.replace(".png", ".svg")] #.replace("\\\\", "\\")
|
|
mj_ltx = svgp_ltx[img_path.replace(".png", ".svg")] #.replace("\\\\", "\\")
|
|
- w = shape[0] / 4
|
|
|
|
- h = shape[1] / 4
|
|
|
|
- if re.search(r"\\frac", mj_ltx.replace(" ", '')):
|
|
|
|
- w = shape[0] / 4 * 1.6
|
|
|
|
- h = shape[1] / 4 * 1.6
|
|
|
|
|
|
+ w = shape[0] / 4 * 1.2
|
|
|
|
+ h = shape[1] / 4 * 1.2
|
|
|
|
+ if re.search(r"^{?[A-Z、\s]+\}?$", mj_ltx):
|
|
|
|
+ w = shape[0] / 4
|
|
|
|
+ h = shape[1] / 4
|
|
mjmath_online = '<img src="http://' + configs.public_bucket_addr + imgname_online \
|
|
mjmath_online = '<img src="http://' + configs.public_bucket_addr + imgname_online \
|
|
+ '" width="{}" height="{}" data-type="math" data-latex="{}" />'.format(
|
|
+ '" width="{}" height="{}" data-type="math" data-latex="{}" />'.format(
|
|
int(w), int(h), "${}$".format(mj_ltx)) # shape[0] / 2
|
|
int(w), int(h), "${}$".format(mj_ltx)) # shape[0] / 2
|