Re: [O] ox-md: Export links to equations for use with MathJax

2018-02-12 Thread Thibault Marin

> Markdown has no direct business with Mathjax, so introducing Mathjax
> components in "ox-md.el" sounds wrong to me. "ox-md.el" doesn't even
> have any math-related function (it lets "ox-html.el" take care of LaTeX
> fragments and environments).
OK.

> Since it is a specific requirement, you may want to define your own
> Markdown back-end in this case (e.g., replacing `org-md-link' with
> `org-html-link' in some cases).

Thanks.  The following seems to work for my need:

,
| (defun org-ipynb-link (link desc info)
|   (let* ((type (org-element-property :type link))
|(destination (if (string= type "fuzzy")
| (org-export-resolve-fuzzy-link link info
|   (if (and destination
|(eq 'latex-environment (org-element-type destination))
|(eq 'math (org-latex--environment-type destination)))
|   (org-html-link link desc info)
| (org-md-link link desc info
`

Thanks for the help.

thibault



Re: [O] ox-md: Export links to equations for use with MathJax

2018-02-12 Thread Nicolas Goaziou
Hello,

Thibault Marin  writes:

> The attached patch is my first attempt at this.  It is almost identical
> to the ox-html version.  I have added an option to select which mode to
> use (markdown or MathJax).

Thank you.

> Could this patch be considered for a merge?  Please let know if there
> are any suggestions or comments.

Markdown has no direct business with Mathjax, so introducing Mathjax
components in "ox-md.el" sounds wrong to me. "ox-md.el" doesn't even
have any math-related function (it lets "ox-html.el" take care of LaTeX
fragments and environments).

Since it is a specific requirement, you may want to define your own
Markdown back-end in this case (e.g., replacing `org-md-link' with
`org-html-link' in some cases).

Another option would be to introduce a boolean variable like
"org-md-internal-links-as-html", but I'm not sure it would be generally
useful.

WDYT?

Regards,

-- 
Nicolas Goaziou