Convert LaTeX to MediaWiki syntax

前端 未结 4 1323
伪装坚强ぢ
伪装坚强ぢ 2021-01-31 17:43

I need to convert LaTeX into MediaWiki syntax. The formulas should stay the same, but I need to transform, for example \\chapter{something} into = something =

相关标签:
4条回答
  • 2021-01-31 18:05

    Yes Pandoc would be the easiest to do that.

    pandoc -f latex -t mediawiki --metadata link-citations --bibliography=bibl.bib --csl=cslstyle.csl test.tex -o test.wiki

    --metadata link-citations creates hyperlinks with your in-text citations and the bibliography. You can delete this part if not needed.

    bibl.bib is the file of the bibliography you used

    cslstyle.csl is the style of citation you want. There are lots of choices that can be downloaded from editor.citationstyles.org

    test.tex is the file you want to convert from

    test.wiki is the output file you want

    all the files should be in the same folder otherwise locations should be specified

    0 讨论(0)
  • 2021-01-31 18:15

    Pandoc should be able to do it:

    $ pandoc -f latex -t mediawiki << END
    > \documentclass{paper}
    > \begin{document}
    > \section{Heading}
    > 
    > Hello
    > 
    > \subsection{Sub-heading}
    > 
    > \textbf{World}!
    > \end{document}
    > END
    == Heading ==
    
    Hello
    
    === Sub-heading ===
    
    '''World'''!
    
    0 讨论(0)
  • 2021-01-31 18:21

    I found this: plasTeX. With a bit of hacking probably I can produce a renderer for the mediawiki syntax

    0 讨论(0)
  • 2021-01-31 18:22

    pandoc can get your file converted between several different mark-up languages pretty easily, including mediawiki

    0 讨论(0)
提交回复
热议问题