admin管理员组文章数量:1403446
I am using pandoc
to convert markdown files containing TeX bits to html.
Because the text is in Italian, I want to use comma as a decimal separator. However, pandoc keeps adding a space after the comma. Here is a simple example:
echo '0,5 $0,5$' | pandoc
it gives:
<p>0,5 <span class="math inline">0, 5</span></p>
Notice the space is not added when the number is not in math mode.
What I want is something similar to what is achieved by LaTeX package icomma
, or some other workaround to prevent the insertion of the space. Any advice?
I am using pandoc
to convert markdown files containing TeX bits to html.
Because the text is in Italian, I want to use comma as a decimal separator. However, pandoc keeps adding a space after the comma. Here is a simple example:
echo '0,5 $0,5$' | pandoc
it gives:
<p>0,5 <span class="math inline">0, 5</span></p>
Notice the space is not added when the number is not in math mode.
What I want is something similar to what is achieved by LaTeX package icomma
, or some other workaround to prevent the insertion of the space. Any advice?
1 Answer
Reset to default 0TeX math mode does not treat a comma like an ordinary character, but you can circumvent that by putting the comma in {}
. However, that only works if you use MathJax for rendering:
echo 0,5 vs. $0,5$ vs. $0{,}5$ | pandoc --mathjax -s
outputs an HTML document equivalent to the following snippet:
<script src="https://cdn.jsdelivr/npm/mathjax@3/es5/tex-chtml-full.js" type="text/javascript"></script>
<p>0,5 vs. <span class="math inline">\(0,5\)</span> vs. <span
class="math inline">\(0{,}5\)</span></p>
本文标签:
版权声明:本文标题:markdown - Preventing pandoc from adding a space after comma used as a decimal separator in math mode - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744401335a2604478.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论