Skip to main content
4 of 4
added 112 characters in body
rasmus
  • 2.8k
  • 15
  • 20

Maybe something like this (tested with LaTeX and HTML)

#+TITLE: An Orged Paper
#+AUTHOR: Rasmus
#+DATE: A Dark Day for Science 

#+RESULTS: html-header

#+begin_abstract
#+begin_center
{{{html-only(*Abstract*)}}}
#+end_center
my long abstract that is longer than one line. my long abstract that is longer than one line.
#+end_abstract
#+toc: headlines
* Introduction
Please read my paper!
* Data
~{0,1}~
* Conclusion
Something deep and profound

{{{html-only(------------)}}}
* styles                                                           :noexport:
#+HTML_HEAD_EXTRA: <style type="text/css">
#+HTML_HEAD_EXTRA: <!--
#+HTML_HEAD_EXTRA:   .header_title {font-size: 2em; font-weight: bold;}
#+HTML_HEAD_EXTRA:   .header_author {font-size: 1.5em; font-weight: bold;text-align:center;}
#+HTML_HEAD_EXTRA:   .header_date {text-align:center;}
#+HTML_HEAD_EXTRA:   .header_date .timestamp {font-size:1em; color:#000000;}
#+HTML_HEAD_EXTRA:   .abstract {max-width: 30em; margin-left: auto; margin-right: auto;}
#+HTML_HEAD_EXTRA: -->
#+HTML_HEAD_EXTRA: </style>

#+OPTIONS: toc:nil

#+MACRO: html-only (eval (if (org-export-derived-backend-p org-export-current-backend 'html) "$1" ""))

#+NAME: html-header
#+BEGIN_SRC emacs-lisp :results raw :exports (if (org-export-derived-backend-p org-export-current-backend 'html) "results" "none")
  "#+begin_header
  ,#+begin_header_author
  {{{AUTHOR}}}
  ,#+end_header_author
  ,#+begin_header_date
  {{{DATE}}}
  ,#+end_header_date
  ,#+end_header
"
#+END_SRC

Note the html-header could also be generated via org-html-preamble. Note also that from org 8.3 org-latex-title-command can be used to customize the title as a format-string.

rasmus
  • 2.8k
  • 15
  • 20