emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Theorems in org-mode?
@ 2012-05-05  0:05 Rafael
  2012-05-05  0:54 ` Michael Hannon
  0 siblings, 1 reply; 2+ messages in thread
From: Rafael @ 2012-05-05  0:05 UTC (permalink / raw)
  To: org-mode list


Motivated by the side note by Nicolas in
http://www.mail-archive.com/emacs-orgmode@gnu.org/msg55225.html, I tried
the example at the end of this message, which requires
org-special-blocks.el. It exports nicely to LaTeX->PDF with the new
exporter (not so much with the old), so thanks!

I wonder what I would need to add to make it export nicely to HTML with
either the old or the new exporter. The old exporter inserts the labels
with the text of the theorems, and the new inserts stuff like
\begin{theorem} .. \end{theorem} with the text of the theorems.

Now, the org-special-blocks documentation says:

  When #+begin_foo is encountered by the html exporter, a div
  with class foo is inserted into the HTML file.  It is up to the
  user to add this class to his or her stylesheet if this div is to
  mean anything.

I have used

#+STYLE: <style>.theorem {}
#+STYLE: .theorem:before {content: "Theorem: "; font-weight: bold}</style>

but if somebody with actual HTML knowledge could suggest something
prettier I would appreciate it.

Best regards,
Rafael

#+begin_src org
#+title: Theorems in org-mode

#+latex_header: \usepackage{amsthm}
#+latex_header: \newtheorem{theorem}{Theorem}
#+latex_header: \newtheorem{definition}{Definition}

#+options: ^:nil

* Some theory

#+begin_definition
<<def-1>>
A /right triangle/ is a triangle with a right angle.
#+end_definition

#+begin_theorem
<<thm-1>>
We have that $a^2+b^2=c^2$.
#+end_theorem

This is an equation:

#+begin_equation
<<eq-1>>
a^2+b^2=c^2
#+end_equation

* Some references

Theorem [[thm-1]] deals with triangles as in Definition [[def-1]], and
satisfies equation ([[eq-1]]).
#+end_src

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

* Re: Theorems in org-mode?
  2012-05-05  0:05 Theorems in org-mode? Rafael
@ 2012-05-05  0:54 ` Michael Hannon
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Hannon @ 2012-05-05  0:54 UTC (permalink / raw)
  To: Rafael, org-mode list

> From: Rafael <rvf0068@gmail.com>
>To: org-mode list <emacs-orgmode@gnu.org> 
>Sent: Friday, May 4, 2012 5:05 PM
>Subject: [O] Theorems in org-mode?
> 
>
>Motivated by the side note by Nicolas in
>http://www.mail-archive.com/emacs-orgmode@gnu.org/msg55225.html, I tried
>the example at the end of this message, which requires
>org-special-blocks.el. It exports nicely to LaTeX->PDF with the new
>exporter (not so much with the old), so thanks!
>
>I wonder what I would need to add to make it export nicely to HTML with
>either the old or the new exporter. The old exporter inserts the labels
>with the text of the theorems, and the new inserts stuff like
>\begin{theorem} .. \end{theorem} with the text of the theorems.
>
>Now, the org-special-blocks documentation says:
>
>  When #+begin_foo is encountered by the html exporter, a div
>  with class foo is inserted into the HTML file.  It is up to the
>  user to add this class to his or her stylesheet if this div is to
>  mean anything.
>
>I have used
>
>#+STYLE: <style>.theorem {}
>#+STYLE: .theorem:before {content: "Theorem: "; font-weight: bold}</style>
>
>but if somebody with actual HTML knowledge could suggest something
>prettier I would appreciate it.
.
.
.

FWIW, I've played with this a bit recently.  The example below makes an HTML document with "Pay attention to this text" in large, red, indented font.

I prefer to put the CSS in a separate file, but I think it's straightforward to include the equivalent statements directly in the Org file.

-- Mike




#+STYLE:    <link rel="stylesheet" type="text/css" href="./special-block.css" />

* test

#+BEGIN_ATTENTION

Pay attention to this text!

#+END_ATTENTION

###### Contents of special-block.css follow

# .ATTENTION
# {
# font-size: 40px;
# text-indent: 50px;
# color: red;
# }

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

end of thread, other threads:[~2012-05-05  0:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-05  0:05 Theorems in org-mode? Rafael
2012-05-05  0:54 ` Michael Hannon

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