emacs-orgmode
[Top][All Lists]

## Re: [O] Justifying a formula

 From: Nick Dokos Subject: Re: [O] Justifying a formula Date: Tue, 07 Mar 2017 23:02:03 -0500 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Lawrence Bottorff <address@hidden> writes:

> Here's what I have in a buffer:
>
> * This basic pseudo-code tells of an internally-defined variable that holds,
> /accumulates/ as the recursion drills down:
>
> \begin{align*}
> sumprod(x) \equiv if \; eq(x,NIL) \; then \; 2.list(s,p) \\
>  else \\
>   \{let \; z = sumprod(cdr(x)) \\
>     2.list(car(z) + car(x), car(cdr(z) \cdot car(x))\}
> \end{align*}
>
> which produces this as HTML:
>
> sumprod(x) ≡ if eq(x,NIL) then 2.list(s,p)
>                                                         else
>                          {let z = sumprod(cdr(x))
>  2.list(car(z) + car(x), car(cdr(z) ⋅ car(x))}
>
> which seems to be right justified. How can I get normal left justification?

pdflatex produces the same thing I believe, so I doubt that the HTML
exporter or MathJax is to blame. I imagine you are going to have to
find something more appropriate than an align* environment. In any
case, you need some ampersands to tell it where to align. See e.g.

https://fr.sharelatex.com/learn/Aligning_equations_with_amsmath

>
> BTW,
>
> #+HTML_MATHJAX: align: left indent: 5em tagside: left font: Neo-Euler
>
> seems to be ignored. Latex seems to have
>
> \usepackage[fleqn]{amsmath}
>
> but I'm assuming org-mode HTML export doesn't really use this. (Actually,
> Latex export ignores
>
>
> as well.)
>

Not here, it doesn't: I kept the second one in my org file, and latex export
produces this partial output:

,----
| % Created 2017-03-07 Tue 22:58
| % Intended LaTeX compiler: pdflatex
| \documentclass[11pt]{article}
| \usepackage[utf8]{inputenc}
| \usepackage[T1]{fontenc}
| \usepackage{graphicx}
| \usepackage{grffile}
| \usepackage{longtable}
| \usepackage{wrapfig}
| \usepackage{rotating}
| \usepackage[normalem]{ulem}
| \usepackage{amsmath}
| \usepackage{textcomp}
| \usepackage{amssymb}
| \usepackage{capt-of}
| \usepackage{hyperref}
| \usepackage{minted}
| \usepackage[fleqn]{mathtools}
| \author{Nick Dokos}
| \date{\today}
| \title{}
| \hypersetup{
|  pdfauthor={Nick Dokos},
|  pdftitle={},
|  pdfkeywords={},
|  pdfsubject={},
|  pdfcreator={Emacs 26.0.50.2 (Org mode 9.0.5)},
|  pdflang={English}}
| \begin{document}
|
| \tableofcontents
----

> Latest, greatest everything.
>
> LB
>
>
>

--
Nick