From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: Re: Latex package nicefrac for HTML export Date: Sat, 20 Feb 2016 02:29:51 +0000 Message-ID: References: <87ziuwv0wu.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113fbce0d2c9bd052c2a5f35 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWxIv-0004vC-NN for emacs-orgmode@gnu.org; Fri, 19 Feb 2016 21:29:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWxIu-0006NT-KD for emacs-orgmode@gnu.org; Fri, 19 Feb 2016 21:29:53 -0500 Received: from mail-lf0-x22e.google.com ([2a00:1450:4010:c07::22e]:34538) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWxIu-0006NL-7m for emacs-orgmode@gnu.org; Fri, 19 Feb 2016 21:29:52 -0500 Received: by mail-lf0-x22e.google.com with SMTP id j78so64813774lfb.1 for ; Fri, 19 Feb 2016 18:29:52 -0800 (PST) In-Reply-To: <87ziuwv0wu.fsf@mbork.pl> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode Mailinglist --001a113fbce0d2c9bd052c2a5f35 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I found this and added this to my org file: . . . #+begin_html #+end_html . . . then this: $\pi =3D \bfrac{C}{d}$ has the slanted fraction look in HTML. On Fri, Feb 19, 2016 at 9:35 PM, Marcin Borkowski wrote: > > On 2016-02-19, at 22:26, Lawrence Bottorff wrote: > > > I've got Latex's *nicefrac *working fine for a Latex export. I've put > > > > #+LaTeX_HEADER: \usepackage{nicefrac} > > > > at the top of my file, and this inlined > > > > $\pi =3D \nicefrac{C}{d}$ > > > > But for an HTML export, it's not seeing it, giving back =CF=80=3D\nicef= racCd. Is > > there anything I can do to get my HTML export to handle nicefrac > properly? > > Quick googling reveals that MathJax doesn't seem to support \nicefrac. > If you don't need regular fractions (maybe you're writing a cookbook?), > in a pinch you can say > > #+LaTeX_HEADER: \usepackage{nicefrac} \let\frac=3D\nicefrac > > and just use \frac. > > > LB > > Best, > > -- > Marcin Borkowski > http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski > Faculty of Mathematics and Computer Science > Adam Mickiewicz University > --001a113fbce0d2c9bd052c2a5f35 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I found=C2=A0this=C2=A0= and added this to my org file:

. . .
#+begin_html
<script type=3D"text/x-mathjax-config&= quot;>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 MathJax.Hub.Register.Startu= pHook("TeX Jax Ready",function () { var MML =3D MathJax.ElementJa= x.mml, TEX =3D MathJax.InputJax.TeX; TEX.Definitions.macros.bfrac =3D "= ;myBevelFraction"; TEX.Parse.Augment({ myBevelFraction: function (name= ) { var num =3D this.ParseArg(name), den =3D this.ParseArg(name); this.Push= (MML.mfrac(num,den).With({bevelled: true})); } }); });
=C2=A0 =C2= =A0 </script>
#+end_html
. . .
then this:

$\pi =3D \bfrac{C}{d}$
=
has the slanted fraction look in HTML.

On Fri, Feb 19, 2016 at 9:3= 5 PM, Marcin Borkowski <mbork@mbork.pl> wrote:

On 2016-02-19, at 22:26, Lawrence Bottorff <borgauf@gmail.com> wrote:

> I've got Latex's *nicefrac *working fine for a Latex export. I= 've put
>
> #+LaTeX_HEADER: \usepackage{nicefrac}
>
> at the top of my file, and this inlined
>
> $\pi =3D \nicefrac{C}{d}$
>
> But for an HTML export, it's not seeing it, giving back =CF=80=3D\= nicefracCd. Is
> there anything I can do to get my HTML export to handle nicefrac prope= rly?

Quick googling reveals that MathJax doesn't seem to support \nic= efrac.
If you don't need regular fractions (maybe you're writing a cookboo= k?),
in a pinch you can say

#+LaTeX_HEADER: \usepackage{nicefrac}=C2=A0 =C2=A0\let\frac=3D\nicefrac

and just use \frac.

> LB

Best,

--
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University

--001a113fbce0d2c9bd052c2a5f35--