Embed Expansion¶
MergDown2TeX recursively expands ![[Note]] into your LaTeX document.
How it works¶
graph TD
A[Main Note] --> B[![[Note A]]]
A --> C[![[Note B]]]
B --> D[![[Sub Note 1]]]
B --> E[![[Sub Note 2]]]
C --> F[![[Sub Note 3]]]
Syntax¶
Basic embed¶
Input:
Output:
Embed with heading¶
Input:
Output:
Embed with block¶
Input:
Output:
Resolution¶
MergDown2TeX resolves embeds in two steps:
graph TD
A[![[Note]]] --> B{Same folder?}
B -->|Yes| C[Use file]
B -->|No| D{Vault root?}
D -->|Yes| C
D -->|No| E[Error]
Step 1: Same folder¶
Check the same folder as the current note:
Step 2: Vault root¶
If not found, check the vault root:
Depth limit¶
MergDown2TeX limits recursion depth to prevent infinite loops:
graph TD
A[Depth 0: Main Note] --> B[Depth 1: ![[Note A]]]
B --> C[Depth 2: ![[Sub Note 1]]]
C --> D[Depth 3: ![[Sub Sub Note]]]
D --> E[Depth 4: ...]
E --> F[Max Depth: 10]
Default: 10 levels
Configuration:
Circular reference detection¶
MergDown2TeX detects and prevents circular references:
graph TD
A[Main Note] --> B[![[Note A]]]
B --> C[![[Note B]]]
C --> A[![[Main Note]]]
style A fill:#f96,stroke:#333
Result: Circular reference is skipped with a warning.
Examples¶
Example 1: Simple embed¶
Note A.md:
---
title: "Methods"
---
# Methods
We used the following approach:
1. Data collection
2. Analysis
3. Results
Main.md:
Output:
\documentclass[12pt]{report}
\title{Paper}
\begin{document}
\section{Paper}
\input{methods}
\end{document}
Example 2: Nested embeds¶
Sub Note.md:
Note A.md:
Main.md:
Result: All notes are recursively expanded.
Image embeds¶
Markdown syntax¶
Input:
Output:
Image resolution¶
graph TD
A[![[image.png]]] --> B{Same folder?}
B -->|Yes| C[Use image]
B -->|No| D{Vault root?}
D -->|Yes| C
D -->|No| E[Download if URL]
Troubleshooting¶
Embed not found¶
Error:
Solution: - Check file exists in same folder or vault root - Verify filename (case-sensitive) - Check for typos
Circular reference¶
Error:
Solution: - Restructure notes to avoid circular references - Use heading/block references instead
Depth limit exceeded¶
Error:
Solution:
- Reduce nesting depth
- Increase limit: embedDepthLimit: 15
Next steps¶
- Citations - Citation features
- Cross-References - Navigation arrows
- Configuration - Customize settings