The file RHOLANG_STRUCTURAL_CORRECTION.org is an Emacs Org-mode version of the design document that can be compiled to PDF with proper LaTeX formatting.
emacs docs/RHOLANG_STRUCTURAL_CORRECTION.org
Then in Emacs:
C-c C-e (export menu)l (LaTeX export)p (export to PDF and open)cd docs
emacs --batch \
--eval "(require 'ox-latex)" \
--visit=RHOLANG_STRUCTURAL_CORRECTION.org \
--funcall org-latex-export-to-pdf
This will create RHOLANG_STRUCTURAL_CORRECTION.pdf in the same directory.
emacs --batch \
--eval "(progn
(require 'ox-latex)
(find-file \"docs/RHOLANG_STRUCTURAL_CORRECTION.org\")
(org-latex-export-to-pdf))"
You need a LaTeX distribution installed:
Linux:
# Debian/Ubuntu
sudo apt-get install texlive-full emacs
# Arch Linux
sudo pacman -S texlive-most emacs
# Fedora
sudo dnf install texlive-scheme-full emacs
macOS:
brew install --cask mactex
brew install emacs
Windows:
The org file includes these LaTeX packages:
amsmath - Mathematical typesettingamssymb - Mathematical symbolsamsthm - Theorem environmentsmathtools - Enhanced math typesettingunicode-math - Unicode math symbolslistings - Code listingsxcolor - Color supporthyperref - PDF hyperlinksgeometry - Page layoutfancyvrb - Enhanced verbatimtikz - Diagrams (if needed)Inline math: $T_{total} = T_{lexical} \otimes T_{syntactic}$
Display math:
\[
T_{total} = T_{semantic} \circ T_{structural} \circ T_{syntactic} \circ T_{lexical}
\]
#+begin_src rust
pub struct SyntaxAwareCorrector {
language: Language,
transition_map: HashMap<(String, usize), Vec<String>>,
}
#+end_src
\begin{theorem}
WFSTs are closed under composition.
\end{theorem}
GitHub automatically renders .org files:
https://github.com/your-repo/docs/RHOLANG_STRUCTURAL_CORRECTION.org
emacs docs/RHOLANG_STRUCTURAL_CORRECTION.org
Use standard Emacs org-mode navigation:
TAB - Cycle visibility of current headingS-TAB - Cycle visibility globallyC-c C-n / C-c C-p - Next/previous headingIf you update the .md file:
python3 docs/convert_to_org_advanced.py
This will regenerate the .org file from the latest markdown.
Edit the org file header to customize PDF output:
#+LATEX_CLASS_OPTIONS: [11pt,a4paper] # Change to [12pt,letterpaper] for US letter
#+LATEX_HEADER: \geometry{left=1in,right=1in,top=1in,bottom=1in} # Adjust margins
Install missing LaTeX packages:
# Ubuntu/Debian
sudo apt-get install texlive-latex-extra texlive-fonts-extra
# Or install on-the-fly (MiKTeX)
# MiKTeX will prompt to install missing packages automatically
Make sure Emacs has org-mode and LaTeX export loaded:
(require 'ox-latex)
The document is large (7,500+ lines). PDF generation may take 1-2 minutes. Be patient or compile in parts by editing the org file.
| Feature | Markdown | Org-Mode |
|---|---|---|
| Math equations | Limited (inline code) | Full LaTeX support |
| PDF export | Requires pandoc | Native via LaTeX |
| Code blocks | Syntax highlighting | Executable + highlighting |
| Cross-references | Manual | Automatic |
| Bibliography | Not native | BibTeX integration |
| Theorems/Proofs | None | LaTeX environments |
| Page breaks | Not supported | Full control |
| Professional typography | No | Yes (via LaTeX) |
Same as parent project.
For issues with:
convert_to_org_advanced.pyCan you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |