Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 745409d4 authored by Lucas Verney's avatar Lucas Verney
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
Makefile 0 → 100644
SOURCES = $(wildcard *.md)
OUT = $(SOURCES:.md=.pdf)
all: $(OUT)
$(OUT): $(SOURCES)
pandoc --smart -t latex $< --filter=filters/pandoc-svg.py --filter=pandoc-crossref -o $@
clean:
rm -f $(OUT)
find . -name "*.pandoc.pdf" -delete
#! /usr/bin/env python
"""
Pandoc filter to convert svg files to pdf as suggested at:
https://github.com/jgm/pandoc/issues/265#issuecomment-27317316
"""
__author__ = "Jerome Robert"
import mimetypes
import subprocess
import os
import sys
from pandocfilters import toJSONFilter, Image
# TODO add emf export if fmt=="docx" ?
fmt_to_option = {
"latex": ("--export-pdf", "pdf"),
"beamer": ("--export-pdf", "pdf"),
# because of IE
"html": ("--export-png", "png")
}
def svg_to_any(key, value, fmt, meta):
if key == 'Image':
alt, [src, title] = value[1], value[-1]
mimet, _ = mimetypes.guess_type(src)
option = fmt_to_option.get(fmt)
if mimet == 'image/svg+xml' and option:
base_name, _ = os.path.splitext(src)
eps_name = base_name + "." + "pandoc." + option[1]
try:
mtime = os.path.getmtime(eps_name)
except OSError:
mtime = -1
if mtime < os.path.getmtime(src):
cmd_line = ['inkscape', option[0], eps_name, src]
sys.stderr.write("Running %s\n" % " ".join(cmd_line))
subprocess.call(cmd_line, stdout=sys.stderr.fileno())
return Image(['', [], []], alt, [eps_name, title])
if __name__ == "__main__":
toJSONFilter(svg_to_any)
notes.md 0 → 100644
---
# Metadata
title: Useful formulas
author: Lucas Verney
date: \today
# LaTeX headers
header-includes:
- \usepackage{amsthm}
- \usepackage{dsfont}
- \usepackage{mathtools}
- \renewcommand{\arraystretch}{1.5}
# Pandoc-crossref options
cref: True
chapters: True
---
\begin{itemize}
\item $a f(a^{\dagger} a) = f(a^{\dagger} a + 1) a$.
\item For operators $a$ and $b$ such that $[a, b] = C$ and $[a, [a, b]] = [b, [a, b]] = 0$.
$$ (a+b)^n=\sum_{\substack{k = 0 \\ n\equiv k\pmod{2}}} \left(-\frac{C}{2}\right)^{\frac{n-k}{2}}\frac{n!}{k!(\frac{n-k}{2})!} \left(\sum_{r=0}^k \binom{k}{r}a^rb^{k-r}\right)$$
\item ${a^{\dagger}}^k a^k = \prod_{i = 0}^{k-1} (a^{\dagger}a - i)$.
\end{itemize}
notes.pdf 0 → 100644
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment