Merge branch 'master' of ssh://repo.or.cz/srv/git/Worg
[Worg.git] / org-contrib / org-special-blocks.org
blob3488f2e04caa07eed6c99bdd938b6ab7f57e236e
1 #+TITLE:     org-special-blocks.el --- turn blocks into LaTeX envs and HTML divs
2 #+OPTIONS:   ^:{} author:nil
3 #+AUTHOR:  Chris Gray
4 #+STARTUP: odd
6 * General
8 =org-special-blocks= turns org blocks into LaTeX environments and HTML
9 divs. 
10   
11 * How to use it
13 ** Quick Example
15    After [[* Loading it][loading]] =org-special-blocks=, you can begin using blocks in
16    org files.  For example, let's look at Fermat's Last Theorem:
18 : #+begin_theorem
19 : If an integer $n$ is greater than 2, then the equation $a^n + b^n = c^n$
20 : has no solutions in non-zero integers $a$, $b$, and $c$.
21 : #+end_theorem
23 : #+begin_proof
24 : I have a truly /marvelous/ proof of this proposition that this margin is too
25 : narrow to contain.
26 : #+end_proof
28    This is exported into LaTeX as follows:
30 : \begin{theorem}
31 : If an integer $n$ is greater than 2, then the equation $a^n + b^n = c^n$
32 : has no solutions in non-zero integers $a$, $b$, and $c$.
33 : \end{theorem}
35 : \begin{proof}
36 : I have a truly \emph{marvelous} proof of this proposition that this
37 : margin is too narrow to contain.
38 : \end{proof}
39    
40    Note that the standard org markup works inside the blocks.  If you
41    were to use LaTeX environments inside an org file, this would not
42    be true.  Also make sure that the name of the environment is
43    something that LaTeX knows about -- otherwise it will not be able
44    to compile your file.
46    The org file can also be exported into HTML.  In that case, the
47    exported file would look something like this:
49 : <div class="theorem">
50 : ...
51 : </div>
53 : <div class="proof">
54 : ...
55 : </div>
57    It is up to you to make sure that the div classes are styled
58    properly.  
60 ** Loading it (No surprises here)
61 The easiest way is by 
63         M-x customize-apropos org-modules
65 Check the line for special-blocks.  This will cause it to be loaded every
66 time you start org-mode.
68 You'll still have to load it manually the first time.
70 Of course, you can also just try it out by loading it manually.
72 If you prefer to manually customize your emacs then make sure that the
73 path to org's contrib directory is in your load-path and add the
74 following to your =.emacs=.
76 : (require 'org-special-blocks)
79 * Credits
81   Chris Gray wrote =org-special-blocks= with the help of Carsten
82   Dominik.