emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* syntax highlighting for latex elements
@ 2011-03-31 15:18 Chris Beard
  2011-03-31 15:35 ` Eric S Fraga
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Beard @ 2011-03-31 15:18 UTC (permalink / raw)
  To: emacs-orgmode

Hello,
After learning that I can output my Org documents (with tables,
outlined notes and all!) into LaTeX, I've started writing some notes
with the intention of exporting them to LaTeX. So I've been typing
stuff like (sorry, I'm not sure about the standard for formatting code
for emails):


This equation does such and such:
\begin{equation}
  F_2(s) = \frac{r_1}{s+2} + \frac{r_2}{s+4} + \frac{r_3}{s+6},
\end{equation}
And this equation is used to find...



This stuff outputs fine to tex files, but one thing I'd like is LaTeX
syntax highlighting for things like \begin{...}\frac{...}\end{}. I can
get highlighting in code source blocks, but that gets exported in
verbatim environments in the LaTeX output. If I want syntax
highlighting for these things, should I just be editing a standard
.tex file with the appropriate emacs mode, or is there a (hopefully
simple) way to turn on syntax highlighting for LaTeX elements in
standard org-mode?

Thank you
Chris

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

* Re: syntax highlighting for latex elements
  2011-03-31 15:18 syntax highlighting for latex elements Chris Beard
@ 2011-03-31 15:35 ` Eric S Fraga
  0 siblings, 0 replies; 2+ messages in thread
From: Eric S Fraga @ 2011-03-31 15:35 UTC (permalink / raw)
  To: Chris Beard; +Cc: emacs-orgmode

Chris Beard <wcbeard10@wabash.edu> writes:

> Hello,
> After learning that I can output my Org documents (with tables,
> outlined notes and all!) into LaTeX, I've started writing some notes
> with the intention of exporting them to LaTeX. So I've been typing
> stuff like (sorry, I'm not sure about the standard for formatting code
> for emails):

[...]

> This stuff outputs fine to tex files, but one thing I'd like is LaTeX
> syntax highlighting for things like \begin{...}\frac{...}\end{}. I can
> get highlighting in code source blocks, but that gets exported in
> verbatim environments in the LaTeX output. If I want syntax
> highlighting for these things, should I just be editing a standard
> .tex file with the appropriate emacs mode, or is there a (hopefully
> simple) way to turn on syntax highlighting for LaTeX elements in
> standard org-mode?
>
> Thank you
> Chris

You can enclose the latex:

#+begin_latex
 \begin{equation}
   F_2(s) = \frac{r_1}{s+2} + \frac{r_2}{s+4} + \frac{r_3}{s+6},
 \end{equation}
#+end_latex

Then, with point within this block, you can type C-c ' which will allow
you to edit the latex in a latex-mode buffer with proper fontification.

For source code blocks, you should be able to tell it to export the code
as latex:

#+begin_src latex :exports results :results latex
 \begin{equation}
   F_2(s) = \frac{r_1}{s+2} + \frac{r_2}{s+4} + \frac{r_3}{s+6},
 \end{equation}
#+end_src

and you will get fortification within org-mode if you set
org-src-fontify-natively to be t.  However, there are (currently) some
performance issues with this approach.

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.122.g2f72.dirty)

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

end of thread, other threads:[~2011-03-31 15:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-31 15:18 syntax highlighting for latex elements Chris Beard
2011-03-31 15:35 ` Eric S Fraga

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