Variables controlling HTML and LaTeX export in Emacs Org mode

Source: Internet
Author: User
Tags wiki platform

Emacs Org mode is a very powerful, versatile and extensible package, which can being used for personal information management , maintenance of a wiki platform, implementation of a GTD system, etc. With a-simple markup grammar, it's very easy for the user-perform a structured typesetting in pure ASCII. The text file can then is exported into various formats, such as PDF, OpenOffice, HTML, LaTeX, TaskJuggler (a professional Project management tool), ICalendar and so on. In my daily work, typesetting math with LaTeX and publishing them as blog post is common tasks. Therefore in this post, those variables controlling HTML and latex export in Emacs Org mode, along with latex fragments PR Ocessing'll be summarized.

1. org-export-with-latex-fragments: When it is true, enable LaTeX fragments export using Mathjax mode.

2. org-export-html-mathjax-options: Mathjax is configured using this variable or insert something like the follow ing into the buffer:

#+mathjax:align: "Left" Mathml:t path: "/mathjax/mathjax.js"

The documentation for this variable is:

org-export-html-mathjax-options is a variable defined in ' Org-html.el '. Its value is (path"Http://orgmode.org/mathjax/MathJax.js") ( scale"100") (Align"Center") (Indent"2em") (MathML nil)) Documentation:options for Mathjax Setup.path the path where to find Mathjaxscale Scaling for the Html-cs S Backend, usually between and 133align how to align display Math:left, center,or rightindent If align is not center,How far from the left/right Side?mathml should a MathML player is used if available? This is faster and reduces bandwidth use,But Currentlysometimes had lower spacing quality. Therefore,The default Isnil. When browsers get better, this switch can be flipped.

2. org-export-htmlize-output-type:output type to being used by htmlize when formatting code snippets. Choices is ' CSS ', to export the CSS selectors only, or ' inline-css ', to export the CSS attribute values inline in the HTM L. We use as Default ' Inline-css ', in order to make the resulting HTML self-containing. Therefore, for a self maintained website or blog, we ' d better use the CSS mode.

3. Org-export-with-tex-macros: Non-nil means interpret simple tex-like macros when exporting. For example, HTML export converts \alpha to α and \aa to å. Not only real TeX macros would work here, but the standard HTML entities for math can is used as macro names as well. In my case, I set it to nil because I don't want convert the simple Tex-like macros into HTML.

4. Org-export-html-style: Org-wide style definitions for exported HTML files. This variable needs to contain the full HTML structure to provide a style, including the surrounding HTML tags. If you set the value of this variable, you should consider to include definitions for the following classes:title, Todo, Done, timestamp, TIMESTAMP-KWD, tag, target. As the value of this option simply gets inserted into the HTML

5. Org-export-html-style-extra: Additional style information for HTML export. The value of this variable are inserted into the HTML buffer right after the value of ' Org-export-html-style '. Use this variable for per-file settings of style information, and does not forget to surround the style settings wi Th <style>...</style> tags.

6. org-export-latex-classes: alist of latex classes and associated header and structure. If #+latex_class is set in the buffer, use its value and the associated information. Here are the structure of each cell:

(Class-nameheader-string (numbered-section. unnumbered-section) ...)

The header-string is the HEADER of that would be inserted into the LaTeX file. It should contain the \documentclass macro, and anything else that's needed for this setup. To the header, the following commands'll be added:

-Calls to \usepackage for all packages mentioned in the variables ' org-export-latex-default-packages-alist ' and ' Org-expo Rt-latex-packages-alist '. Thus, your header definitions should avoid to also request these packages.

-Lines specified via "#+latex_header:"

If you need more control on the sequence in which the header was built up, or if you want to exclude one of the these Buildi Ng blocks for a particular class, you can use the following macro-like placeholders.

[default-packages]\usepackage statements for default packages[no-default-packages]Do not include any of the default packages[PACKAGES]\usepackage statements for packages[no-packages]Do not include the packages[EXTRA]The stuff from #+latex_header[No-extra]Do not include #+latex_header stuff[Beamer-header-extra]The Beamer Extra headers

According to the above documentation, my header strings used for various classes are like this:

"\\documentclass[11pt]{article}[no-default-packages]  \\input{note-template}[EXTRA][PACKAGES] "

Where Note-template.tex is my own the template file in which common commands be defined and packages are included.

7. org-format-latex-header : Being different from Org-export-latex-classes , this variable was only the document header used for processing latex fragments not for exporting a complete LaTeX Document. It's imperative that this header make sure that no page number appears on the page. The package defined in the variables ' org-export-latex-default-packages-alist ' and ' org-export-latex-packages-alist ' Would either replace the placeholder "[PACKAGES]" In this header, or they'll be appended. The value of this variable was similar to the header string in org-export-latex-classes :

"\\documentclass{article}\\usepackage{fullpage}% does not remove[no-default-packages]\\input{note-template}[ Packages]\\pagestyle{empty}%do not remove "

8. org-format-latex-options: This variable contains options for creating images from latex fragments. This was a property list with the following properties:

: Foreground the foreground color for images embedded in Emacs, e.g. "Black". ' Default ' means use the foreground of the default face.:background the background color, or "Transparent". ' Default ' means use the background of the default Face.:scale a scaling factor for the size of the images,To get more pixels:html-foreground,: Html-background,: Html-scalethe same numbers for HTML export.:matchers a list indicating which matchers should be used Tofind LaTeX fr Agments. Valid members of the This list is:"Begin"Find Environments"$"find single characters surrounded by $.$"$"find math expressions surrounded by $...$"$$"find math expressions surrounded by $$....$$"\("find math expressions surrounded by \ (... \)"\ [" Find math expressions surrounded by \[...\ 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.