GithubHelp home page GithubHelp logo

paper-latex-export's Introduction

State of the plugin

The plugin is currently in alpha release. It works, with limited features.

Obsidian to LaTeX Math Academic Paper Exporter

This project exports an Obsidian note to a LaTeX math academic paper, retaining embeds as proofs and results. The main feature is to embed contents through Obsidian wikilinks from other local files.

This program takes a single obsidian-style markdown note and converts it to latex. If the note has a header named "Body", it will take the content below that header instead. The program will convert obsidian elements to latex elements.

Supported Elements

Most markdown elements that you can find in obsidian are supported.

Markdown headers

h1 headers become Latex sections h2 and onwards become subsections.

Mathjax Math

Obsidian-style math is recognized. Anything $inline_math$and $$ display_math$$. These are rendered by default with the \begin{equation*} environment. If an align or align* environment is within dollar signs, it will be rendered using the corresponding environment instead.

Note Embeds

Transcribes the content of note referred to by an embed link at the location of the link, in a way that matches what is seen in the reading view. The transcription is recursive; an embed in an embed will be embedded. Embeddings of sections of notes will also be embedded.

Latex Environments

Results, remarks, proofs, lemmas and corollaries can be generated by specifying breadcrumbs-like attributes in front of the link. It takes the form <environment_name>::![[FILE_NAME]] on a new line. The embedded content will be inserted inside of a "environment" latex environment, where "environment".

Labelled equation

Equations are labelled with the syntax $$...$${#eq-my_label} where the part {#eq- is required. Equations are later referenced as @eq-my_label. For align environments, the labelling takes the form

$$\begin{align}
hey &= hi \\
and &= other \\
\end{align}$${#eq-align_label}

Then the first equation can be referenced as @eq-align_label-1 and @eq-align_label-2 respectively. Trying to use @eq-align_label will not work.

Wikilinks as environment references

Standard wikilinks without a header will be converted to an \autoref{}. It will reference a latex environment which was embedded from the # Statement section in the original note. In case there is no embedded content matching it, it will create a dead reference. Wikilinks with a display will reference in the same way, but will display their display value instead with an \href.

Figures

Figures are created from embed links referencing an image file. They are recognized by their file suffix. A caption can be added by putting it in the display section of the link: ![[image.jpeg|caption text here]].

Images will be copied to a folder "Files" in the output latex folder.

Citations

Citations are wikilinks starting with the '@' character. Markdown citations are also supported. Citations can also have labels, in which case they look like [<label>][[@<bibtex_key_1>]][[@<bibtex_key_2>]] and gives an output of \cite[<label>]{<bibtex_key_1>, <bibtex_key_2>}.

This item is made to work with either markdown citations or either the "Zotero Integration" or the "Citations" plugin in Obsidian. Support is only tested for the wikilink format.

The default citation command is \textcite{}, but a link of the form [std][[@...]] will be converted to \cite{}. Specifying [text] will convert the link to a textcite.

Markdown Note Structure

I suggest to put each relevant result into its own note with a h1 header "statement" and one h1 header "Proof"; and possibly one #Remark.

To omit information at the end of files, use a line break ---, and insert the information after. Only dashed line breaks will be considered for this.

Other projects

See also the Obsidian-to-latex repository in python for an alternative implementation with a different focus.

Additional quirks

Excalidraw support

In the Excalidraw settings, enable "Embedding Excalidraw into your Notes and Exporting > Export Settings > Auto-export Settings > Auto-export PNG" Also, make sure that the exported png is in the /Files folder. The embedding wikilink can be to the excalidraw note, the plugin will convert it to a png link.

paper-latex-export's People

Contributors

mscott99 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.