SkillAgentSearch skills...

Orgmk

Streamline your Org document exports to PDF, HTML, DOC, and more with OrgMk. Simplify document compilation and enhance productivity. #orgmode #productivity #automation

Install / Use

/learn @fniessen/Orgmk
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

#+TITLE: Export Org mode documents to HTML, PDF, etc. #+AUTHOR: Fabrice Niessen #+EMAIL: (concat "fniessen" at-sign "pirilampo.org") #+DESCRIPTION: Orgmk completely automates the export of Org documents. #+KEYWORDS: org-mode, orgmk, export, automate, emacs, pdf, latex, html #+LANGUAGE: en #+OPTIONS: H:4 toc:t num:nil

#+PROPERTY: header-args :eval no :noweb yes :comments no #+SETUPFILE: ~/org/html-theme-readtheorg.setup

#+begin_export html <a href="http://opensource.org/licenses/GPL-3.0"> <img src="http://img.shields.io/:license-gpl-blue.svg" alt=":license-gpl-blue.svg" /> </a>

<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=VCVAS6KPDQ4JC&lc=BE&item_number=orgmk&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted"> <img src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" alt="btn_donate_LG.gif" /> </a> #+end_export

#+begin_quote [!TIP]

*** Transform your Emacs experience in Paris from 24 to 28 November 2025! Unlock unparalleled productivity with my exclusive "EmacsBoost" course!*

Are you ready to /supercharge your productivity/ and become an unstoppable Emacs ninja? This is the opportunity you've been waiting for!

What you'll learn:

  • Expertly master Emacs from the ground up to advanced techniques that set you apart.
  • /Maximize your editing efficiency/ and elevate your workflow to new heights.
  • Personalize Emacs to perfectly fit your unique style and needs.
  • And much more tips and tricks!

Who should join:

This course is designed for everyone passionate about Emacs -- from curious beginners to seasoned users looking to refine their skills.

Why choose my course?

  • Learn from an expert instructor with over 26 years of Emacs mastery.
  • Engage in /dynamic hands-on exercises/ that reinforce and enhance your learning journey.
  • Enjoy /exclusive networking opportunities/ with fellow Emacs enthusiasts who share your passion.
  • Experience personalized guidance tailored just for you.

Seize this exceptional opportunity to elevate your Emacs skills to new levels! \

Visit https://emacsboost.com/en/ for more details, course dates and locations, and to /secure your place today/. #+end_quote

  • Overview

** Description

Orgmk is a suite of Bash scripts for automating the conversion of Org mode documents to different formats (such as HTML or PDF) from the command line.

#+begin_export html

<script src="http://platform.twitter.com/widgets.js"></script>

<a href="https://twitter.com/share" class="twitter-share-button" data-via="f_niessen">Tweet</a> #+end_export

The scripts run on both Unix and Microsoft Windows (with Cygwin).

** Objectives

The first goal is to be more productive, by running the export only when the source Org files are updated.

The second goal is to share some common Emacs and Org configuration inside your team, separately of what you have in your personal Emacs configuration file.

Finally, the third goal is also to offload compilation into an external batch Emacs process, allowing you to go on editing or working while exporting the documents.

** Quotations

"If one has been trying to bulk convert many quickly changing org-documents, [one] will appreciate the power and flexibility of this tool." \ -- /z27/

"Orgmk is a wonderful tool, and, as far as I know, still unique." \ -- /Priyadarshan/

** Requirements :PROPERTIES: :header-args+: :tangle no :END:

*** Emacs 24+

Emacs version 24 (for the ~package~ facility) must be in your =PATH=.

*** Org 8+

Org mode version 8 (or later) is required.

If such a version is not bundled with your Emacs, Org 8 will be automatically installed -- if you accept it! -- through ELPA.

*** LaTeX (PDF)

A working LaTeX installation is required for exporting to PDF. If it is not yet installed on your system, install [[http://www.tug.org/texlive/][TeX Live]] (for example).

  • Usage

Org files can have the extension ~.org~ or ~.txt~.

** Standalone scripts

  • For "weaving" files (producing the formatted documentation files):

    #+begin_src shell org2html [OPTION] FILE org2latex [OPTION] FILE org2pdf [OPTION] FILE org2beamerpdf [OPTION] FILE org2odt [OPTION] FILE org2txt [OPTION] FILE #+end_src

  • For "tangling" files:

    #+begin_src shell org-tangle FILE #+end_src

** Makefile wrapper

#+begin_src shell orgmk [OPTION] orgmk [OPTION] [html | pdf] orgmk [OPTION] [FILE] #+end_src

Currently, =orgmk= does not tangle Org files.

  • Options

** Standalone scripts

  • =-h=, =--help= :: Print usage information and exit.

  • =-y= :: Authorize the update of the source file (update of dynamic blocks and re-computation of tables) without confirmation.

    Before the conversion, the standalone scripts will try to update all dynamic blocks and recompute all tables in the source Org file, a potentially destructive operation for which the programs require confirmation: in case the source file gets updated, you will be queried to overwrite the source file with the updated version of the file -- that's because the environment variable =UPDATE_SRC= defaults to =query=.

    To avoid the question, you can also set that variable to =yes= or =no= in a personal configuration file, =~/.orgmk-rc=.

    Note that, by design, the command line argument =-y= is passed to every =org2<BACKEND>= script called from =orgmk=, so that =orgmk= doesn't wait for answers.

  • =--body-only= :: Export only body (for HTML and LaTeX).

** Makefile wrapper

  • =-h=, =--help= :: Print usage information and exit.

  • =-r=, =--recursive= :: Export all Org files under each directory, recursively.

    It just calls =orgmk.mk= with the argument =ALLSUBDIRS=yes=.

    By default, =orgmk= exports all Org files (which need it) in the current directory only.

  • Files

[[~/.orgmk-rc]]

  • Examples

** Update all documents

Regenerate HTML and/or PDF files for Org files that have been modified.

#+begin_src shell orgmk #+end_src

** Update specific types of documents

Regenerate HTML only for the Org files that have been changed.

#+begin_src shell orgmk html #+end_src

** Update specific document

Regenerate (or create for the first time) the file ~thesis.pdf~ from the Org file ~thesis.org~ or ~thesis.txt~. Don't require confirmation for updating the source file.

#+begin_src shell orgmk thesis.pdf #+end_src

Regenerate (or create for the first time) the file ~thesis.pdf~ from the Org file ~thesis.org~. Require confirmation for updating the source file.

#+begin_src shell org2pdf thesis.org #+end_src

  • Installation

The installation process consists of creating symbolic links from the standard final directories on your machine to the =orgmk= executables.

** Installing from the Git repository

See one-line for installation at https://github.com/tj/git-extras

  1. Extract the latest version of =orgmk=.

    #+begin_src shell git clone git@github.com:fniessen/orgmk.git #+end_src

  2. Create configuration files which record where =orgmk= has been extracted on your host machine.

    #+begin_src shell make #+end_src

  3. By default, the =orgmk= executable and the standalone scripts (=org2html=, =org2pdf=, etc.) are installed to the ~/usr/local/bin~ so that all users are able to run them.

    If you want to change the destination directory, create a ~Make.params~ file with the target directory. For example:

    #+begin_src makefile BIN_DIR=~/bin #+end_src

    If needed, add that directory to your =PATH=.

    Install =orgmk= (executable and standalone scripts that you run) to the =BIN_DIR= location by typing:

    #+begin_src shell make install #+end_src

At this point, everything should be ready for use.

** Makefile for installation :PROPERTIES: :header-args+: :shebang "" :tangle Makefile :END:

#+begin_src makefile

-- Makefile -- definition file for Orgmk

To install orgmk', type make' and then `make install'.

PWD=$(shell pwd)

BIN_DIR=/usr/local/bin

-include Make.params

ORGMK_ROOT=$(PWD) ORGMK_EL=$(ORGMK_ROOT)/site-lisp/orgmk.el

WARNING -- ORGMK_EL must contain the correct path to the `orgmk.el' file

according to the Emacs version used (Windows, Cygwin or Linux path).

EMACS_SYSTEM_TYPE=$(shell emacs -batch --eval "(message "%s" system-type)" 2>&1) ifeq ($(EMACS_SYSTEM_TYPE),windows-nt) ORGMK_EL:="$(shell cygpath --mixed $(ORGMK_EL))" endif

ORGMK_INIT=orgmk-init ORGMK_SYSTEM_CONFIG=orgmk.conf ORGMK_UPDATE_CHECK_DIFF=orgmk-update-src-check-diff ORG2HTML=org2html ORG2GFM=org2gfm ORG2MD=org2md

ORG2REVEAL=org2reveal

ORG2LATEX=org2latex ORG2PDF=org2pdf ORG2BEAMERPDF=org2beamerpdf ORG2ODT=org2odt ORG2TXT=org2txt ORGTANGLE=org-tangle ORGMK_MAKE_SETUP=orgmk-stow-orgmk.mk ORGMK_MAKE_RUN=orgmk

MAKE

Ensure `all' is the default target

all: bin/$(ORGMK_SYSTEM_CONFIG) bin/$(ORGMK_MAKE_SETUP) # Create Orgmk system files

bin/$(ORGMK_SYSTEM_CONFIG): # Create file with location of `orgmk.el' @echo "Generating system-wide configuration file..." echo "ORGMK_EL=$(ORGMK_EL)" > bin/$(ORGMK_SYSTEM_CONFIG) @echo

bin/$(ORGMK_MAKE_SETUP): # Create core file for `orgmk' @echo "Generating setup file..." echo "#!/bin/sh" > bin/$(ORGMK_MAKE_SETUP) echo "ln -f -s $(PWD)/bin/orgmk.mk orgmk.mk" >> bin/$(ORGMK_MAKE_SETUP) chmod u+x bin/$(ORGMK_MAKE_SETUP) @echo

MAKE INSTALL

.PHONY: install install: all # Create symlinks to Orgmk scripts @echo "Creating symlinks..." ln -f -s $(PWD)/bin/$(ORGMK_INIT) $(BIN_DIR)/$(ORGMK_INIT) ln -f -s $(PWD)/bin/$(ORGMK_SYSTEM_CONFIG) $(BIN_DIR)/$(ORGMK_SYSTEM_CONFIG) ln -f -s $(PWD)/bin/$(ORGMK_UPDATE_CHECK_DIFF) $(BIN_DIR)/$(ORGMK_UPDATE_CHECK_DIFF) ln -f -s $(PWD)/bin/$(ORG2HTML) $(BIN_DIR)/$(ORG2HTML) ln -f -s $(PWD)/bin/$(ORG2GFM) $(BIN_DIR)/$(ORG2GFM) ln -f -s $(PWD)/bin/$(ORG2MD)

View on GitHub
GitHub Stars233
CategoryDevelopment
Updated1mo ago
Forks28

Languages

Emacs Lisp

Security Score

80/100

Audited on Feb 18, 2026

No findings