我如何将LaTeX与Markdown混合? [英] How can I mix LaTeX in with Markdown?

查看:290
本文介绍了我如何将LaTeX与Markdown混合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用Markdown作为课堂笔记,这很好。我甚至在Markdown上做了一些预处理,所以我可以做一些事情,比如表格。但是这个术语我正在教一个有很多数学的课,我很想能够把LaTeX公式与Markdown放在一起,像这样:

 精化关系写成$ a \sqsubseteq b $,可以是
发音为$ a $ approximates $ b $或$ b $至少与$ a $一样定义。

我希望能够将LaTeX的每个片段预处理为一个很好的抗混淆PNG然后我可以通过HTML < img> 标签在我的Markdown中包含该文件。但我完全不知道如何拍摄LaTeX的片段,并获得一个很好的图像




  • 有正确的边界框

  • 是否反锯齿



我所知道的是如何获得DVI,PostScript或PDF格式的完整页面。



我确信这个问题已经解决,但我还没有能够猜出正确的搜索条件。任何建议如何解决它或寻找现有解决方案?




编辑:安装了mathTeX之后,我可以说代码不灵活,它违反了Linux文件系统层次结构标准,并且它是业余工作 - 无论这个词的好与坏。代码非常复杂,没有明显的缺陷。我会寻找替代品。



另外,很明显,底层的解决方案基于 dvipng




一年之后:我从来没有得到过我一直期待的无缝整合,但我正在用我自己的设计脚本来一瘸一拐的。事实证明,使用 dvips -E 来代替 dvipng >转换 ImageMagick的程序。好处是略微控制诸如缩放等事物,并且易于制作透明背景。
好​​奇的可以检查这个例子



我不能向任何人推荐此解决方案。但我不能推荐MathTeX。

解决方案

您是否试过 Pandoc


I've been using Markdown for class notes, and it's great. I even do some preprocessing on the Markdown so I can do things like tables. But this term I'm teaching a class with a lot of math, and I'd love to be able to put LaTeX formulas with Markdown, something like this:

The refinement relation is written $a \sqsubseteq b$, which can be 
pronounced "$a$ approximates $b$" or "$b$ is at least as defined as $a$".

I'd like to be able to take each fragment of LaTeX and preprocess it into a nice antialiased PNG file which I could then include in my Markdown via the HTML <img> tag. But I have absolutely no idea how to take a fragment of LaTeX and get a nice image that

  • Has the right bounding box
  • Is antialiased

All I know how to do is get full pages in DVI, PostScript, or PDF formats.

I'm sure this problem has been addressed, but I haven't been able to guess the right search terms. Any suggestions how to solve it or where to look for an existing solution?


EDIT: Having installed mathTeX, I can say that the code is inflexible, that it violates the Linux Filesystem Hierarchy standard, and that it is amateur work—in both the good and bad senses of that word. The code is so complex that there are no obvious faults. I will be looking for alternatives.

Also, it's clear that at bottom, solutions are based on dvipng.


ONE YEAR LATER: I never did get the seamless integration I had been hoping for, but I am limping along on a script of my own devising. It turns out that instead of dvipng it is a little easier to use dvips -E and the convert program of ImageMagick. The benefits are slightly more control of things like scaling, and ease of making a transparent background. The curious can inspect this example.

I can't recommend this solution to anyone. But I can't recommend MathTeX either.

解决方案

Have you tried with Pandoc?

这篇关于我如何将LaTeX与Markdown混合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆