简体   繁体   English

将希腊HTML字母抄录到LaTex时出现问题

[英]Problem When Transcribing Greek HTML Letters to LaTex

I have the following HTML string: 我有以下HTML字符串:

s = "I have : <i><λv<sub>1</sub>,w> + <v<sub>2</sub>,w></i>"

Now, I would like to convert it to LaTex. 现在,我想将其转换为LaTex。 To do so, I am using pypandoc . 为此,我正在使用pypandoc

import pypandoc
text = pypandoc.convert_text(s,'latex', format = "html", extra_args = ['--wrap=preserve'] )
text

I get: 我得到:

I have : \emph{1,w\textgreater{} + 2,w\textgreater{}}\r\n

which in readable LaTex becomes: 在可读LaTex中变为:

在此处输入图片说明

Anyone knows how to fix it ? 有人知道如何解决吗?

Funny enough, if I just type the above string into Stackoverflow, I get the correct output: 有趣的是,如果我将上面的字符串输入Stackoverflow,我将得到正确的输出:

I have : <λv 1 ,w> + 2,w> 我有:<λv1,W> + 2,W>

I am interested in a general solution, not a manual fix for this particular example, since I have massive amounts of html text that I need to transcribe. 我对通用解决方案感兴趣,而不是对此特定示例的手动修复,因为我需要转录大量HTML文本。

How can I achieve this for LaTex ? 如何为LaTex实现这一目标?

Doing some Quantum homework? 做一些昆腾功课? Try using the symbol escapes built into LaTeX. 尝试使用LaTeX内置的符号转义符。 For example, \\lambda. 例如,\\ lambda。

I have : \langle \lambda v\sub{1}, w \rangle + \langle 2, w \rangle 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM