public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* pandoc.utils.stringify block to latex
@ 2021-07-22 15:46 Pedro Castro
       [not found] ` <45da25b4-31bc-4ecf-be47-959a81fbe021n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Pedro Castro @ 2021-07-22 15:46 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1086 bytes --]

How can I convert a block to latex by keeping "$" in the "Math" element?

my demo.md file:

```md
---
title: "Ola"
---


Theorem (Fermat's Little).

:    If $p$ is a prime number, t


Ex
  ~ Definition 1, $a+2$
```

The AST:

[DefinitionList
 [([Str "Theorem",Space,Str "(Fermat\8217s",Space,Str "Little)."],
   [[Para [Str "If",Space,Math InlineMath "p",Space,Str "is",Space,Str 
"a",Space,Str "prime",Space,Str "number,",Space,Str "t"]]])
 ,([Str "Ex"],
   [[Plain [Str "Definition",Space,Str "1,",Space,Math InlineMath 
"a+2"]]])]]

pandoc.utils.stringify() return:

If p is a prime number, t
Definition 1, a+2

I expect:

If $p$ is a prime number, t
Definition 1, $a+2$


-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/45da25b4-31bc-4ecf-be47-959a81fbe021n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 2389 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: pandoc.utils.stringify block to latex
       [not found] ` <45da25b4-31bc-4ecf-be47-959a81fbe021n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-07-22 18:33   ` John MacFarlane
  0 siblings, 0 replies; 2+ messages in thread
From: John MacFarlane @ 2021-07-22 18:33 UTC (permalink / raw)
  To: Pedro Castro, pandoc-discuss


stringify just gives you the string content, not the `$`
which is a LaTeX specific marker for mathematical content.

Pedro Castro <pdesacastro-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> How can I convert a block to latex by keeping "$" in the "Math" element?
>
> my demo.md file:
>
> ```md
> ---
> title: "Ola"
> ---
>
>
> Theorem (Fermat's Little).
>
> :    If $p$ is a prime number, t
>
>
> Ex
>   ~ Definition 1, $a+2$
> ```
>
> The AST:
>
> [DefinitionList
>  [([Str "Theorem",Space,Str "(Fermat\8217s",Space,Str "Little)."],
>    [[Para [Str "If",Space,Math InlineMath "p",Space,Str "is",Space,Str 
> "a",Space,Str "prime",Space,Str "number,",Space,Str "t"]]])
>  ,([Str "Ex"],
>    [[Plain [Str "Definition",Space,Str "1,",Space,Math InlineMath 
> "a+2"]]])]]
>
> pandoc.utils.stringify() return:
>
> If p is a prime number, t
> Definition 1, a+2
>
> I expect:
>
> If $p$ is a prime number, t
> Definition 1, $a+2$
>
>
> -- 
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/45da25b4-31bc-4ecf-be47-959a81fbe021n%40googlegroups.com.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-22 18:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-22 15:46 pandoc.utils.stringify block to latex Pedro Castro
     [not found] ` <45da25b4-31bc-4ecf-be47-959a81fbe021n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-07-22 18:33   ` John MacFarlane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).