哪里有可以悬赏的平台,帮忙解决技术难点的

364 天前
 peerless

事情是这样的,在做一个项目开发中,遇到了一个问题 需要在 JAVA 或者 Python 环境下,通过代码的形式,将 word 中的 EQ 域公式转换成 latex 公式或者图片 搜索引擎上给的资料非常的有限,没有解决这个问题,想试试能不能通过悬赏的方式,有偿的帮忙解决这个问题

2277 次点击
所在节点    程序员
8 条回复
kuzhan
364 天前
要不你先用 openai 试试?
peerless
364 天前
@kuzhan 试了,说的到时一本正经
一看代码里面各种没见过的库,再细问这些库哪里有,给的地址没一个能用的,继续逼问,他就改口说自己犯了错误,又给个新的库的解决方式,结果还是不行,如此循环,互相折磨了快一周,我和 OpenAI 分手了
westoy
364 天前
闲鱼
dragonfsky1
364 天前
我刚刚问了下 gpt4 给的回答看起来挺靠谱的
import os
import subprocess
from docx import Document
from docx.opc.constants import RELATIONSHIP_TYPE as RT
import matplotlib.pyplot as plt
from sympy import preview


def extract_equations(word_document):
doc = Document(word_document)
equations = []

for rel in doc.part.rels:
if doc.part.rels[rel].reltype == RT.MATH:
equations.append(doc.part.rels[rel]._target._blob)

return equations


def equations_to_latex(equations, output_folder):
latex_equations = []

for idx, eq in enumerate(equations):
with open(f"{output_folder}/temp_eq{idx}.omml", "wb") as f:
f.write(eq)

result = subprocess.run(
["pandoc", "-s", f"{output_folder}/temp_eq{idx}.omml", "-t", "latex"],
capture_output=True,
)

latex_equation = result.stdout.decode("utf-8").strip()
latex_equations.append(latex_equation)

return latex_equations


def latex_equations_to_images(latex_equations, output_folder):
for idx, eq in enumerate(latex_equations):
preview(
eq,
viewer="file",
filename=f"{output_folder}/equation{idx}.png",
output="png",
dvioptions=["-D", "300"],
)


def main():
word_document = "input.docx"
output_folder = "output"

if not os.path.exists(output_folder):
os.mkdir(output_folder)

equations = extract_equations(word_document)
latex_equations = equations_to_latex(equations, output_folder)
latex_equations_to_images(latex_equations, output_folder)


if __name__ == "__main__":
main()
peerless
364 天前
@westoy 谢谢,这玩意关键词估计都很难被搜索到吧
googlefans
364 天前
记得以前有个实现网
star7th
364 天前
LaTeX 语法公式生成 ?

将 word 公式格式转成 LaTeX 语法公式

https://www.aiznx.com/#/detail/latex
zhangtest
364 天前
以前 XX 技术网站可以悬赏提问,后面某部门一直找麻烦,直接关了。什么开发票、代收、洗钱合规性一大堆问题。。。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/936997

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX