Aller au contenu

Tutoriel Complet

Prérequis

  • vLaTeX installé (Installation)
  • Podman ou Docker configuré avec l'image vlatex-env
  • Un vault Obsidian (ou un dossier avec des fichiers .md)

Étape 1 : Structurer son vault

Structure recommandée

mon-vault/
├── Writing/                    # Documents principaux
│   ├── thesis.md
│   ├── chapter1.md
│   ├── chapter2.md
│   └── BIBTEX.bib             # Bibliographie
├── assets/                     # Images et fichiers
│   ├── figure1.png
│   ├── diagram.svg
│   └── photo.jpg
├── Equations/                  # Équations stockées
│   ├── maxwell.md
│   └── schrodinger.md
├── Tables/                     # Tableaux stockés
│   └── comparison.md
└── config.json                 # Configuration vLaTeX (optionnel)

Fichier bib

Créez un fichier BIBTEX.bib :

@article{smith2020,
  title={An Important Paper},
  author={Smith, John and Doe, Jane},
  journal={Journal of Science},
  volume={42},
  pages={1--10},
  year={2020}
}

@book{wilson2019,
  title={The Complete Guide},
  author={Wilson, Robert},
  publisher={Academic Press},
  year={2019}
}

Étape 2 : Écrire un document markdown

Frontmatter YAML

Chaque document peut commencer par un frontmatter :

---
title: Ma Thèse
author: Jean Dupont
cover_image: assets/cover.png
copyright: CC BY 4.0
---

Syntaxe markdown supportée

En-têtes

# Titre principal
## Section
### Sous-section
#### Paragraphe

Mathématiques

Inline : $E = mc^2$

Display :
$$
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
$$

Citations

Comme montré par @smith2020...

Plusieurs citations : [@smith2020; @wilson2019]

Citation avec pages : [p. 42 @smith2020]

Tableaux

| Colonne 1 | Colonne 2 | Colonne 3 |
|-----------|-----------|-----------|
| Donnée A  | 1.0       | Rouge     |
| Donnée B  | 2.5       | Bleu      |

Images

![Description de l'image](assets/figure1.png)

![[figure1.png]]  <!-- Syntaxe Obsidian -->

Listes

- Liste à puces
- Deuxième élément
  - Sous-élément

1. Liste numérotée
2. Deuxième

- [ ] Tâche non complétée
- [x] Tâche complétée

Code

```python
def hello():
    print("Hello World")
#### Callouts/Admonitions

```markdown
> [!note]
> Ceci est une note.

> [!warning]
> Ceci est un avertissement.

> [!tip]
> Ceci est un conseil.

Mermaid

```mermaid
graph TD
    A[Start] --> B{Decision}
    B -->|Yes| C[Action 1]
    B -->|No| D[Action 2]
---

## Étape 3 : Embeds Obsidian

### Embed de note

```markdown
![[Chapter1]]           <!-- Intègre le contenu de Chapter1.md -->
![[Chapter1#Section]]   <!-- Intègre une section spécifique -->
![[Chapter1#^block]]    <!-- Intègre un bloc spécifique -->

Embed d'image

![[image.png]]              <!-- Image locale -->
![[assets/figure1.png]]     <!-- Image avec chemin -->
![](https://example.com/img.png)  <!-- Image URL -->

Embed de tableau

![[Table:comparison]]   <!-- Intègre un tableau stocké -->

Embed d'équation

![[Equation:maxwell]]   <!-- Intègre une équation stockée -->

Étape 4 : Convertir

CLI

# Voir le LaTeX généré
vlatex Writing/thesis.md

# Sauvegarder en .tex
vlatex Writing/thesis.md > output/thesis.tex

# Compiler en PDF
vlatex Writing/thesis.md --pdf

# Compiler en DOCX
vlatex Writing/thesis.md --docx

GUI

vlatex --gui
  1. Cliquez Set Vault Root → sélectionnez mon-vault/
  2. Naviguez vers Writing/thesis.md
  3. Le fichier s'ouvre dans l'éditeur
  4. Cliquez Convert pour voir le LaTeX
  5. Cliquez PDF pour compiler

TUI

vlatex --tui
  1. Naviguez avec ↑/↓
  2. Appuyez Enter sur un dossier pour l'ouvrir
  3. Appuyez Enter sur un fichier .md pour le prévisualiser
  4. Appuyez c pour convertir
  5. Appuyez p pour compiler PDF

Étape 5 : Résultats

Sortie PDF

Le PDF est généré dans output/ avec :

  • Page de titre (si frontmatter défini)
  • Table des matières
  • Liste des tableaux
  • Liste des figures
  • Numérotation des sections
  • Citations avec navigation bidirectionnelle (flèches ↑↓)
  • Bibliographie complète

Sortie DOCX

Le DOCX est généré dans output/ avec :

  • Mise en forme pandoc
  • Numérotation des sections (optionnel)
  • Citations avec flèches de retour
  • Table des matières

Étape 6 : Configuration avancée

Preamble personnalisé

Créez un fichier custom-preamble.tex :

\usepackage{my-custom-package}
\usepackage{custom-fonts}

% Configuration personnalisée
\setmainfont{Linux Libertine O}
\setsansfont{Linux Biolinum O}

Dans la config :

{
  "preamble_path": "Writing/custom-preamble.tex"
}

Style de citation CSL

Pour utiliser un style CSL personnalisé :

  1. Téléchargez le fichier CSL depuis citationstyles.org
  2. Placez-le dans votre vault
  3. Configurez :
{
  "csl_path": "Writing/my-style.csl"
}

Headers/Footers PDF

{
  "enable_header": true,
  "header_content": "Mon Document — \\thepage",
  "enable_footer": true,
  "footer_content": "Confidentiel — \\today"
}

Astuces

Watcher les changements

Utilisez entr ou inotifywait pour reconvertir automatiquement :

# Linux
while true; do
  inotifywait -e modify Writing/*.md
  vlatex Writing/thesis.md --pdf
done

# macOS
fswatch -o Writing/*.md | xargs -n1 vlatex Writing/thesis.md --pdf

Makefile

Créez un Makefile pour automatiser :

.PHONY: pdf docx clean

pdf:
    vlatex Writing/thesis.md --pdf

docx:
    vlatex Writing/thesis.md --docx

clean:
    rm -rf output/

Git

Ajoutez à .gitignore :

output/
*.aux
*.log
*.bbl
*.blg
*.synctex.gz