
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
@adrianjost/md2tex
Advanced tools
Warning: This Code is a total mess! I am sorry for that. But it has 100% test coverage so whenever someone introduces a new hack to get it working, we can be confident that nothing unexpectedly breaks.
All features were developed for compatibility with the modernthesis template.
# yarn
yarn global add @adrianjost/md2tex
# or npm
npm i -g @adrianjost/md2tex
md2tex "pathToSrcMdFile" "pathToTargetTexFile"
pathToSrcMdFile
default to ./in.md
.pathToTargetTexFile
default to ./out.tex
.If you provide a directory path instead of a file for both paths, all .md
files will get converted to the output directory. The Filestructure will remain the same.
# yarn
yarn add -D @adrianjost/md2tex
# or npm
npm i -D @adrianjost/md2tex
import md2tex from "@adrianjost/md2tex";
// or
// const { convert: md2tex } = require("@adrianjost/md2tex")
const md = `# Hello World`;
const tex = md2tex(md);
console.log(tex);
You can use a codeblock with the language latex
to write latex code directly in your markdown files. This Code is getting directly copied into the output without any further conversion.
Input:
# H1
## H2
### H3
#### H4
##### H5
###### H6
Output:
%************************************************
\chapter{H1}
\label{ch:0-h1}
%************************************************
\hypertarget{1-h2}{
\section{H2}\label{1-h2}}
\hypertarget{2-h3}{
\subsection{H3}\label{2-h3}}
\hypertarget{3-h4}{
\subsubsection{H4}\label{3-h4}}
\hypertarget{4-h5}{
\paragraph{H5}\label{4-h5}}
\hypertarget{5-h6}{
\subparagraph{H6}\label{5-h6}}
Input:
**bold** or **bold**
_italic_ or _italic_
`inline code`
Output:
\textbf{bold} or \textbf{bold} \\
\textit{italic} or \textit{italic} \\
\colorbox{gray-light!}{\texttt{inline code}}
Links get converted to footnotes or BibLatex Source References
Input:
[descrition](footnote)
[source](`reference`)
Output:
description\\footnote{footnote}
description\\cite{reference}
Input:

Output:
\begin{figure}[H]
\centering
\includegraphics[width=\textwidth]{path}
\caption[description]{description}
\label{fig:description}
\end{figure}
🌟 Please note the special syntax for captions.
Input:
```js [some caption]
console.log("Hi");
```[description]
Output:
\begin{listing}[H]
\begin{minted}{js}
console.log("Hi");
\end{minted}
\caption{some caption}
\label{lst:code-snipped-undefined}
\end{listing}
Input:
- list item 1
- indentation 1
- list item 2
1. first
2. second
Output:
\begin{itemize}
\item list item 1
\begin{itemize}
\item indentation 1
\end{itemize}
\item list item 2
\end{itemize}
\begin{enumerate}
\item first
\item second
\end{enumerate}
# _italic_ headline
You wan't to contribute? Feel free to do so!
If you have found a bug, just add a snapshot test to the tests located at __tests__/md2tex.test.js
and open a pull request.
FAQs
bachelor thesis basic Markdown to Latex converter
The npm package @adrianjost/md2tex receives a total of 2 weekly downloads. As such, @adrianjost/md2tex popularity was classified as not popular.
We found that @adrianjost/md2tex demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.