DOM 到 LaTeX 资源/工具包?

DOM 到 LaTeX 资源/工具包?

我想将一些网页转换为格式良好的 Latex 文档。该网页是一个讨论论坛,其中包含深度嵌套的评论。在我开始编写自己的简单实现之前,是否有任何工具/脚本可以帮助进行这种 html->latex 结构转换。例如,假设线程层次结构是一个简单的ul li嵌套,我需要一个工具来帮助我将其放入itemize块中。如果可能的话,甚至对于更复杂的div嵌套也是如此span

这里有一个例子可以使其更加明确:

<ul>
 <li>I am a parent comment of the root post. This is my opinion.</li>
 <ul>
     <li> I disagree with the parent and these are my opinions.</li>
     <ul>
         <li> Your opinion is wrong because of such and such facts. </li>
         <ul>
             <li> I am a deeply nested comment </li>
         </ul>
         <li> I agree, I also disagree with parent comment. </li>
     </ul>
  <li> I am another parent comment to the root post </li>
<ul>

将其转换为

\begin{itemize}
    \item I am a parent comment of the root post. This is my opinion.
    \begin{itemize}
        \item I disagree with the parent and these are my opinions.
        \begin{itemize}
            \item Your opinion is wrong because of such and such facts.
            \begin{itemize}
                 \item I am a deeply nested comment.
            \end{itemize}
            \item  I agree, I also disagree with parent comment.             
        \end{itemize}
    \end{itemize}
    \item I am another parent comment to the root post 
\end{itemize}

在此处输入图片描述

相关内容