【问题标题】:Display markdown with css使用 css 显示降价
【发布时间】:2018-04-19 08:22:49
【问题描述】:

我有2个文件style.cssindex.md,里面有个符号\LaTeX,我想先把文件转换成html,再把html文件转换成pdf。 执行命令pandoc --standalone -c style.css -o index.html index.md 后,输出文件index.html 丢失了\LaTeX


包含的文件doc.md

First title
=============
Second title
---
Second title
---
$\LaTeX$

$E=mc^2$

还有style.css,用来控制内容的布局结构。

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    width: 800px;
    margin: auto;
    background: #FFFFFF;
    padding: 10px 10px 10px 10px;
}

/* Title of the resume */
h1 {
    font-size: 55px;
    color: #757575;
    text-align:center;
    margin-bottom:15px;
}
h1:hover {
    background-color: #757575;
    color: #FFFFFF;
    text-shadow: 1px 1px 1px #333;
}

/* Titles of categories */
h2 {
    color: #397249;
}
/* There is a bar just before each category */
h2:before {
    content: "";
    display: inline-block;
    margin-right:1%;
    width: 16%;
    height: 10px;
    background-color: #9CB770;
}
h2:hover {
    background-color: #397249;
    color: #FFFFFF;
    text-shadow: 1px 1px 1px #333;
}

/* Definitions */
dt {
    float: left;
    clear: left;
    width: 17%;
    /*font-weight: bold;*/
}
dd {
    margin-left: 17%;
}
p {
    margin-top:0;
    margin-bottom:7px;
}

/* Blockquotes */
blockquote {
    text-align: center
}

/* Links */
a {
    text-decoration: none;
    color: #397249;
}
a:hover, a:active {
    background-color: #397249;
    color: #FFFFFF;
    text-decoration: none;
    text-shadow: 1px 1px 1px #333;
}

/* Horizontal separators */
hr {
    color: #A6A6A6;
}

我的问题是如何以正确的方式实现我最初的想法?

【问题讨论】:

    标签: html css latex markdown pandoc


    【解决方案1】:

    您在 pandoc markdown 中的美元之间的所有内容都被视为数学。要在 HTML pandoc gives you several options 中呈现数学,请尝试例如:

    echo '$\LaTeX$' | pandoc --mathjax -s -o output.html
    

    为什么?如果没有--mathjax--mathml,(来自MANUAL):

    默认是尽可能使用 Unicode 字符来渲染 TeX 数学

    但是对于 \LaTeX,没有实现 unicode 回退,因此您会收到警告,但输出仍然是 <span class="math inline">$\LaTeX$</span>

    【讨论】:

      猜你喜欢
      • 2014-12-07
      • 1970-01-01
      • 1970-01-01
      • 2021-11-14
      • 2022-11-13
      • 2014-09-26
      • 1970-01-01
      • 2021-09-26
      • 1970-01-01
      相关资源
      最近更新 更多