This is exactly what I needed.
Thanks for all your help!
On Thu, Aug 12, 2010 at 9:46 AM, Dan Davison davi...@stats.ox.ac.uk wrote:
Jeremiah Via jxv...@cs.bham.ac.uk writes:
Hi there,
I was wondering if there was any way to make the source blocks work
with LaTeX formulas. I wanted to use it for some pesudocode; for
example:
while not converged
for each state i
\( U^{'}_i = r_i + \underset{a}{argmax} \sum{Pa_{ij}U_j} \)
\( U_i \rightarrow U^{'}_i \)
end for
end while
If a source block isn't possible, is there at least a way to get a
textbox around it?
Hi Jeremiah,
Absolutely. Here are some quick notes
- Org can recognise simple LaTeX constructs inline, without any special
markup
section 11.7 of the manual
http://orgmode.org/org.html#Embedded-LaTeX
- The basic way to place more complex fragments of latex in an Org
document is in a #+begin_latex block
section 12.6 of the manual
http://orgmode.org/org.html#LaTeX-and-PDF-export
- Personally I use the listings package to format pseudocode, e.g.
#+begin_latex
\begin{algorithm}
\caption{An algorithm}
\label{alg:myalg}
\begin{lstlisting}[mathescape,escapeinside='']
'\foreach individual $i$'
'\foreach group $k$'
$\gamma_{ik} \getsp Q_{k}\prod_{l}\prod_{a=1}^{2}P_{lkX_{ila}}$
\end{lstlisting}
\end{algorithm}
#+end_latex
- Don't forget the nice Org functionality like C-c ' to view the latex
code in a latex-mode buffer (manual section 11.3), and C-c C-x C-l to view a
png image of
the latex fragment (manual section 11.7.4).
- The latex can also be included in HTML export. By default this uses
png images, but check out this thread for using MathJax and jsMath to
have javascript-mediated rendering of LaTeX formulas in HTML with
genuine fonts
http://thread.gmane.org/gmane.emacs.orgmode/28259
- You can use a #+latex_header line to specify additional latex
preamble lines. E.g. I defined the \foreach command in a file
emvbpl.sty and make sure that file is included with
#+latex_header: \usepackage{emvbpl}
- In addition, latex can be included inside begin_src latex blocks, to
achieve a variety of extra functionality, and also some of the same
functionality as above.
chapter 14
http://orgmode.org/org.html#Working-With-Source-Code
Don't hesitate to come back to this list with further questions.
Dan
Thank you
--
Jeremiah M. Via
School of Computer Science
University of Birmingham
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode