- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在尝试使用 pandoc 将包含 Latex 方程式的 Markdown 文件转换为 Html 文件。
我在文件 test.md
中尝试了以下语法:
$$ \frac{1}{2} = 0.5 \neq \sqrt{2} $$
然后我使用 pandoc 调用
pandoc test.md -o test.html --mathjax
似乎在 this answer 中指出.生成的 test.html
文件包含单行
<p><span class="math">\[ \frac{1}{2} = 0.5 \neq \sqrt{2} \]</span></p>
并且当使用网络浏览器打开 test.html
时,屏幕上的输出是乱七八糟的
\[ \frac{1}{2} = 0.5 \neq \sqrt{2} \]
而不是一个漂亮的“ latex 编译”方程式。
我错过了什么?
附言我正在使用 pandoc 1.12.2.1
最佳答案
test.html
生成的文件不是“完整的”,因为只生成了 html 的主体,而不是标题。但是,必须在标题中链接 mathjax 才能很好地显示等式。
用 <html>
生成一个“完整”的 html 文件<head>
和 <body>
标签,pandoc 的 --standalone
(又名 -s
)必须使用选项
pandoc --standalone test.md -o test.html --mathjax
使用调用
pandoc --standalone test.md -o test.html --mathjax
生成以下 test.html
文件
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
</head>
<body>
<p><span class="math">\[ \frac{1}{2} = 0.5 \neq \sqrt{2} \]</span></p>
</body>
</html>
(注意 <script>
标签链接到 <head>
部分中的 mathjax)而调用
pandoc test.md -o test.html --mathjax
生成一个只包含一行的文件
<p><span class="math">\[ \frac{1}{2} = 0.5 \neq \sqrt{2} \]</span></p>
关于html - 潘多克 : generate a html embedding Latex equation from markdown input,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41140900/
嗨,我是 Flutter 的新手,我正在尝试了解 block 计时器 In the doc of flutter_bloc我会知道这个构造函数类是什么意思 @immutable abstract cl
更新: 从包含 Swift 4.1 的 Xcode 9.3 开始,数组相等性按预期工作,原始问题中的代码编译没有错误。 但是,请查看已接受的答案,因为它提供了更好、更现代的解决方案。 原题如下: 当我
我收到了一个 100 页的 Latex 文档,其中包含 $$...$$ 之间的所有方程,我需要将它们全部更改为 \begin{equation}...\end{equation} 在 Latex(一些
I have 5 equations and I've to take combination of 3 equations at a time to check if I'm getting
关闭。这个问题是off-topic .它目前不接受答案。 想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。 10年前关闭。 Improve this
我想在 Modelica 中建模一个显式时间相关的微分方程。 说我想建模 Real x(start=1); der(x) = t; 在 Modelica 中。访问时间变量 t 的正确方法是什么? 最佳
我在 Maxima 中有一个微分方程组。我正在尝试绘制解决方案。 diff_eq1: 'diff(p(t),t) = (5/2 + (3^(1/2))/24 - (5/8)*p(t) - ((3^(1
基本上我只想解决k。请注意,等式等于 1.12 import math from sympy import * a = 1.45 b = 4.1 c = 14.0 al = math.log(a, 2
计算日出/日落时如何考虑观察者海拔? 计算任何纬度/经度的日出/设置是没有问题的,但是如何计算海拔而不是海平面???我已经用完了可以尝试的组合,并且花了三天多的时间来寻求帮助 我正在使用 Paul S
有人能给我一个为什么这不起作用的充分理由吗: let a: [Int]? = [1] let b: [Int]? = nil a == b 这将是我提出的(如果不优雅的话)解决方案。但这是微不足道的,
我正在尝试定义一个符合 Equatable 的测试夹具,以便我可以验证采用协议(protocol)的函数是否按预期执行。我尝试了 3 种不同的排列方式。 import XCTest import My
我确实需要将任何等同的结构/类型/对象传递给此 setEquatable 函数。知道如何解决这个问题吗? public func ==(l: [String: String], r: [String:
这个有效: // Conformance to protocol correctly synthesized by compiler struct MyStruct: Equatable { } 这不
我仍在与 Swift 泛型作斗争。今天我发现如果从泛型类调用我的 Equatable 协议(protocol)实现不起作用。 我的模型类: func ==(lhs: Tracking, rhs: Tr
谁能给我一个很好的理由来说明为什么这不起作用: let a: [Int]? = [1] let b: [Int]? = nil a == b 这将是我提出的(如果不雅)解决方案。但这是微不足道的,所以
题目地址:https://leetcode.com/problems/solve-the-equation/description/ 题目描述: Solve a given equation an
我正在尝试像这样解决这个指数方程: my ($l,$r); for (1 .. 100) -> $x { $l = $x * e ** $x; $r = 5 * (e ** $x -
我正在尝试用这段代码求解方程: a = [-0.0008333 -0.025 -0.6667 -20]; length_OnePart = 7.3248; xi = -6.4446; yi = -16
我正在处理一个说要使用这个 16 位循环冗余校验的设备: CCITT CRC-16 with polynomial x^16 + x^12 + x^5 + x^1 我寻找了这种算法的实现,但我确实只找
我在 hackerrank.com 上的“方程”挑战赛的一些测试用例上遇到了问题。这是问题所在:https://www.hackerrank.com/challenges/equations . 我很
我是一名优秀的程序员,十分优秀!