✅ Overview
The Scimax VS Code extension provides a comprehensive export system for converting org-mode documents to various formats including HTML, LaTeX, PDF, Markdown, and Microsoft Word (DOCX). The export system follows the familiar org-mode export dispatcher interface (`C-c C-e') from Emacs.
✅ Export Dispatcher
✅ Opening the Export Dispatcher
Press `C-c C-e' (or `C-c C-e' in Emacs notation) to open the export dispatcher menu. This provides a quick-pick interface showing all available export formats and options.
The export dispatcher presents options with keyboard hints, similar to Emacs org-mode:
Type the letter keys shown in square brackets to select an option
For example, type `h h' for HTML export or `l p' for PDF export
✅ Export Formats
✅ HTML Export
HTML export generates semantic HTML5 documents with modern styling.
✅ Features
Semantic HTML5 structure (<section>, <header>, <nav>)
Syntax highlighting via highlight.js
MathJax support for mathematical equations
Responsive design with mobile-friendly layout
Table of contents generation
Footnote support
Custom CSS and JavaScript support
✅ MathJax Integration
HTML exports automatically include MathJax for rendering mathematical content:
| Syntax | Renders as |
|---|---|
$x^2 + y^2 = r^2$ | \(x^2 + y^2 = r^2\) |
$$E = mc^2$$ | \[E = mc^2\] |
\(inline\) | \(inline\) |
\[display\] | \[display\] |
LaTeX environments also work directly.
Inline math: \(\int_0^1 x dx\)
Display math:
\[\int0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}\]
✅ Example
This document demonstrates HTML export with math: \(E = mc^2\)
Export with `C-c C-e h h' to produce a standalone HTML file.
✅ LaTeX Export
LaTeX export converts org documents to LaTeX source suitable for academic papers, reports, and books.
✅ Document Classes
The default document class is article. You can specify alternatives:
#+LATEX_CLASS: report
#+LATEX_CLASS_OPTIONS: [11pt,a4paper,twoside]
Supported classes: article, report, book, beamer (for presentations)
✅ Custom Preambles
Add custom LaTeX packages and settings in the preamble:
#+LATEX_HEADER: \usepackage{geometry}
#+LATEX_HEADER: \geometry{margin=1in}
#+LATEX_HEADER: \usepackage{tcolorbox}
✅ Global Custom Header
Configure a complete custom LaTeX preamble in VS Code settings:
Open Settings (`C-,')
Search for `scimax.export.latex.customHeader'
Enter your complete preamble (from \documentclass through packages)
Example:
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb}
\usepackage{graphicx}
\usepackage[colorlinks=true]{hyperref}
Code Listings
LaTeX export supports two code highlighting backends:
listings Package (default)
#+BEGIN_SRC python
def fibonacci(n):
return n if n < 2 else fibonacci(n-1) + fibonacci(n-2)
Exports to:
\begin{lstlisting}[language=Python]
def fibonacci(n):
return n if n < 2 else fibonacci(n-1) + fibonacci(n-2)
\end{lstlisting}
minted Package (for advanced highlighting)
Enable in export options (requires Pygments):
#+LATEX_COMPILER: pdflatex -shell-escape
Tables with booktabs
Tables are exported using the booktabs package for professional appearance:
#+CAPTION: Experimental Results
#+NAME: tab:results
| Method | Accuracy | Time (s) |
|--------+----------+----------|
| A | 0.95 | 12.3 |
| B | 0.97 | 15.6 |
Exports to:
\begin{table}[htbp]
\centering
\begin{tabular}{lrr}
\toprule
Method & Accuracy & Time (s) \\
\midrule
A & 0.95 & 12.3 \\
B & 0.97 & 15.6 \\
\bottomrule
\end{tabular}
\caption{Experimental Results}
\label{tab:results}
\end{table}
Cross-References
Use #+NAME: for labeled elements and link to them:
#+NAME: fig:diagram
[[file:diagram.png]]
See Figure [[fig:diagram]] for the system architecture.
✅ PDF Export
PDF export works by first generating LaTeX and then compiling with a LaTeX engine.
✅ Compilation Process
The system uses latexmk for smart incremental builds:
Org → LaTeX conversion
`latexmk' compilation (handles multiple passes automatically)
Bibliography processing if needed
PDF generation
✅ Supported Compilers
Configure the LaTeX compiler in VS Code settings (scimax.latexLivePreview.compiler):
`pdflatex' (default) - Standard LaTeX compiler
`xelatex' - For Unicode and system fonts
`lualatex' - For advanced features and LuaTeX
✅ Requirements
PDF export requires:
LaTeX distribution (TeX Live, MiKTeX, or MacTeX)
`latexmk' utility (included with most distributions)
Error Handling
If PDF compilation fails:
The extension offers to open the `.log' file
Review the log for LaTeX errors
Common issues:
Build on Save
Enable automatic PDF building in settings:
{
"scimax.latexLivePreview.buildOnSave": true,
"scimax.latexLivePreview.compiler": "pdflatex"
}
✅ PDF Viewer Panel with Bidirectional Sync
For an Overleaf-like editing experience, use the built-in PDF viewer panel:
This exports your org file to PDF and opens it in a VS Code panel with full bidirectional synchronization support.
Forward Sync (Org → PDF)
Double-click a word in your org source to jump to that location in the PDF. The word is highlighted with a yellow flash for easy identification.
The forward sync:
Maps your org line to the generated LaTeX line
Uses SyncTeX to find the PDF position
Searches the PDF text layer to find the exact word
Highlights the word with a flash animation
Inverse Sync (PDF → Org)
Double-click a word in the PDF viewer to jump back to the corresponding line in your org source file.
The inverse sync:
Gets PDF coordinates from your click
Uses SyncTeX to find the LaTeX line
Maps the LaTeX line back to your org source line
Opens the org file and highlights the text
How It Works
The system maintains a mapping between org source lines and generated LaTeX lines. When you export to PDF, this mapping is stored so that both forward and inverse sync can translate between org positions and PDF positions.
Note: The sync is approximate due to the org → LaTeX transformation. It works best with paragraph-level precision.
✅ Markdown Export
Markdown export produces GitHub-flavored Markdown (GFM) suitable for GitHub, GitLab, and other platforms.
✅ Features
Headings (`# ## ###')
Emphasis (*bold*, _italic_, `
`strikethrough'')Lists (ordered and unordered)
Code blocks with syntax highlighting
Tables (GFM format)
Links and images
Blockquotes
✅ Example Conversion
,* Project Overview
This is a *bold* statement and an /italic/ one.
,** Features
- Fast rendering
- Simple syntax
- Wide support
,#+BEGIN_SRC python
print("Hello, world!")
,#+END_SRC
# Project Overview
This is **bold** statement and an *italic* one.
## Features
- Fast rendering
- Simple syntax
- Wide support
```python
print("Hello, world!")
```
✅ Jupyter Notebook Export
Export org-mode documents to Jupyter Notebook format (.ipynb), compatible with Jupyter Lab, Jupyter Notebook, VS Code notebook viewer, and ox-ipynb from Emacs.
Features
Full nbformat v4 notebook structure
Automatic kernel detection from document content
Source blocks become code cells (when language matches kernel)
Headlines, paragraphs, lists, tables become markdown cells
Participant mode for teaching materials (strips solutions)
ox-ipynb compatibility (keywords, slideshow metadata)
Base64 image embedding for self-contained notebooks
Basic Usage
Export the current org file to Jupyter Notebook:
| Keybinding | Command | Description |
|---|---|---|
| C-c C-e j j | scimax.org.exportIpynb | Export to .ipynb file |
| C-c C-e j o | scimax.org.exportIpynbOpen | Export and open in notebook viewer |
| C-c C-e j p | scimax.org.exportIpynbParticipant | Export with solutions stripped |
Kernel Detection
The kernel is determined in this order:
#+OX_IPYNB_KERNEL_NAME:keyword in the documentMost common source block language in the document
Default: python3
,#+OX_IPYNB_KERNEL_NAME: julia-1.9
,#+TITLE: Julia Tutorial
Content here will use the Julia kernel.
Cell Conversion
| Org Element | Jupyter Cell Type | Notes |
|---|---|---|
| Headlines | Markdown | #, ##, ### syntax |
| Paragraphs | Markdown | Inline markup converted |
| Lists | Markdown | Ordered, unordered, checkboxes |
| Tables | Markdown | Pipe-delimited format |
| Source blocks (kernel lang) | Code | With outputs if results exist |
| Source blocks (other) | Markdown | As code fences |
| LaTeX fragments | Markdown | $...$ or $$...$$ |
Participant Mode (for Teaching)
Create student versions of notebooks with solutions stripped:
,#+BEGIN_SRC python
# Setup code (kept)
x = 1
### BEGIN SOLUTION
# This solution is removed in participant mode
y = x + 1
### END SOLUTION
# More code (kept)
,#+END_SRC
Content between ### BEGIN SOLUTION / ### END SOLUTION markers is removed.
Also supports ### BEGIN HIDDEN / ### END HIDDEN markers.
Headlines with the :remove: tag are also excluded in participant mode.
Settings
Configure notebook export behavior in VS Code settings:
| Setting | Default | Description |
|---|---|---|
scimax.export.ipynb.defaultKernel | "python3" | Default Jupyter kernel name |
scimax.export.ipynb.embedImages | true | Base64 encode images in outputs |
scimax.export.ipynb.includeResults | true | Include #+RESULTS as cell outputs |
ox-ipynb Compatibility
The following ox-ipynb keywords are supported:
,#+OX_IPYNB_KERNEL_NAME: python3
,#+OX_IPYNB_LANGUAGE: python
,#+OX_IPYNB_NOTEBOOK_METADATA: {"custom_key": "value"}
✅ DOCX Export
DOCX export generates Microsoft Word (.docx) documents using Pandoc for high-quality conversion with proper equation rendering and bibliography support.
Requirements
Features
High-quality conversion via Pandoc
LaTeX equations render as native Word equations
Bibliography support via pandoc-citeproc
Full export options support (
p:nil,todo:nil,tags:nil, etc.)Citation formats: org-ref (
cite:key) and org-cite ([cite:@key])Embedded images from file links
Tables with proper formatting
Nested lists (ordered, unordered, description)
Special blocks (quote, example, verse)
Basic Usage
Export the current org file to Word:
| Keybinding | Command | Description |
|---|---|---|
| C-c C-e d d | scimax.org.exportDocx | Export to .docx file |
| C-c C-e d o | scimax.org.exportDocxOpen | Export and open in Word |
Code Blocks
Source blocks are exported as formatted code:
,#+BEGIN_SRC python
def fibonacci(n):
if n < 2:
return n
return fibonacci(n-1) + fibonacci(n-2)
,#+END_SRC
Code blocks appear in Word with monospace formatting. Pandoc handles the conversion.
Images
Images from file links are embedded directly into the Word document:
[[file:diagram.png]]
Images are automatically scaled to fit within the page margins. Control image width with attributes:
#+ATTR_HTML: :width 400
[[file:large-diagram.png]]
Tables
Org tables are converted to Word tables with:
Header row with bold text and shaded background
Proper cell borders
Caption support from
#+CAPTION:
#+CAPTION: Experimental Results
| Method | Accuracy | Time (s) |
|--------+----------+----------|
| A | 0.95 | 12.3 |
| B | 0.97 | 15.6 |
Citations and Bibliography
DOCX export uses Pandoc's citeproc for full bibliography support. Both org-ref and org-cite citation formats are supported:
* My Document
Recent work cite:smith2023 demonstrates...
According to citet:jones2024, the approach...
You can also use org-cite: [cite:@smith2023] or [cite/t:@jones2024].
* References
bibliography:~/references.bib
The bibliography: line specifies your BibTeX file. Citations are automatically resolved and a formatted bibliography is generated at the end of the document.
Word Styles
The exported document uses standard Word styles:
Heading 1throughHeading 6for headlinesNormalfor paragraph textCodefor inline codeQuotefor quote blocksCaptionfor figure and table captions
These styles can be customized in Word after export to change the document appearance.
Special Blocks
Special blocks export with appropriate styling:
,#+BEGIN_QUOTE
This is a block quote with left indent and italic styling.
,#+END_QUOTE
,#+BEGIN_note
Important information highlighted in a styled box.
,#+END_note
,#+BEGIN_warning
Critical warning with distinct visual treatment.
,#+END_warning
LaTeX Equations
LaTeX equations are converted to native Word equation format:
Inline math: $E = mc^2$
Display math:
\begin{equation}
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
\end{equation}
Both inline ($...$) and display (\begin{equation}...) formats are supported.
Limitations
Table of contents may require manual update in Word (Insert → Update Field)
Complex nested tables may need adjustment
Internal links work within the document but external file links are text-only
✅ Clipboard Export (ox-clip)
Clipboard export (inspired by ox-clip) copies formatted org content to the clipboard, enabling pasting into email clients, Word, Google Docs, and other applications that accept rich text.
Features
Rich HTML clipboard: Copy HTML as formatted text that pastes with styling
Source clipboard: Copy HTML, LaTeX, or Markdown source code
Scope selection: Export full document, current subtree, or selection
Platform support: macOS, Linux (X11/Wayland), Windows
Quick Usage
| Keybinding | Command | Description |
|---|---|---|
| C-c k | scimax.org.clipboardHtmlRich | Copy subtree as rich HTML |
| C-c C-e k | Clipboard menu | Open clipboard export submenu |
Export Scope
The export scope determines which content is copied:
| Scope | Description |
|---|---|
full | Entire document |
subtree | Current headline and all children (default) |
selection | Selected text only |
Configure the default scope in settings:
{
"scimax.export.clipboard.defaultScope": "subtree"
}
Rich Text Clipboard (Platform-Specific)
Rich HTML clipboard uses platform-specific tools to copy formatted text that pastes with styling preserved:
| Platform | Tool | Notes |
|---|---|---|
| macOS | textutil + pbcopy | Converts HTML to RTF, built-in |
| Linux | xclip or wl-copy | X11: sudo apt install xclip; Wayland: wl-copy |
| Windows | PowerShell | Uses System.Windows.Forms.Clipboard |
If rich clipboard tools aren't available, falls back to plain text clipboard with a warning.
Configuration
{
// Use rich text clipboard when platform tools available (default: true)
"scimax.export.clipboard.preferRichText": true,
// Default scope: "full", "subtree", or "selection" (default: "subtree")
"scimax.export.clipboard.defaultScope": "subtree"
}
Use Cases
Sharing in Email
Position cursor on a headline
Press
C-c kto copy as rich HTMLPaste into email - formatting, code blocks, and links are preserved
Copying to Word/Google Docs
Select the content or position on headline
C-c C-e k hto copy as rich HTMLPaste into document - tables, lists, and emphasis are formatted
Sharing Source Code
Position on headline containing code explanation
C-c C-e k mto copy as MarkdownPaste into GitHub issue or PR description
LaTeX Snippets
Select a portion with equations
C-c C-e k lto copy as LaTeXPaste into LaTeX editor
Export Keybindings
Primary Keybindings
| Keybinding | Command | Description |
|---|---|---|
| C-c C-e | Export dispatcher | Open export menu |
| C-c C-e h h | HTML export | Export to HTML file |
| C-c C-e h o | HTML export and open | Export HTML and open in browser |
| C-c C-e l l | LaTeX export | Export to .tex file |
| C-c C-e l p | PDF export | Export to PDF via LaTeX |
| C-c C-e l o | PDF export and open | Export PDF and open viewer |
| C-c C-e m m | Markdown export | Export to .md file |
| C-c C-e d d | DOCX export | Export to .docx file |
| C-c C-e d o | DOCX export and open | Export and open in Word |
| C-c k | Clipboard HTML rich | Copy subtree as rich HTML |
| C-c C-e k h | Clipboard HTML rich | Copy as rich HTML (menu) |
| C-c C-e k H | Clipboard HTML src | Copy HTML source |
| C-c C-e k l | Clipboard LaTeX | Copy LaTeX source |
| C-c C-e k m | Clipboard Markdown | Copy Markdown source |
Additional LaTeX Keybindings
| Keybinding | Command | Description |
|---|---|---|
| C-c C-e l v | Open LaTeX preview | Open PDF preview (if built) |
| C-c C-e l s | Forward sync | Sync cursor position to PDF (SyncTeX) |
Quick Access
For frequently used exports, use the quick commands:
Export Scope
The export system supports three scope modes:
Full Document Export (default)
Exports the entire org file from beginning to end.
Usage: Select "Full document" when prompted for export scope.
Subtree Export
Exports only the current headline and its children.
Usage:
Place cursor on or within a headline
Invoke export dispatcher (`C-c C-e')
Select "Current subtree" as scope
Example:
,* Introduction
Some intro text.
,* Methods ← Cursor here
,** Data Collection
,** Analysis
,* Results
Exporting with subtree scope from "Methods" exports:
Methods heading
Data Collection subsection
Analysis subsection
(Results is NOT included)
Use Cases for Subtree Export
Export a single chapter from a book
Generate standalone reports from sections
Create focused documentation for specific topics
Share individual project components
Visible Content Export
Exports only content that is currently visible (not folded).
Usage:
Fold sections you want to exclude (`Tab' on headings)
Invoke export (`C-c C-e')
Select "Visible content" as scope
This is useful for:
Creating executive summaries (hide details)
Generating public versions (hide private notes)
Focusing on high-level structure
HTML Export Options
Standalone vs. Body-Only
Standalone (default)
Generates complete HTML document:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>My Document</title>
<!-- CSS and JavaScript -->
</head>
<body>
<main>
<!-- Content -->
</main>
</body>
</html>
Custom CSS
Add custom styles via export options:
#+HTML_HEAD: <style>
#+HTML_HEAD: .org-content { max-width: 900px; }
#+HTML_HEAD: h1 { color: #2c3e50; }
#+HTML_HEAD: </style>
Or link external CSS:
#+HTML_HEAD: <link rel="stylesheet" href="custom.css" />
JavaScript Support
Include custom JavaScript:
#+HTML_HEAD: <script src="https://cdn.example.com/lib.js"></script>
#+HTML_HEAD: <script>
#+HTML_HEAD: // Custom initialization
#+HTML_HEAD: </script>
MathJax Configuration
HTML exports use MathJax 3 by default. The CDN URL is:
https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
MathJax automatically renders:
Inline math: \(...\) or $...$
Display math: \[...\] or $$...$$
LaTeX environments: \begin{equation}...\end{equation}
Syntax Highlighting
Code blocks use highlight.js for syntax highlighting:
#+BEGIN_SRC python
def greet(name):
print(f"Hello, {name}!")
Supported languages: Python, JavaScript, Java, C, C++, Rust, Go, Ruby, Shell, SQL, and many more.
LaTeX Export Options
Document Structure
Headline Levels
Control which headline levels become sections:
#+OPTIONS: H:4
H:1 → Only top-level headlines become sections
H:2 → Two levels (section, subsection)
H:3 → Three levels (section, subsection, subsubsection)
H:4 → Four levels (adds paragraph)
Section Numbering
Control section numbering:
#+OPTIONS: num:t % Number all sections
#+OPTIONS: num:nil % No numbering
#+OPTIONS: num:3 % Number up to level 3
In LaTeX output, this sets:
\setcounter{secnumdepth}{3}
Table of Contents
#+OPTIONS: toc:t % Include TOC
#+OPTIONS: toc:nil % No TOC
#+OPTIONS: toc:2 % TOC with 2 levels
Generates:
\tableofcontents
\newpage
Images and Figures
Include images with captions and labels:
#+CAPTION: System Architecture Diagram
#+NAME: fig:architecture
#+ATTR_LATEX: :width 0.8\textwidth :placement [htbp]
[[file:architecture.png]]
Exports to:
\begin{figure}[htbp]
\centering
\includegraphics[width=0.8\textwidth]{architecture.png}
\caption{System Architecture Diagram}
\label{fig:architecture}
\end{figure}
Image Attributes
:width - Image width (e.g., 0.8\textwidth, 12cm)
:height - Image height
:placement - Float placement ([htbp])
:scale - Scale factor (0.5 for 50%)
Bibliography Support
BibTeX Integration
Include bibliography:
#+LATEX_HEADER: \usepackage{natbib}
Reference a citation cite:knuth1984.
bibliography:~/references.bib
bibliographystyle:plainnat
Citation Links
Org-ref style citations work directly:
cite:key → \cite{key}
citep:key → \citep{key} (parenthetical)
citet:key → \citet{key} (textual)
citeauthor:key → \citeauthor{key}
citeyear:key → \citeyear{key}
HTML Citation Export
HTML export includes full citation processing using citation-js, which formats citations according to standard citation styles (CSL).
Supported Citation Formats
The following citation link types are supported in HTML export:
| Link Type | Example | Output Style |
|---|---|---|
cite: | cite:knuth1984 | Parenthetical (Smith, 2020) |
citep: | citep:knuth1984 | Parenthetical (Smith, 2020) |
citet: | citet:knuth1984 | Textual: Smith (2020) |
citeauthor: | citeauthor:knuth1984 | Author only: Smith |
citeyear: | citeyear:knuth1984 | Year only: 2020 |
[cite:@key] | [cite:@knuth1984] | Org 9.5+ style |
Specifying Bibliography Files
To include citations in HTML export, specify your bibliography file(s):
#+BIBLIOGRAPHY: references.bib
Or use a bibliography link:
[[bibliography:~/path/to/references.bib]]
The export system automatically:
Finds all
#+BIBLIOGRAPHY:keywords and[[bibliography:...]]linksLoads the BibTeX entries from those files
Formats citations according to the selected style
Generates a bibliography section at the end of the document
Citation Styles
The default citation style is APA. You can change it with the #+CSL_STYLE: keyword:
#+CSL_STYLE: apa
Available built-in styles:
| Style | Description |
|---|---|
apa | American Psychological Association (default) |
mla | Modern Language Association |
chicago | Chicago Manual of Style |
harvard | Harvard referencing |
ieee | IEEE citation format |
vancouver | Vancouver (numeric) style |
Example Document with Citations
#+TITLE: My Research Paper
#+AUTHOR: Jane Doe
#+BIBLIOGRAPHY: references.bib
#+CSL_STYLE: apa
,* Introduction
Recent advances in machine learning cite:lecun2015 have enabled
remarkable progress in computer vision. According to citet:krizhevsky2012,
deep convolutional networks outperform traditional methods.
,* Methods
We follow the approach of citep:he2016,simonyan2014 for our experiments.
Bibliography Output
The bibliography section is automatically generated at the end of the HTML document with:
A "References" heading (customizable)
Properly formatted entries according to the CSL style
Hanging indent formatting for readability
Missing Citations
If a citation key is not found in the bibliography:
The citation appears with a "missing" CSS class
It renders as
[missing: key]in red italic textCheck your
.bibfile for the correct key spelling
Configuring Citation Defaults
You can configure default citation behavior in VS Code settings:
{
"scimax.references.defaultCiteStyle": "citep"
}
Options: cite, citep, citet, citeauthor, citeyear
Advanced LaTeX Features
Custom Environments
Use #+BEGIN_LATEX blocks for raw LaTeX:
#+BEGIN_LATEX
\begin{theorem}[Pythagorean Theorem]
For a right triangle with legs $a$ and $b$ and hypotenuse $c$:
\[a^2 + b^2 = c^2\]
\end{theorem}
#+END_LATEX
Special Blocks
Special blocks map to LaTeX environments:
#+BEGIN_abstract
This paper presents a novel approach...
#+END_abstract
#+BEGIN_theorem
If $P$, then $Q$.
#+END_theorem
#+BEGIN_proof
Assume $P$. Then...
#+END_proof
Math Environments
LaTeX math environments work directly:
\begin{equation}
E = mc^2
\label{eq:einstein}
\end{equation}
\begin{align}
x &= a + b \\
y &= c + d
\end{align}
PDF Export Configuration
Compiler Selection
Set the LaTeX compiler in VS Code settings:
pdflatex (default)
Fast compilation
Wide compatibility
Standard LaTeX packages
ASCII and Latin-1 support
Configuration:
{
"scimax.latexLivePreview.compiler": "pdflatex"
}
xelatex
Unicode support (UTF-8)
System fonts (TrueType, OpenType)
Modern typography
Required for non-Latin scripts
Configuration:
{
"scimax.latexLivePreview.compiler": "xelatex"
}
Example with system fonts:
#+LATEX_HEADER: \usepackage{fontspec}
#+LATEX_HEADER: \setmainfont{Libertinus Serif}
#+LATEX_HEADER: \setmonofont{Fira Code}
lualatex
Unicode support
Lua scripting in LaTeX
Advanced typography
Memory-efficient for large documents
Configuration:
{
"scimax.latexLivePreview.compiler": "lualatex"
}
latexmk Configuration
The export system uses latexmk for reliable compilation:
Benefits
Automatic multiple passes (for TOC, references, etc.)
Bibliography processing (BibTeX/Biber)
Dependency tracking
Incremental builds
Configuration File
Create .latexmkrc in your project directory:
# Use pdflatex
$pdf_mode = 1;
# Clean auxiliary files
$clean_ext = "synctex.gz synctex.gz(busy) run.xml";
# Custom compiler options
$pdflatex = 'pdflatex -interaction=nonstopmode -shell-escape %O %S';
Disabling latexmk
If you prefer direct compiler invocation:
{
"scimax.latexLivePreview.useLatexmk": false
}
Build Automation
Build on Save
Automatically rebuild PDF when saving:
{
"scimax.latexLivePreview.buildOnSave": true
}
Build on Idle
Build after idle period (useful for live preview):
{
"scimax.latexLivePreview.buildOnIdle": true,
"scimax.latexLivePreview.idleDelay": 2000
}
SyncTeX Integration
SyncTeX enables bidirectional sync between source and PDF:
Forward Sync (Source → PDF)
Place cursor in org file
Press `C-c C-e l s'
PDF viewer jumps to corresponding location
Reverse Sync (PDF → Source)
C-click in PDF viewer (if supported) to jump to source line.
Markdown Export Details
GitHub-Flavored Markdown (GFM)
The Markdown export follows GitHub's flavor for maximum compatibility.
Supported Elements
Headings
,* Level 1 → # Level 1
,** Level 2 → ## Level 2
,*** Level 3 → ### Level 3
Text Formatting
*bold* → **bold**
/italic/ → *italic*
_underline_ → _underline_
+strikethrough+ → ~~strikethrough~~
=code= → `code`
~verbatim~ → `verbatim`
Lists
- Item 1
- Item 2
- Nested
1. First
2. Second
3. Third
Code Blocks
#+BEGIN_SRC python
def hello():
print("Hello")
Exports to:
```python
def hello():
print("Hello")
```
Tables
| Name | Age | City |
|-------+-----+------------|
| Alice | 30 | New York |
| Bob | 25 | London |
Exports to:
| Name | Age | City |
| --- | --- | --- |
| Alice | 30 | New York |
| Bob | 25 | London |
Links
[[https://example.com][Example Site]] → [Example Site](https://example.com)
[[file:image.png]] → [image.png](image.png)
Images
[[file:diagram.png]] → 
Metadata Handling
Document metadata is converted:
#+TITLE: My Document
#+AUTHOR: Jane Doe
#+DATE: 2024-01-15
Becomes:
# My Document
*Jane Doe*
2024-01-15
Export Options Reference
#+OPTIONS Keyword
The #+OPTIONS keyword controls various export behaviors:
Syntax
#+OPTIONS: key1:value1 key2:value2 ...
✅ Complete OPTIONS Reference
| Option | Values | Default | Description |
|---|---|---|---|
| toc | t, nil, N | nil | Table of contents (N depth) |
| num | t, nil, N | t | Section numbering (N depth) |
| H | N | 0 | Headline levels to export (0 all) |
| author | t, nil | t | Include author in output |
| date | t, nil | t | Include date in output |
| t, nil | nil | Include email in output | |
| tags | t, nil, not-in-toc | t | Include tags in headlines |
| todo | t, nil | t | Include TODO keywords in headlines |
| pri | t, nil | nil | Include priority cookies ([#A], etc.) |
| <, timestamp | t, nil | t | Include timestamps |
| creator | t, nil | nil | Include creator string in postamble |
| f | t, nil | t | Include footnotes |
| p | t, nil | nil | Include statistics cookies (, ) |
| c | t, nil | nil | Include CLOCK entries |
| d | t, nil, (list) | nil | Include drawers (or specific drawers) |
| prop | t, nil | t | Include PROPERTIES drawers |
| \vert{} | t, nil | t | Include tables |
| ^ | t, nil, {} | t | Sub/superscripts ({} requires braces) |
| : | t, nil | t | Include fixed-width sections |
| \n | t, nil | nil | Preserve line breaks |
Examples
#+OPTIONS: toc:3 num:t H:4 author:t date:t tags:nil todo:nil
#+OPTIONS: toc:nil num:nil author:nil date:nil tags:nil todo:nil pri:nil
#+OPTIONS: toc:t num:t H:3 ^:{} author:t date:t email:t
#+OPTIONS: d:t c:t p:t
#+OPTIONS: d:("LOGBOOK" "NOTES")
#+OPTIONS: tags:not-in-toc
Document Keywords
Required Keywords
#+TITLE: Document Title
#+AUTHOR: Your Name
#+DATE: 2024-01-15
#+EMAIL: you@example.com
#+LANGUAGE: en
Note: #+EMAIL is only included in output when email:t is set in OPTIONS.
HTML-Specific Keywords
#+HTML_HEAD: <style>body { font-family: sans-serif; }</style>
#+HTML_HEAD_EXTRA: <meta name="keywords" content="research, science" />
#+HTML_LINK_HOME: index.html
#+HTML_LINK_UP: ../index.html
LaTeX-Specific Keywords
#+LATEX_CLASS: article
#+LATEX_CLASS_OPTIONS: [11pt,a4paper]
#+LATEX_HEADER: \usepackage{geometry}
#+LATEX_HEADER: \geometry{margin=1in}
#+LATEX_COMPILER: pdflatex
✅ Export Settings Keywords
EXPORTFILENAME
Override the output file name:
#+EXPORT_FILE_NAME: custom-output-name
If set to
custom-output-name, exporting to HTML producescustom-output-name.htmlThe extension is automatically appended based on export format
If the keyword already includes the correct extension, it's used as-is
Paths are relative to the org file's directory
Example:
#+TITLE: My Report
#+EXPORT_FILE_NAME: final-report-v2
,* Content here...
Exporting to PDF produces final-report-v2.pdf instead of the default filename.
Configuration Settings
Export Settings Location
All export settings are in VS Code preferences:
`C-,' (`s-,' on Mac) to open Settings
Search for "scimax export" or "scimax latex"
Modify settings as needed
LaTeX Export Configuration
Custom Header
{
"scimax.export.latex.customHeader": "\\documentclass[12pt]{article}\n\\usepackage[utf8]{inputenc}\n\\usepackage{graphicx}\n\\usepackage{amsmath}"
}
Or in settings.json:
{
"scimax.export.latex.customHeader": [
"\\documentclass[12pt]{article}",
"\\usepackage[utf8]{inputenc}",
"\\usepackage{graphicx}",
"\\usepackage{amsmath}",
"\\usepackage[colorlinks=true]{hyperref}"
]
}
LaTeX Preview Settings
Compiler
{
"scimax.latexLivePreview.compiler": "xelatex"
}
Use latexmk
Build on Save
Build on Idle
Idle Delay
Complete Configuration Example
{
// LaTeX Export
"scimax.export.latex.customHeader": "",
// LaTeX Preview
"scimax.latexLivePreview.compiler": "pdflatex",
"scimax.latexLivePreview.useLatexmk": true,
"scimax.latexLivePreview.buildOnSave": true,
"scimax.latexLivePreview.buildOnIdle": false,
"scimax.latexLivePreview.idleDelay": 2000,
// LaTeX Equation Preview
"scimax.latexPreview.enabled": true,
"scimax.latexPreview.cacheEnabled": true,
"scimax.latexPreview.darkModeAware": true
}
Advanced Export Techniques
Conditional Export
Exclude Content by Tag
Tag headlines to exclude them from export:
#+EXCLUDE_TAGS: noexport private draft
,* Public Section
Content for everyone.
,* Private Notes :noexport:
Internal notes not included in export.
,* Draft Ideas :draft:
Work in progress, excluded.
Select Content by Tag
Only export tagged content:
#+SELECT_TAGS: export publish
,* Internal Document
This section won't be exported.
,* Published Chapter :export:
This section will be exported.
Backend-Specific Content
HTML-Only Content
#+BEGIN_EXPORT html
<div class="alert alert-info">
This appears only in HTML export.
</div>
#+END_EXPORT
LaTeX-Only Content
#+BEGIN_EXPORT latex
\begin{tcolorbox}[title=Important]
This appears only in LaTeX/PDF export.
\end{tcolorbox}
#+END_EXPORT
Export Snippets
Inline backend-specific content:
Click @@html:<button>@@here@@html:</button>@@ to continue.
The value is @@latex:\textcolor{red}{@@important@@latex:}@@.
Macros for Reusable Content
Define macros for repeated content:
#+MACRO: version 2.5.0
#+MACRO: author-email john.doe@example.com
Current version: {{{version}}}
Contact: {{{author-email}}}
Built-in macros:
{{{date}}} - Current date
{{{time}}} - Current time
{{{title}}} - Document title
{{{author}}} - Document author
Include Files
Include content from other files using the #+INCLUDE: directive. Files are processed during export, allowing modular document organization.
Basic Syntax
,#+INCLUDE: "chapter1.org"
,#+INCLUDE: "path/to/file.org"
Paths can be relative (to the current document) or absolute.
Block Wrappers
Wrap included content in a block:
,# Include as source code block
,#+INCLUDE: "code/example.py" src python
,#+INCLUDE: "script.sh" src bash
,# Include as example (verbatim) block
,#+INCLUDE: "output.txt" example
,# Include as quote block
,#+INCLUDE: "excerpt.txt" quote
,# Include as export block (raw format)
,#+INCLUDE: "custom.html" export html
Line Selection with :lines
Include only specific lines from a file:
,# Lines 10 through 20 (inclusive, 1-indexed)
,#+INCLUDE: "data.org" :lines "10-20"
,# From line 10 to end of file
,#+INCLUDE: "data.org" :lines "10-"
,# From beginning to line 20
,#+INCLUDE: "data.org" :lines "-20"
,# Single line
,#+INCLUDE: "data.org" :lines "15"
Headline Level Adjustment with :minlevel
Shift all headlines in the included file to a minimum level:
,# Shift headlines so the minimum level is 2
,#+INCLUDE: "chapter.org" :minlevel 2
This is useful for including a standalone document as a section:
A file with * Heading becomes ** Heading with :minlevel 2
Sub-headlines are adjusted proportionally
Content Only with :only-contents
Strip the first headline and include only its contents:
,#+INCLUDE: "section.org" :only-contents t
This extracts the body of the first headline without including the headline itself.
Combining Options
Options can be combined:
,# Include lines 5-25 of Python file, shift headlines to level 3
,#+INCLUDE: "code.py" src python :lines "5-25"
,# Include chapter, make it a subsection (minlevel 2)
,#+INCLUDE: "chapter.org" :minlevel 2 :only-contents t
Recursive Includes
Included files can themselves contain #+INCLUDE: directives, which are processed recursively. A maximum depth of 10 levels prevents infinite loops.
Example: Modular Book Structure
,#+TITLE: My Book
,#+AUTHOR: Author Name
,#+INCLUDE: "frontmatter.org"
,* Part I: Introduction
,#+INCLUDE: "chapters/intro.org" :minlevel 2
,* Part II: Main Content
,#+INCLUDE: "chapters/chapter1.org" :minlevel 2
,#+INCLUDE: "chapters/chapter2.org" :minlevel 2
,* Appendices
,#+INCLUDE: "appendices/code-samples.org" :minlevel 2
,* Index
,#+INCLUDE: "backmatter/index.org" :only-contents t
Custom Link Types
Define custom export behavior for link types:
# Link to bug tracker
[[bug:1234][Bug #1234]]
# Link to commit
[[commit:abc123][View commit]]
Troubleshooting
HTML Export Issues
MathJax Not Rendering
Ensure internet connection (MathJax loads from CDN)
Check browser console for errors
Verify math syntax (use \(...\) or $...$ for inline, \[...\] for display)
Broken Images
Use relative paths: [[file:./images/plot.png]]
Ensure images are in same directory or subdirectory
Check image file names (case-sensitive on Linux)
CSS Not Applied
Verify #+HTML_HEAD: syntax
Check CSS selector specificity
Inspect generated HTML for CSS inclusion
LaTeX/PDF Export Issues
Missing Packages
# TeX Live
sudo tlmgr install xyz
# MiKTeX (Windows)
miktex packages install xyz
# MacTeX
sudo tlmgr install xyz
Unicode Errors
Switch to XeLaTeX or LuaLaTeX:
Or use LaTeX-safe characters
Bibliography Not Generated
Ensure `.bib' file exists
Use `latexmk' (handles BibTeX automatically)
Check citation keys match bibliography entries
Verify bibliography: and bibliographystyle: links
Images Not Found
Use relative paths from org file location
Avoid spaces in filenames
Use supported formats: PNG, JPG, PDF, EPS
Check \graphicspath if using custom image directories
Compilation Timeout
Check for infinite loops in LaTeX code
Reduce document size
Disable auto-build: buildOnSave: false
Review `.log' file for warnings
Markdown Export Issues
Table Alignment
GitHub-flavored Markdown tables are left-aligned by default
Org-mode alignment hints (<l>, <c>, <r>) are not supported
Consider using HTML tables for complex layouts
Math Not Rendering
GitHub supports some math via $$...$$ (display) and $...$ (inline)
Other platforms may require MathJax integration
Consider exporting to HTML for math-heavy content
General Export Issues
Empty Export
Check export scope (full vs. subtree)
Verify content isn't excluded by tags
Ensure headlines match H: level setting
Review #+OPTIONS settings
Slow Export
Disable `buildOnIdle' for PDF export
Reduce `toc' depth
Split large documents into smaller files
Use #+INCLUDE: for modular organization
Wrong Output Location
Check #+EXPORT_FILE_NAME: keyword
Verify save dialog selection
Review file permissions in target directory
Best Practices
Document Organization
Use Meaningful Headings
Clear, descriptive headline text
Logical hierarchy (avoid jumping levels)
Consistent depth for similar content
Metadata at Top
#+TITLE: Document Title
#+AUTHOR: Your Name
#+DATE: 2024-01-15
#+OPTIONS: toc:t num:t
#+LATEX_CLASS: article
Separate Concerns
Content in main file
References in `.bib' file
Images in images/ directory
Custom styles in `.css' file
Version Control
Track Generated Files Separately
Add to .gitignore:
*.pdf
*.html
*.tex
*.aux
*.log
*.out
*.toc
Use Meaningful Commit Messages
Update export configuration for XeLaTeX support
Add custom LaTeX preamble for ACM format
Fix image paths in HTML export
✅ Performance Optimization
✅ For Large Documents
Disable auto-build during editing
Use #+INCLUDE: for modular structure
Cache expensive computations
Optimize image sizes
✅ For Fast Iteration
Use HTML preview for quick checks
Enable `buildOnIdle' with appropriate delay
Use body-only export for faster generation
Minimize custom packages
✅ Example Workflows
✅ Academic Paper Workflow
1. Initial Setup
#+TITLE: Novel Approach to Machine Learning
#+AUTHOR: Dr. Jane Smith
#+DATE: \today
#+OPTIONS: toc:t num:t H:3
#+LATEX_CLASS: IEEEtran
#+LATEX_HEADER: \usepackage{amsmath,amssymb}
#+LATEX_HEADER: \usepackage{algorithm,algorithmic}
#+BIBLIOGRAPHY: references.bib
2. Write Content
Structure with standard sections:
Abstract
Introduction
Related Work
Methodology
Results
Discussion
Conclusion
3. Add Citations
Recent work cite:smith2023 has shown...
4. Export to PDF
`C-c C-e l p' → PDF via LaTeX
5. Submit
Review generated PDF, make final edits, submit.
Technical Documentation Workflow
1. Setup
#+TITLE: API Documentation
#+AUTHOR: Development Team
#+OPTIONS: toc:2 num:nil H:4
#+HTML_HEAD: <link rel="stylesheet" href="docs.css" />
2. Write Sections
Getting Started
API Reference
Examples
Troubleshooting
3. Export to HTML
`C-c C-e h h' → HTML
4. Deploy
Copy HTML and CSS to docs server or GitHub Pages.
✅ Blog Post Workflow
✅ 1. Write in Org
#+TITLE: 10 Tips for Better Python Code
#+AUTHOR: Tech Blogger
#+DATE: 2024-01-15
#+OPTIONS: toc:nil num:nil
✅ 2. Export to Markdown
`C-c C-e m m' → Markdown
✅ 3. Publish
Copy Markdown to CMS or static site generator (Hugo, Jekyll, etc.)
✅ Resources
✅ External Links
✅ Org-Mode Documentation
✅ LaTeX Resources
✅ Community
✅ Appendix
✅ Complete Keybinding Reference
| Keybinding | Command | Description |
|---|---|---|
| C-c C-e | Export dispatcher | Open export menu |
| C-c C-e h h | HTML export | Export to .html |
| C-c C-e h o | HTML export and open | Export and open in browser |
| C-c C-e h p | HTML preview | Preview in VS Code webview |
| C-c C-e l l | LaTeX export | Export to .tex |
| C-c C-e l p | PDF export | Export to PDF |
| C-c C-e l o | PDF export and open | Export and open PDF |
| C-c C-e l v | LaTeX preview | Open PDF preview |
| C-c C-e l s | Forward sync | Sync cursor to PDF (SyncTeX) |
| C-c C-e m m | Markdown export | Export to .md |
| C-c C-e m o | Markdown export and open | Export and open in editor |
| C-c C-e d d | DOCX export | Export to .docx |
| C-c C-e d o | DOCX export and open | Export and open in Word |
| C-c k | Clipboard HTML (rich) | Copy subtree as rich HTML |
| C-c C-e k h | Clipboard HTML (rich) | Copy as rich HTML (menu) |
| C-c C-e k H | Clipboard HTML (source) | Copy HTML source code |
| C-c C-e k l | Clipboard LaTeX | Copy LaTeX source code |
| C-c C-e k m | Clipboard Markdown | Copy Markdown source code |
✅ Export Options Quick Reference
| Option | Values | Default | Effect |
|---|---|---|---|
| toc | t/nil/N | nil | Table of contents (N = depth) |
| num | t/nil/N | t | Section numbering (N = depth) |
| H | N | 0 | Export headlines up to level N |
| author | t/nil | t | Include author name |
| date | t/nil | t | Include date |
| t/nil | nil | Include email (from #+EMAIL) | |
| tags | t/nil/not-in-toc | t | Include tags in headlines |
| todo | t/nil | t | Include TODO keywords |
| pri | t/nil | nil | Include priority cookies ([#A]) |
| < | t/nil | t | Include timestamps |
| creator | t/nil | nil | Include creator in postamble |
| f | t/nil | t | Include footnotes |
| p | t/nil | nil | Include planning info |
| c | t/nil | nil | Include CLOCK entries |
| d | tnil(list) | nil | Include drawers |
| \vert{} | t/nil | t | Include tables |
| ^ | tnil{} | t | Sub/superscripts ({}=braces required) |
| : | t/nil | t | Include fixed-width sections |
| \n | t/nil | nil | Preserve line breaks |
LaTeX Package Reference
Essential Packages (Auto-Included)
| Package | Purpose |
|---|---|
| inputenc | Character encoding (UTF-8) |
| fontenc | Font encoding (T1) |
| hyperref | Hyperlinks and PDF metadata |
| graphicx | Image inclusion |
| amsmath | Mathematical typesetting |
| amssymb | Math symbols |
| booktabs | Professional tables |
| listings | Code listing (if enabled) |
| ulem | Strike-through support |
Optional Packages
| Package | Purpose | Add With |
|---|---|---|
| geometry | Page layout | #+LATEXHEADER: |
| natbib | Bibliography | #+LATEXHEADER: |
| minted | Advanced syntax highlighting | #+LATEXHEADER: |
| tikz | Graphics and diagrams | #+LATEXHEADER: |
| tcolorbox | Colored boxes | #+LATEXHEADER: |
| cleveref | Smart cross-references | #+LATEXHEADER: |
| fontspec | System fonts (XeLaTeX/LuaLaTeX) | #+LATEXHEADER: |
HTML Classes and IDs
Exported HTML uses semantic classes for styling:
Document Structure
`.org-content' - Main content container
`.org-section' - Document section
`.org-preamble' - Document preamble
`#title-block' - Title, author, date header
Headings and TOC
`.org-toc' - Table of contents
`.section-number' - Section number prefix
Text Elements
`.org-todo' - TODO keyword
`.org-done' - DONE keyword
`.org-priority' - Priority marker
`.org-tags' - Tag container
`.org-tag' - Individual tag
`.org-timestamp' - Timestamp
`.org-underline' - Underlined text
Blocks
`.org-src-container' - Source block wrapper
`.src' - Source block pre element
`.example' - Example block
`.org-center' - Centered content
`.org-latex-environment' - LaTeX environment
Tables and Lists
`.org-table' - Table element
`.org-footnotes' - Footnotes container
`.org-footnote' - Individual footnote
`.org-footnote-ref' - Footnote reference link
Admonitions
`.admonition' - Generic admonition
`.org-warning' - Warning box
`.org-note' - Note box
`.org-tip' - Tip box
`.org-important' - Important box
Troubleshooting Decision Tree
Export Problem?
├─ HTML Export
│ ├─ Math not rendering → Check MathJax CDN, internet connection
│ ├─ Images broken → Verify paths, file existence
│ └─ Styling wrong → Check CSS inclusion, specificity
├─ PDF Export
│ ├─ Compilation fails
│ │ ├─ Missing package → Install via tlmgr/MiKTeX
│ │ ├─ Unicode error → Switch to XeLaTeX/LuaLaTeX
│ │ └─ Timeout → Review .log, reduce complexity
│ ├─ Bibliography missing → Check .bib file, use latexmk
│ └─ Images not found → Verify paths, formats (PNG/JPG/PDF)
├─ Markdown Export
│ ├─ Tables misaligned → GFM limitation, consider HTML
│ └─ Math not rendering → Platform-specific, try HTML
└─ General
├─ Empty export → Check scope, tags, OPTIONS
├─ Slow → Disable auto-build, optimize images
└─ Wrong location → Check EXPORT_FILE_NAME, save dialog
This documentation covers the complete export system in Scimax VS Code. For additional help, consult the project repository or file an issue.