public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: "Gabriel Nützi" <gnuetzi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Math blocks with specified environment [generic directives / attributes]
Date: Tue, 10 Nov 2020 08:49:10 -0800	[thread overview]
Message-ID: <m2r1p1nomx.fsf@MacBook-Pro.hsd1.ca.comcast.net> (raw)
In-Reply-To: <d9796bc9-ce29-c607-8a0f-79d0834f4286-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>


You can use the raw_attribute extension (enabled by default)
to put anything you like in a raw latex inline:

`\begin{align}
x^2
\end{align}`{=latex}

Note: the line endings may not be preserved, but that
shouldn't matter for latex in most cases.

Gabriel Nützi <gnuetzi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> *Hi all,
> *
> I am transfering to 2.11.0.4 in 
> https://github.com/gabyx/TechnicalMarkdown and have some question
> regarding *Latex Math Blocks*.
>
> *Target:* Latex and HTML output
> *
> **Question:* How to write clean math blocks with specified math 
> environement which correctly merges with preceeding Paragraphs (in the 
> AST).
> I am thinking of a nice attribute solution or something...
>
> I basically want the output of:
>
> ```markdown
> Paragraph, the next mathblock should merge into this paragraph
> $$
> \begin{align}
> x^2
> \end{align}
> $$
> ```
>
> but I dont want to use a Math(mathtype=display) because I want excatly 
> to control the math environement. The above does not work because 
> `\begin{align}`
>
> *My approach**:*
> ```markdown
> Paragraph, the next mathblock should merge into this paragraph
> ~~~math
> \begin{align}
> x^2 \\
> y^2
> \end{align}
> ~~~
> ```
>
> I used a filter to Transform 
> <https://github.com/gabyx/TechnicalMarkdown/blob/master/convert/pandoc/filters/transformMath.py>the 
> mathematical `CodeBlock`  into a `Para(RawInline(tex, ...))`.
> Unfortunately I didn't think about the fact, that a new Para or other 
> Block element introduces a hard break, and does not merge with a
> `SoftBreak` into the preceeeding `Para`graph. Of course that can be 
> handled somehow ridiculously in a filter by merging precceding 
> paragraphs etc. -> cumbersome -> error prone...
>
> *Working solution with +raw_tex Extensions:*
> ```markdown
> Paragraph, the next mathblock should merge into this paragraph
> \begin{align}
> x^2 \\
> y^2
> \end{align}
> ```
>
> But is there a nicer solution?
> Is there an *inline block* element which I can tag with an attribute 
> which I can further process in a filter?
>
> Would something like that work with bracketed_spans ?:
> ```markdown
> Paragraph, this paragraph should not end here after this newline>
> [
> x^2 \\
> y^2
> ]{math}
> ```
>
> Any help widely appreciated.
>
> *BR Gabriel*
>
> -- 
> 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/d9796bc9-ce29-c607-8a0f-79d0834f4286%40gmail.com.

-- 
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/m2r1p1nomx.fsf%40MacBook-Pro.hsd1.ca.comcast.net.


      parent reply	other threads:[~2020-11-10 16:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03 22:45 ANN: pandoc 2.11.1 John MacFarlane
     [not found] ` <m2zh3yjbzg.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
2020-11-06  7:39   ` Geoff Russell
     [not found]     ` <27ecca51-7881-411b-8f31-02af125e65bfn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-11-06  8:21       ` 'Denis Maier' via pandoc-discuss
     [not found]         ` <4242b24f-9a1d-9a6e-c052-e8c63b3df65d-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
2020-11-06  9:52           ` Geoff Russell
2020-11-10  8:32   ` Math blocks with specified environment [generic directives / attributes] Gabriel Nützi
     [not found]     ` <d9796bc9-ce29-c607-8a0f-79d0834f4286-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-11-10 16:49       ` John MacFarlane [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2r1p1nomx.fsf@MacBook-Pro.hsd1.ca.comcast.net \
    --to=jgm-tvlzxgkolnx2fbvcvol8/a@public.gmane.org \
    --cc=gnuetzi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).