emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-element
@ 2013-02-22 11:38 Achim Gratz
  2013-02-22 13:14 ` org-element Suvayu Ali
  0 siblings, 1 reply; 10+ messages in thread
From: Achim Gratz @ 2013-02-22 11:38 UTC (permalink / raw)
  To: emacs-orgmode

The Org fragment

\[
r = a
+ b
- c
\]

gets interpreted as something strange with a list inbetween.  Thus it gets
exported as:

$\backslash$[
r = a
\begin{itemize}
\item b
\item c
\end{itemize}
$\backslash$]

How is one supposed to write (longer) equations out on multiple lines (leaving
the operators behind on the previous line obviously works, but is ugly)?


Regards,
Achim.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: org-element
  2013-02-22 11:38 org-element Achim Gratz
@ 2013-02-22 13:14 ` Suvayu Ali
  2013-02-22 13:25   ` org-element Nicolas Goaziou
                     ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Suvayu Ali @ 2013-02-22 13:14 UTC (permalink / raw)
  To: emacs-orgmode

On Fri, Feb 22, 2013 at 11:38:16AM +0000, Achim Gratz wrote:
> 
> How is one supposed to write (longer) equations out on multiple lines (leaving
> the operators behind on the previous line obviously works, but is ugly)?

I use LaTeX blocks.  So your example would translate to:

#+begin_latex
  \begin{equation}
    r = a
    + b
    - c
  \end{equation}
#+begin_latex

With easy templates, entering blocks is trivial (<l for LaTeX blocks).

Hope this helps,

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: org-element
  2013-02-22 13:14 ` org-element Suvayu Ali
@ 2013-02-22 13:25   ` Nicolas Goaziou
  2013-02-22 13:35     ` org-element Suvayu Ali
  2013-02-22 13:25   ` org-element Bastien
  2013-02-22 15:25   ` org-element Achim Gratz
  2 siblings, 1 reply; 10+ messages in thread
From: Nicolas Goaziou @ 2013-02-22 13:25 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> On Fri, Feb 22, 2013 at 11:38:16AM +0000, Achim Gratz wrote:
>> 
>> How is one supposed to write (longer) equations out on multiple lines (leaving
>> the operators behind on the previous line obviously works, but is ugly)?
>
> I use LaTeX blocks.  So your example would translate to:
>
> #+begin_latex
>   \begin{equation}
>     r = a
>     + b
>     - c
>   \end{equation}
> #+begin_latex

This is a bit different from what the OP is asking for. A LaTeX block
will only be exported by a latex (or derived) back-end. On the other
hand, \[1+1\] may be exported by any back-end (for example using mathjax
in html).

Anyway, the equivalent would be a LaTeX environment:

  \begin{equation*}
  r = a
  + b
  - c
  \end{equation*}


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: org-element
  2013-02-22 13:14 ` org-element Suvayu Ali
  2013-02-22 13:25   ` org-element Nicolas Goaziou
@ 2013-02-22 13:25   ` Bastien
  2013-02-22 15:25   ` org-element Achim Gratz
  2 siblings, 0 replies; 10+ messages in thread
From: Bastien @ 2013-02-22 13:25 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> I use LaTeX blocks.  So your example would translate to:
>
> #+begin_latex
>   \begin{equation}
>     r = a
>     + b
>     - c
>   \end{equation}
> #+begin_latex
>
> With easy templates, entering blocks is trivial (<l for LaTeX
> blocks).

Of course, the next question is whether we want to force \[ .. \]
equations to be inlined (with no newline inside) or not.  But I let
Nicolas ask and answer this question :)

-- 
 Bastien

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: org-element
  2013-02-22 13:25   ` org-element Nicolas Goaziou
@ 2013-02-22 13:35     ` Suvayu Ali
  0 siblings, 0 replies; 10+ messages in thread
From: Suvayu Ali @ 2013-02-22 13:35 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

On Fri, Feb 22, 2013 at 02:25:13PM +0100, Nicolas Goaziou wrote:
> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
> 
> > On Fri, Feb 22, 2013 at 11:38:16AM +0000, Achim Gratz wrote:
> >> 
> >> How is one supposed to write (longer) equations out on multiple lines (leaving
> >> the operators behind on the previous line obviously works, but is ugly)?
> >
> > I use LaTeX blocks.  So your example would translate to:
> >
> > #+begin_latex
> >   \begin{equation}
> >     r = a
> >     + b
> >     - c
> >   \end{equation}
> > #+begin_latex
> 
> This is a bit different from what the OP is asking for. A LaTeX block
> will only be exported by a latex (or derived) back-end. On the other
> hand, \[1+1\] may be exported by any back-end (for example using mathjax
> in html).
> 

Ah!  I did not realise that \[..\] was also interpreted by mathjax.
Thanks for pointing it out.

> Anyway, the equivalent would be a LaTeX environment:
> 
>   \begin{equation*}
>   r = a
>   + b
>   - c
>   \end{equation*}

Typo on my part. :-p

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: org-element
  2013-02-22 13:14 ` org-element Suvayu Ali
  2013-02-22 13:25   ` org-element Nicolas Goaziou
  2013-02-22 13:25   ` org-element Bastien
@ 2013-02-22 15:25   ` Achim Gratz
  2 siblings, 0 replies; 10+ messages in thread
From: Achim Gratz @ 2013-02-22 15:25 UTC (permalink / raw)
  To: emacs-orgmode

Suvayu Ali <fatkasuvayu+linux <at> gmail.com> writes:
> I use LaTeX blocks.  So your example would translate to:

Sure, but then the equation would only be exported for LaTeX
and I would need to copy the same thing just again for
HTML export.

I didn't put a [Bug] tag on the OP on purpose, since I don't
really know what's officially supported or not w.r.t. LaTeX
fragments.  But it seems that proper support of multi-line
LaTeX fragments (and count this as a "yes" vote) then parsing
needs to take into account that there can't be any Org elements
inside them.


Regards,
Achim.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* org-element
@ 2013-05-23 23:39 Daimrod
  2013-05-24 12:13 ` org-element Nicolas Goaziou
  0 siblings, 1 reply; 10+ messages in thread
From: Daimrod @ 2013-05-23 23:39 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 582 bytes --]

Hi,

I'm playing a bit with org-element for org-contacts and I wanted to know
what is the prefered way to change an element.

For example, ATM, when I want to change an element property to add a new
value, I do:

#+BEGIN_SRC emacs-lisp
  (org-entry-put nil property
                 (concat (org-entry-get nil property)
                         " " new-value))
#+END_SRC

Is it the correct way? IMHO it would be nicer if we could modify an
object created by the new parser and write it back but I don't think
it is possible (yet?).

Regards,

-- 
Daimrod/Greg

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: org-element
  2013-05-23 23:39 org-element Daimrod
@ 2013-05-24 12:13 ` Nicolas Goaziou
  2013-05-24 16:49   ` org-element Daimrod
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Goaziou @ 2013-05-24 12:13 UTC (permalink / raw)
  To: Daimrod; +Cc: emacs-orgmode

Hello,

Daimrod <daimrod@gmail.com> writes:

> I'm playing a bit with org-element for org-contacts and I wanted to know
> what is the prefered way to change an element.
>
> For example, ATM, when I want to change an element property to add a new
> value, I do:
>
> #+BEGIN_SRC emacs-lisp
>   (org-entry-put nil property
>                  (concat (org-entry-get nil property)
>                          " " new-value))
> #+END_SRC

See `org-element-put-property' and friends.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: org-element
  2013-05-24 12:13 ` org-element Nicolas Goaziou
@ 2013-05-24 16:49   ` Daimrod
  2013-05-24 18:26     ` org-element Nicolas Goaziou
  0 siblings, 1 reply; 10+ messages in thread
From: Daimrod @ 2013-05-24 16:49 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 784 bytes --]

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,

Hello Nicolas,

> Daimrod <daimrod@gmail.com> writes:
>
>> I'm playing a bit with org-element for org-contacts and I wanted to know
>> what is the prefered way to change an element.
>>
>> For example, ATM, when I want to change an element property to add a new
>> value, I do:
>>
>> #+BEGIN_SRC emacs-lisp
>>   (org-entry-put nil property
>>                  (concat (org-entry-get nil property)
>>                          " " new-value))
>> #+END_SRC
>
> See `org-element-put-property' and friends.

I've tried to use `org-element-put-property' but it only modifies the
object in memory, not the element in the file. Is there a way to write
the object into a file?

> Regards,

-- 
Daimrod/Greg

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: org-element
  2013-05-24 16:49   ` org-element Daimrod
@ 2013-05-24 18:26     ` Nicolas Goaziou
  0 siblings, 0 replies; 10+ messages in thread
From: Nicolas Goaziou @ 2013-05-24 18:26 UTC (permalink / raw)
  To: Daimrod; +Cc: emacs-orgmode

Daimrod <daimrod@gmail.com> writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>> See `org-element-put-property' and friends.
>
> I've tried to use `org-element-put-property' but it only modifies the
> object in memory, not the element in the file. Is there a way to write
> the object into a file?

I misread your question.

"org-element.el" doesn't provide functions to modify the buffer, but you
may use `org-element-interpret-data' to create Org syntax from an
object.

You may also want to have a look at org-sync.el.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-05-24 18:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-22 11:38 org-element Achim Gratz
2013-02-22 13:14 ` org-element Suvayu Ali
2013-02-22 13:25   ` org-element Nicolas Goaziou
2013-02-22 13:35     ` org-element Suvayu Ali
2013-02-22 13:25   ` org-element Bastien
2013-02-22 15:25   ` org-element Achim Gratz
  -- strict thread matches above, loose matches on Subject: below --
2013-05-23 23:39 org-element Daimrod
2013-05-24 12:13 ` org-element Nicolas Goaziou
2013-05-24 16:49   ` org-element Daimrod
2013-05-24 18:26     ` org-element Nicolas Goaziou

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).