all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Rasmus <rasmus@gmx.us>
To: emacs-orgmode@gnu.org
Subject: Re: ox and links to equation
Date: Sun, 15 Feb 2015 12:30:18 +0100	[thread overview]
Message-ID: <87d25b76ph.fsf@gmx.us> (raw)
In-Reply-To: <87h9uno5sh.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Sun, 15 Feb 2015 10:58:06 +0100")

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> For the problem at hand, you can use \label{eq:2} directly in the
> document.

Less pretty and I can't click on it.  [For me a custom link type is fine,
but every line of customization makes it harder to reproduce down the
road].

Anyway, I found out that mathjax upstream now support labeling to
equations using the latex format.  Try:

     In equation \eqref{eq:sample}, we find the value of an
     interesting integral:

     \begin{equation}
       \int_0^\infty \frac{x^3}{e^x-1}\,dx = \frac{\pi^4}{15}
       \label{eq:sample}
     \end{equation}


     #+OPTIONS: html-scripts:nil
     #+HTML_HEAD: <script type="text/javascript"
     #+HTML_HEAD:   src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> 
     #+HTML_HEAD: </script>
     #+HTML_HEAD: <script type="text/x-mathjax-config">
     #+HTML_HEAD: MathJax.Hub.Config({
     #+HTML_HEAD:   TeX: { equationNumbers: { autoNumber: "AMS" } }
     #+HTML_HEAD: });
     #+HTML_HEAD: </script>


>> * Issue 2 (ox-latex specific)
>>
>> Since we now have amsmath in the org-default-package-alist I would like to
>> \eqref{·} to refer to equations.  The main difference is that it takes
>> care of the parenthesis automatically.  I.e. \ref{eq:2} → 2 and
>> \eqref(eq:2) → (2).  Also, mathtools works with \eqref, but not \ref.
>> However, in old document it could lead to ((2)).
b>>
>> I have a simple patch that hard-coded equation to \eqref, but I don't know
>> if a more general approach should be taken.  Or if it a filter issue.
>
> I'm not sure \eqref is desirable as a default value, (but I don't oppose
> it if you think it is). OTOH, a filter is easy enough to implement.

I definitely think it is the more proper way to refer to an equation.  But
it really depends on the document.  E.g. mathtools also offer a set of
commands for referring to equations.  I was considering an alist of

(DESTINATION-TYPE REF-CMD-WITH-DESCRIPTION REF-CMD-WITHOUT-DESCRIPTION)

But it might be an overkill, especially seeing that mathjax only supports
\ref and \eqref out of the box.

—Rasmus

-- 
Summon the Mothership!

  reply	other threads:[~2015-02-15 11:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-15  0:27 ox and links to equation Rasmus
2015-02-15  9:58 ` Nicolas Goaziou
2015-02-15 11:30   ` Rasmus [this message]
2015-02-15 12:50     ` Nicolas Goaziou
2015-02-15 13:01       ` Rasmus
2015-02-15 16:02         ` Nicolas Goaziou
2015-02-15 20:37           ` Rasmus
2015-02-15 20:46             ` Nicolas Goaziou
2015-02-15 22:31               ` Rasmus
2015-02-16  1:50           ` [patch, ox-html] mathjax changes (was: ox and links to equation) Rasmus
2015-02-17 18:04             ` [patch, ox-html] mathjax changes Rasmus
2015-02-27 13:11               ` Rasmus

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=87d25b76ph.fsf@gmx.us \
    --to=rasmus@gmx.us \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.