Skip to content

export obsidian markdown files in a format that can be pasted into a TeX file

License

Notifications You must be signed in to change notification settings

raineszm/obsidian-export-to-tex

Repository files navigation

obsidian-export-to-tex

License: MIT

Export to obsidian notes to LaTeX format, suitable for pasting into a TeX file.

Installation

If you have Obsidian version 0.9.8 or greater:

  1. Open the options pane
  2. Go to Third-party plugins
  3. Ensure that safe-mode is off. (WARNING: Please verify for yourself the safety of any plugins before using them.)
  4. Click Browse next to Community Plugins
  5. Search for Export To TeX
  6. Click Install
  7. Go back to the Third-party plugins page and enable Export To TeX

To update simply go back to the Third-Party plugins page for Export To TeX and click Update.

Manual Installation

To manually install

  1. download the latest zipfrom the latest Github Release
  2. unzip the contents into the .plugins/obsidian-export-to-tex subdirectory of your vault.
  3. reload obsidian
  4. go into settings > third party plugins and activate obsidian-export-to-tex

For details see the forums.

Usage

This plugin allows Obsidian files to exported to TeX format. When doing so:

  • WikiLinks to other files are stripped
  • Embeds are resolved
  • By default, headings and blocks are associated with labels

Commands

Export to TeX provides two commands

Export to TeX

This command will produce a save as dialog. The contents of the current file will be converted to TeX and saved to that file.

Export to Clipboard

The contents of the current file will be converted to TeX and copied to the clipboard.

Settings

Generate labels and refs

Default: true

By default, Export to TeX will auto generate labels for headings and blocks. Links to these from within the same file will be converted to \ref calls.

Ref command

Default: '\cref'

The command to use for generating refs: defaults to \cref.

Additional math environments

Default: []

Export to TeX will by default strip the surrounding displaymath delimeters from toplevel math environments such as equation. If there are other environments you which to do this for, they can be added to this list.

Default to equation

Default: false

By default, display math environments

$$
x^2
$$

will be exported as display math

\[
x^2
\]

if there is no top level environment present.

With default to equation on this well instead be exported as

\begin{equation}
x^2
\end{equation}

Compress Newlines

Default: false

When enabled, exported TeX will have any instance of more than one blank line in a row compressed to a single blank line.

Image path format

Default: Relative to vault root

Determines how image paths are written when converting image embeddings ![[image.png]] to \includgraphics calls. Options are

  • Relative to vault root: uses to file path relative to the root of the current vault, \includegraphics{Figures/image.png}
  • Absolute path: uses the absolute path to the file on your filesystem, \includegraphics{/Users/user/Documents/Vault/Figures/image.png}
  • File base name: uses only the base name of the image file: \includegraphics{image}
  • Relative to export directory: gives the file path relative to the export TeX directory, (if copying to clipboard will be relative to default export directory).

Default export directory

*Defaults to vault root

If set the file picker will open to the chosen directory for export.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

About

export obsidian markdown files in a format that can be pasted into a TeX file

Resources

License

Stars

Watchers

Forks

Packages

No packages published