emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jeremie Juste <jeremiejuste@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: mathjax macro in org-mode
Date: Mon, 15 Oct 2018 17:24:46 +0200	[thread overview]
Message-ID: <87tvlnnsg1.fsf@gmail.com> (raw)
In-Reply-To: <8736t8p7hv.fsf@gmail.com> (Jeremie Juste's message of "Sun, 14 Oct 2018 23:02:04 +0200")

Jeremie Juste <jeremiejuste@gmail.com> writes:

Hello,

looking deeper into the docs I saw that we could modify the
org-html-mathjax-template in the following way to add the macro.


(setq (org-html-mathjax-template
   "<script type=\"text/x-mathjax-config\">
    MathJax.Hub.Config({
        displayAlign: \"%ALIGN\",
        displayIndent: \"%INDENT\",

        \"HTML-CSS\": { scale: %SCALE,
                        linebreaks: { automatic: \"%LINEBREAKS\" },
                        webFont: \"%FONT\"
                       },
        SVG: {scale: %SCALE,
              linebreaks: { automatic: \"%LINEBREAKS\" },
              font: \"%FONT\"},
        NativeMML: {scale: %SCALE},
        TeX: { equationNumbers: {autoNumber: \"%AUTONUMBER\"},
               MultLineWidth: \"%MULTLINEWIDTH\",
               TagSide: \"%TAGSIDE\",
               TagIndent: \"%TAGINDENT\",
     Macros: {
      R: '{\\\\mathbb{R}}',
      arr: '{#1_{^{}_{#3}}^{^{#2}}}',
      myperm: '{\\\\frac{#2!}{(#2-#1)!}}'
    }

             }
});
</script>
<script type=\"text/javascript\"
        src=\"%PATH\"></script>"))

another quick option is just to define the latex macro directly in the
main body as follows before exporting to html but this would generate an
<error LaTeX Error: Command \R already defined> when exporting to latex

$\newcommand{\R}{\mathbb{R}}$


Hope it helps,

Jeremie


> Hello,
>
> I was wondering how to set up mathjax macro in org-mode. For instance
> would it be possible to use #+HTML_MATHJAX: to include the following macro?
>
>      Macros: {
>       R: '{\\mathbb{R}}',
>       bold: ['{\\bf #1}',1]
>     }
>
> So far my attempts have been unsuccessful.
>
> Best regards,
>
> Jeremie

      reply	other threads:[~2018-10-15 15:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-14 21:02 mathjax macro in org-mode Jeremie Juste
2018-10-15 15:24 ` Jeremie Juste [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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=87tvlnnsg1.fsf@gmail.com \
    --to=jeremiejuste@gmail.com \
    --cc=emacs-orgmode@gnu.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).