raineszm / obsidian-export-to-tex Goto Github PK
View Code? Open in Web Editor NEWexport obsidian markdown files in a format that can be pasted into a TeX file
License: MIT License
export obsidian markdown files in a format that can be pasted into a TeX file
License: MIT License
Now, the following
# 1
## 2
### 3
#### 4
##### 5
###### 6
Exports like this:
\section*{1}\label{sec:1}
\subsection*{2}\label{sec:2}
\subsubsection*{3}\label{sec:3}
\paragraph*{4}\label{sec:4}
\subparagraph*{5}\label{sec:5}
Thing is, I rarely use # 1 as section, and just use it as title. For me it would be better to choose how this headers are exported
(also, notice that ###### 6 didnt even get exported)
Hi,
I am using Obsidian v. 0.10.11 on Windows 10, and the plugin v. 0.0.3 doesn't seem to make any outputs. The clipboard is empty after running the command and no file is saved after attempting to save via Export to TeX
command.
P.S. I could get an output on a very small note without any embedded notes.
I recently was able to run Pandoc on to generate PDF right off the markdown notes in my vault.
With a bit of modification to the .md
note, one can—using pandoc-xnos filter—add figure/table/equation/section numbers (and image captions). This is hugely helpful in cross-referencing within the text, and there would be no need to add a figure environment (#19). (There was an issue I had with equation environment when aligned
environment was used in math blocks, and it screwed the rendered math in the compiled PDF.)
Moreover, footnotes are supported, too, and Pandoc takes care of citations (haven't tried yet) and makes quotes with curly quotation marks.
It would be great if the plugin had a command to export to a sanitized markdown file, wherein embedded notes were "flattened" (the way the plugin currently pastes the content of the embedded note), links sanitized, and image (relative) paths were corrected—both of which are taken care of already.
Pandoc requires an additional change to the way images are embedded:
The embedded image ![[figure.png]]
should be converted to ![Alt text](/path/to/figure.png "Caption")
or ![Caption](/path/to/figure.png)
. Adding {#fig:some-label}
after the image would allow cross-referencing possible by calling @fig:some-label
in the text.
Since Obsidian supports ^
for block referencing, (and given that it now supports %%comments that are not rendered in the View mode%%
), I suggest using the following syntaxes that are compatible with Obsidian's View mode, thus not screwing the rendered text of the original note:
I personally would love if I can embed an image as
%%My caption here%%![[figure.png]]^my-sad-label
And it is converted to the following in the exported .md
file:
![My caption here](/path/to/figure.png){#fig:my-sad-label}
One can append {#eq:my-label}
at the end of the math block in the original note, which breaks the rendered math in View mode
$$
\Gamma = \sum_{i=1}^N i^2
$${#eq:a-terrible-equation}
Alternatively, if the ^
referencing (with a line break after the closing $$
) would help, without making any problem in View mode:
$$
\Gamma = \sum_{i=1}^N i^2
$$
^a-terrible-equation
Are these feasible features?
(I truly appreciate your efforts and quick fixes, and I wish I could contribute by forking and pull requests. Though I have no knowledge of TypeScript and js, unfortunately. ❤️ )
Since compiling .tex
file makes a lot of auxiliary files, it is better to keep them in a folder. It is good to set that in plugin options and so that relative paths to images are adapted to that.
For instance, if the exports are "by default" saved in TeX exports
folder (placed in vault's root) then the relative paths to the attached images in \includegraphics
should appear as ../attachments/figures/some image.png
instead of attachments/figures/some image.png
.
Thanks :)
After substituting embeds the positions for cached headings and blocks are no longer valid since the offsets have changed.
Thanks so much for this plugin!
I have a feature request: It would be nice to be able to toggle an option that exports headings as section*
, which don't have the section numbers that section
does. I think having an option like this makes sense because the markdown files also don't display section numbers by default.
Longtabu works really clunky (and specially in overleaf).
Thats it.
There is an issue with absolute path and Windows:
Windows paths are by default (?) defined with \
backslashes, which is not recognized by \includegraphics
. Changing \
s to /
would fix it.
Thanks.
Originally posted by @psyguy in #17 (comment)
When creating $inline math$
, and exporting it to TeX, it gets turned into $$outdated display math$$
.
This makes proofs and other text with a lot of inline math look very bad, and double dollar display math is discouraged in modern LaTeX. I assume this is just a conversion/parsing issue though, so it should be an easy fix, I hope.
Thanks for the plugin! Is very useful!
Please add label if a single letter is followed by a dot.
- a.) Some text here
- b.) another one
into
\begin{itemize}
\item [a.)] Some text here
\item [b.)] another one
\end{itemize}
Addendum: please change: \begin{Quotation}
<-- Capital "Q". I receive error as it is undefined.
Export errors with
TypeError: Cannot read property 'start' of null
at eval (eval at <anonymous> (app.js:1), <anonymous>:18521:50)
at step (eval at <anonymous> (app.js:1), <anonymous>:76:23)
at Object.eval [as next] (eval at <anonymous> (app.js:1), <anonymous>:57:53)
at fulfilled (eval at <anonymous> (app.js:1), <anonymous>:47:58)
It would help if one could specify an environment for figures and, e.g., set width/height, with something like:
So, instead of getting \includegraphics{path/to/image.png}
in the output, one can produce:
\begin{figure}
\includegraphics[width=\linewidth,height=\textheight,keepaspectratio]{path/to/image.png}
\end{figure}
or
\begin{figure}
\includegraphics[width=\linewidth,height=\textheight,keepaspectratio]{path/to/image.png}
\caption{Some placeholder, to be change manually}
\label{fig:placeholder}
\end{figure}
Thank you.
Markdown
# Title
Eugene Tan
[email protected]
Actual Output:
\section{Data-Use Pitch}\label{sec:data-use-pitch}
Eugene Tan
\href{mailto:[email protected]{[email protected]}
Intended output:
\section{Data-Use Pitch}\label{sec:data-use-pitch}
Eugene Tan
\href{mailto:[email protected]}{[email protected]}
Links to headers and blocks can include #
which will be interpreted as a macro character in TeX and cause errors.
When opening my vault on mobile, a little toast displays at the bottom that says "Failed to load plugin obsidian-export-to-tex."
Admittedly, I have no idea how to get at the dev console or logs on mobile, so I don't really know how to help you in that regard. I'm on the plugin's 0.3.0
version, and on Obsidian Mobile 1.2.0 (50)
.
I don't really know if this plugin is supposed to be compatible with mobile, but from this commit, it looks like it should be? If it shouldn't, it would make sense to set isDesktopOnly
to true.
Thanks!
In Obsidian, an image can be displayed using following syntax:
![[image_name.png]] .
This can be converted to:
\begin{figure}
\centering
\includegraphics[width=0.7\linewidth]{image_name}
\caption{}
\label{fig:image_name}
\end{figure}
That's all. I think theres some problem with the plugin manisfest but I could be wrong
With version 0.3.0 some of the options listed in the README are out of date.
The current export to clipboard functionality is great! Would it be possible to add a command that only export what is selected instead?
Thanks!
Hi! I've been loving this plugin so far, and I was wondering if you would consider this feature request:
I think it would be great if there was a way to export a document or selection to a LaTeX source file or to the clipboard, but with additional header information supplied from a setting in the plugin's settings menu.
Basically, what I'm envisioning is that there is an "Export document" or "Export document to clipboard" option, and if a new header information setting from the settings is set to, for example,
\documentclass[a4paper,12pt]{article}
\usepackage[a4paper,top=3cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
then the final export using this new option would be
\documentclass[a4paper,12pt]{article}
\usepackage[a4paper,top=3cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
THE CONTENT FROM THE MARKDOWN FILE OR SELECTION
\end{document}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.