thibaud frere
commited on
Commit
Β·
d431d95
1
Parent(s):
685d69c
Add improved latex-to-markdown converter with modular MDX processing
Browse files- β¨ Add modular LaTeX to Markdown converter pipeline
- π§ Add bib-cleaner for bibliography processing
- π¨ Add post-processor with KaTeX compatibility fixes
- π± Add improved MDX converter with Astro component support
- π¦ Auto-import detection for ResponsiveImage components
- π Move old converter to old-latex-converter folder
- πΌοΈ Process images to Astro-compatible format
- π― Support styled spans with CSS classes
- π Clean MDX syntax for better compatibility
- π§Ή Remove PDF files to comply with Git LFS requirements
This view is limited to 50 files because it contains too many changes. Β
See raw diff
- app/.astro/astro/content.d.ts +9 -0
- app/scripts/latex-to-markdown/README.md +158 -0
- app/scripts/latex-to-markdown/bib-cleaner.mjs +104 -0
- app/scripts/latex-to-markdown/index.mjs +127 -0
- app/scripts/latex-to-markdown/input/.gitignore +13 -0
- app/scripts/latex-to-markdown/input/README.md +64 -0
- app/scripts/latex-to-markdown/input/_minted/62B8750C0ACEBDA39A95140434E540A8.highlight.minted +52 -0
- app/scripts/latex-to-markdown/input/_minted/_FAD58DE7366495DB4650CFEFAC2FCD61.index.minted +10 -0
- app/scripts/latex-to-markdown/input/_minted/colorful.style.minted +100 -0
- app/scripts/latex-to-markdown/input/fancyhdr.sty +485 -0
- app/{src/content/assets/image β scripts/latex-to-markdown/input/figures}/ch1/ch1-lerobot-figure1.png +0 -0
- app/scripts/latex-to-markdown/input/figures/ch2/ch2-approaches.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch2/ch2-classical-limitations.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch2/ch2-cost-accessibility.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch2/ch2-planar-manipulator-floor-box.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch2/ch2-planar-manipulator-floor-shelf.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch2/ch2-planar-manipulator-floor.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch2/ch2-planar-manipulator-free.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch2/ch2-platforms.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch2/ch2-so100-to-planar-manipulator.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch3/ch3-agent-env.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch3/ch3-duck-sim-vs-real.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch3/ch3-hil-serl-examples.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch3/ch3-learning-atlas.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch3/ch3-learning-benefits.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch3/ch3-many-ducks.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch3/ch3-rl-algorithms-atlas.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch3/ch3-rl-examples.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch4/ch4-act-decoder.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch4/ch4-act-encoder.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch4/ch4-act.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch4/ch4-action-vs-observation-distribution.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch4/ch4-async-inference.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch4/ch4-bc-trajectories.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch4/ch4-diffusion-policy.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch4/ch4-diffusion-robot-actions.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch4/ch4-diffusion-vs-flowmatching.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch4/ch4-issues-with-bc.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch4/ch4-latent-variable-model.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch4/ch4-many-latents.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch4/ch4-normalizing-flows.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch4/ch4-observation-action-mapping.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch4/ch4-queues.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch4/ch4-task-effect-on-pairs.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch5/ch5-generalist-policies-timeline.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch5/ch5-ml-vs-robotics-foundation.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch5/ch5-pi0-sampling-timesteps.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch5/ch5-pi0.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch5/ch5-smolvla.png +3 -0
- app/scripts/latex-to-markdown/input/figures/ch5/ch5-trends.png +3 -0
app/.astro/astro/content.d.ts
CHANGED
|
@@ -208,6 +208,15 @@ declare module 'astro:content' {
|
|
| 208 |
collection: "chapters";
|
| 209 |
data: any
|
| 210 |
} & { render(): Render[".mdx"] };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 211 |
};
|
| 212 |
|
| 213 |
};
|
|
|
|
| 208 |
collection: "chapters";
|
| 209 |
data: any
|
| 210 |
} & { render(): Render[".mdx"] };
|
| 211 |
+
};
|
| 212 |
+
"test": {
|
| 213 |
+
"converted-sample.mdx": {
|
| 214 |
+
id: "converted-sample.mdx";
|
| 215 |
+
slug: "converted-sample";
|
| 216 |
+
body: string;
|
| 217 |
+
collection: "test";
|
| 218 |
+
data: any
|
| 219 |
+
} & { render(): Render[".mdx"] };
|
| 220 |
};
|
| 221 |
|
| 222 |
};
|
app/scripts/latex-to-markdown/README.md
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LaTeX to Markdown Toolkit
|
| 2 |
+
|
| 3 |
+
Conversion modulaire de projets LaTeX vers Markdown avec Pandoc.
|
| 4 |
+
|
| 5 |
+
## π Usage rapide
|
| 6 |
+
|
| 7 |
+
```bash
|
| 8 |
+
# Conversion complète (LaTeX + bibliographie)
|
| 9 |
+
node index.mjs --clean
|
| 10 |
+
|
| 11 |
+
# Seulement nettoyer la bibliographie
|
| 12 |
+
node index.mjs --bib-only
|
| 13 |
+
|
| 14 |
+
# Seulement convertir LaTeX (utilise une .bib existante)
|
| 15 |
+
node index.mjs --convert-only
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
## π Structure
|
| 19 |
+
|
| 20 |
+
```
|
| 21 |
+
latex-to-markdown/
|
| 22 |
+
βββ index.mjs # Script principal
|
| 23 |
+
βββ latex-converter.mjs # Convertisseur LaTeX β Markdown
|
| 24 |
+
βββ bib-cleaner.mjs # Nettoyeur de bibliographie
|
| 25 |
+
βββ input/ # Dossier source LaTeX
|
| 26 |
+
β βββ main.tex
|
| 27 |
+
β βββ main.bib
|
| 28 |
+
β βββ sections/
|
| 29 |
+
βββ output/ # RΓ©sultats de conversion
|
| 30 |
+
βββ main.md
|
| 31 |
+
βββ main.bib
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
## π§ Modules
|
| 35 |
+
|
| 36 |
+
### `index.mjs` - Script principal
|
| 37 |
+
Point d'entrée unifié avec options complètes.
|
| 38 |
+
|
| 39 |
+
**Options :**
|
| 40 |
+
- `--input=PATH` : Fichier LaTeX source
|
| 41 |
+
- `--output=PATH` : Dossier de sortie
|
| 42 |
+
- `--clean` : Nettoyer le dossier de sortie
|
| 43 |
+
- `--bib-only` : Seulement nettoyer la bibliographie
|
| 44 |
+
- `--convert-only` : Seulement convertir (skip bibliographie)
|
| 45 |
+
|
| 46 |
+
### `latex-converter.mjs` - Convertisseur
|
| 47 |
+
Conversion LaTeX vers Markdown avec Pandoc.
|
| 48 |
+
|
| 49 |
+
**FonctionnalitΓ©s :**
|
| 50 |
+
- Support natif des macros LaTeX (`+latex_macros`)
|
| 51 |
+
- Gestion automatique des `\input{}`
|
| 52 |
+
- Citations avec `--citeproc`
|
| 53 |
+
- Extraction des images avec `--extract-media`
|
| 54 |
+
- Support mathΓ©matique avec `--mathjax`
|
| 55 |
+
|
| 56 |
+
### `bib-cleaner.mjs` - Nettoyeur de bibliographie
|
| 57 |
+
Supprime les rΓ©fΓ©rences externes des fichiers `.bib`.
|
| 58 |
+
|
| 59 |
+
**Nettoyage :**
|
| 60 |
+
- Supprime les `file = {...}` (chemins locaux)
|
| 61 |
+
- Nettoie les virgules doubles
|
| 62 |
+
- Γlimine les lignes vides
|
| 63 |
+
|
| 64 |
+
## π Exemple de workflow
|
| 65 |
+
|
| 66 |
+
```bash
|
| 67 |
+
# 1. Placer vos fichiers LaTeX dans input/
|
| 68 |
+
cp mon-projet/* input/
|
| 69 |
+
|
| 70 |
+
# 2. Conversion complète
|
| 71 |
+
node index.mjs --clean
|
| 72 |
+
|
| 73 |
+
# 3. RΓ©cupΓ©rer les rΓ©sultats dans output/
|
| 74 |
+
ls output/
|
| 75 |
+
# β main.md (Markdown converti)
|
| 76 |
+
# β main.bib (Bibliographie nettoyΓ©e)
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
## βοΈ Configuration avancΓ©e
|
| 80 |
+
|
| 81 |
+
### Chemins personnalisΓ©s
|
| 82 |
+
```bash
|
| 83 |
+
node index.mjs \
|
| 84 |
+
--input=../paper/main.tex \
|
| 85 |
+
--output=../results/ \
|
| 86 |
+
--clean
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
### Usage programmatique
|
| 90 |
+
```javascript
|
| 91 |
+
import { convertLatexToMarkdown, cleanBibliography } from './index.mjs';
|
| 92 |
+
|
| 93 |
+
// Conversion LaTeX
|
| 94 |
+
await convertLatexToMarkdown('input.tex', 'output/');
|
| 95 |
+
|
| 96 |
+
// Nettoyage bibliographie
|
| 97 |
+
await cleanBibliography('refs.bib', 'clean-refs.bib');
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
## π οΈ PrΓ©requis
|
| 101 |
+
|
| 102 |
+
- **Node.js** avec support ESM
|
| 103 |
+
- **Pandoc** (`brew install pandoc`)
|
| 104 |
+
|
| 105 |
+
## π― Pandoc natif
|
| 106 |
+
|
| 107 |
+
Le toolkit maximise l'utilisation de Pandoc natif :
|
| 108 |
+
|
| 109 |
+
- **`+latex_macros`** : Gère `\newcommand`, `\renewcommand`
|
| 110 |
+
- **`--citeproc`** : Traitement automatique des citations
|
| 111 |
+
- **`--bibliography`** : Support de `.bib` files
|
| 112 |
+
- **`--extract-media`** : Images automatiques
|
| 113 |
+
- **`--mathjax`** : MathΓ©matiques avancΓ©es
|
| 114 |
+
|
| 115 |
+
RΓ©sultat : **95% Pandoc natif, 5% preprocessing minimal** ! π
|
| 116 |
+
|
| 117 |
+
---
|
| 118 |
+
|
| 119 |
+
## π Γtat Actuel du Projet
|
| 120 |
+
|
| 121 |
+
### β
ComplΓ©tΓ©
|
| 122 |
+
- **Architecture modulaire** : `index.mjs` + `latex-converter.mjs` + `bib-cleaner.mjs`
|
| 123 |
+
- **Preprocessing LaTeX** : Gestion des `\input{}` pour assembler le document complet
|
| 124 |
+
- **Nettoyage bibliographie** : Suppression des rΓ©fΓ©rences externes (`file = {...}`)
|
| 125 |
+
- **Conversion Pandoc** : Format `gfm+tex_math_dollars` pour compatibilitΓ© Astro
|
| 126 |
+
- **Citations sans crochets** : Format `@citationkey` au lieu de `[@citationkey]`
|
| 127 |
+
- **Gestion des commandes personnalisΓ©es** : `\actionchunk`, `\textsc`, `\gets`, etc.
|
| 128 |
+
- **Extraction d'images** : Support automatique via `--extract-media`
|
| 129 |
+
|
| 130 |
+
### π§ En Cours de RΓ©solution
|
| 131 |
+
- **Erreurs Pandoc sur certaines sections** :
|
| 132 |
+
- Section `03_reinforcement_learning.tex` contient des constructions LaTeX problΓ©matiques
|
| 133 |
+
- Erreur Γ la ligne 2011 : `unexpected }` dans le contexte de citations complexes
|
| 134 |
+
- Commande `\textsc{PopFront(\( \actionchunk_t \))}` mal interprΓ©tΓ©e
|
| 135 |
+
|
| 136 |
+
### π― Prochaines Γtapes
|
| 137 |
+
1. **DΓ©boguer section 03** : Identifier et corriger les constructions LaTeX incompatibles
|
| 138 |
+
2. **Test sections individuelles** : Valider chaque section sΓ©parΓ©ment
|
| 139 |
+
3. **AmΓ©liorer preprocessing** : Ajouter plus de transformations pour gΓ©rer les cas complexes
|
| 140 |
+
4. **Validation finale** : Conversion complète du document
|
| 141 |
+
|
| 142 |
+
### π¨ ProblΓ¨mes IdentifiΓ©s
|
| 143 |
+
- **Commandes imbriquées** : `\textsc{...(\( math \))}` pose problème à Pandoc
|
| 144 |
+
- **Citations complexes** : Certains patterns de citations avec math inline
|
| 145 |
+
- **Math environments** : Quelques environnements non reconnus correctement
|
| 146 |
+
|
| 147 |
+
### π Diagnostic
|
| 148 |
+
Dernière erreur :
|
| 149 |
+
```
|
| 150 |
+
Error at "temp_main.tex" (line 2011, column 234):
|
| 151 |
+
unexpected }
|
| 152 |
+
expecting \end{document}
|
| 153 |
+
~@zhaoLearningFineGrainedBimanual2023 adopts a different strategy whereby...
|
| 154 |
+
\( \actionchunk_t \gets \pi(o_t) \) and chunk consumption
|
| 155 |
+
\( a_t \gets \textsc{PopFront(\( \actionchunk_t \))} \)
|
| 156 |
+
```
|
| 157 |
+
|
| 158 |
+
Le problΓ¨me semble Γͺtre dans l'imbrication de `\textsc{}` avec des expressions mathΓ©matiques Γ l'intΓ©rieur.
|
app/scripts/latex-to-markdown/bib-cleaner.mjs
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env node
|
| 2 |
+
|
| 3 |
+
import { readFileSync, writeFileSync, existsSync } from 'fs';
|
| 4 |
+
import { join, dirname, basename } from 'path';
|
| 5 |
+
|
| 6 |
+
/**
|
| 7 |
+
* Clean a BibTeX file by removing local file references and paths
|
| 8 |
+
* @param {string} inputBibFile - Path to the input .bib file
|
| 9 |
+
* @param {string} outputBibFile - Path to the output cleaned .bib file
|
| 10 |
+
* @returns {boolean} - Success status
|
| 11 |
+
*/
|
| 12 |
+
export function cleanBibliography(inputBibFile, outputBibFile) {
|
| 13 |
+
if (!existsSync(inputBibFile)) {
|
| 14 |
+
console.log(' β οΈ No bibliography file found:', inputBibFile);
|
| 15 |
+
return false;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
console.log('π Cleaning bibliography...');
|
| 19 |
+
let bibContent = readFileSync(inputBibFile, 'utf8');
|
| 20 |
+
|
| 21 |
+
// Remove file paths and local references
|
| 22 |
+
bibContent = bibContent.replace(/file = \{[^}]+\}/g, '');
|
| 23 |
+
|
| 24 |
+
// Remove empty lines created by file removal
|
| 25 |
+
bibContent = bibContent.replace(/,\s*\n\s*\n/g, '\n\n');
|
| 26 |
+
bibContent = bibContent.replace(/,\s*\}/g, '\n}');
|
| 27 |
+
|
| 28 |
+
// Clean up double commas
|
| 29 |
+
bibContent = bibContent.replace(/,,/g, ',');
|
| 30 |
+
|
| 31 |
+
// Remove trailing commas before closing braces
|
| 32 |
+
bibContent = bibContent.replace(/,(\s*\n\s*)\}/g, '$1}');
|
| 33 |
+
|
| 34 |
+
writeFileSync(outputBibFile, bibContent);
|
| 35 |
+
console.log(` π Clean bibliography saved: ${outputBibFile}`);
|
| 36 |
+
|
| 37 |
+
return true;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
/**
|
| 41 |
+
* CLI for bibliography cleaning
|
| 42 |
+
*/
|
| 43 |
+
function main() {
|
| 44 |
+
const args = process.argv.slice(2);
|
| 45 |
+
|
| 46 |
+
if (args.includes('--help') || args.includes('-h')) {
|
| 47 |
+
console.log(`
|
| 48 |
+
π BibTeX Bibliography Cleaner
|
| 49 |
+
|
| 50 |
+
Usage:
|
| 51 |
+
node bib-cleaner.mjs [input.bib] [output.bib]
|
| 52 |
+
node bib-cleaner.mjs --input=input.bib --output=output.bib
|
| 53 |
+
|
| 54 |
+
Options:
|
| 55 |
+
--input=FILE Input .bib file
|
| 56 |
+
--output=FILE Output cleaned .bib file
|
| 57 |
+
--help, -h Show this help
|
| 58 |
+
|
| 59 |
+
Examples:
|
| 60 |
+
# Clean main.bib to clean.bib
|
| 61 |
+
node bib-cleaner.mjs main.bib clean.bib
|
| 62 |
+
|
| 63 |
+
# Using flags
|
| 64 |
+
node bib-cleaner.mjs --input=references.bib --output=clean-refs.bib
|
| 65 |
+
`);
|
| 66 |
+
process.exit(0);
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
let inputFile, outputFile;
|
| 70 |
+
|
| 71 |
+
// Parse command line arguments
|
| 72 |
+
if (args.length >= 2 && !args[0].startsWith('--')) {
|
| 73 |
+
// Positional arguments
|
| 74 |
+
inputFile = args[0];
|
| 75 |
+
outputFile = args[1];
|
| 76 |
+
} else {
|
| 77 |
+
// Named arguments
|
| 78 |
+
for (const arg of args) {
|
| 79 |
+
if (arg.startsWith('--input=')) {
|
| 80 |
+
inputFile = arg.split('=')[1];
|
| 81 |
+
} else if (arg.startsWith('--output=')) {
|
| 82 |
+
outputFile = arg.split('=')[1];
|
| 83 |
+
}
|
| 84 |
+
}
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
if (!inputFile || !outputFile) {
|
| 88 |
+
console.error('β Both input and output files are required');
|
| 89 |
+
console.log('Use --help for usage information');
|
| 90 |
+
process.exit(1);
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
const success = cleanBibliography(inputFile, outputFile);
|
| 94 |
+
if (success) {
|
| 95 |
+
console.log('π Bibliography cleaning completed!');
|
| 96 |
+
} else {
|
| 97 |
+
process.exit(1);
|
| 98 |
+
}
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
// Run CLI if called directly
|
| 102 |
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
| 103 |
+
main();
|
| 104 |
+
}
|
app/scripts/latex-to-markdown/index.mjs
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env node
|
| 2 |
+
|
| 3 |
+
import { join, dirname } from 'path';
|
| 4 |
+
import { fileURLToPath } from 'url';
|
| 5 |
+
import { convertLatexToMarkdown } from './latex-converter.mjs';
|
| 6 |
+
import { convertToMdx } from './mdx-converter.mjs';
|
| 7 |
+
import { cleanBibliography } from './bib-cleaner.mjs';
|
| 8 |
+
|
| 9 |
+
const __filename = fileURLToPath(import.meta.url);
|
| 10 |
+
const __dirname = dirname(__filename);
|
| 11 |
+
|
| 12 |
+
// Default configuration
|
| 13 |
+
const DEFAULT_INPUT = join(__dirname, 'input', 'main.tex');
|
| 14 |
+
const DEFAULT_OUTPUT = join(__dirname, 'output');
|
| 15 |
+
|
| 16 |
+
function parseArgs() {
|
| 17 |
+
const args = process.argv.slice(2);
|
| 18 |
+
const config = {
|
| 19 |
+
input: DEFAULT_INPUT,
|
| 20 |
+
output: DEFAULT_OUTPUT,
|
| 21 |
+
clean: false,
|
| 22 |
+
bibOnly: false,
|
| 23 |
+
convertOnly: false,
|
| 24 |
+
mdx: false,
|
| 25 |
+
};
|
| 26 |
+
|
| 27 |
+
for (const arg of args) {
|
| 28 |
+
if (arg.startsWith('--input=')) {
|
| 29 |
+
config.input = arg.split('=')[1];
|
| 30 |
+
} else if (arg.startsWith('--output=')) {
|
| 31 |
+
config.output = arg.split('=')[1];
|
| 32 |
+
} else if (arg === '--clean') {
|
| 33 |
+
config.clean = true;
|
| 34 |
+
} else if (arg === '--bib-only') {
|
| 35 |
+
config.bibOnly = true;
|
| 36 |
+
} else if (arg === '--convert-only') {
|
| 37 |
+
config.convertOnly = true;
|
| 38 |
+
}
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
return config;
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
function showHelp() {
|
| 45 |
+
console.log(`
|
| 46 |
+
π LaTeX to Markdown Toolkit
|
| 47 |
+
|
| 48 |
+
Usage:
|
| 49 |
+
node index.mjs [options]
|
| 50 |
+
|
| 51 |
+
Options:
|
| 52 |
+
--input=PATH Input LaTeX file (default: input/main.tex)
|
| 53 |
+
--output=PATH Output directory (default: output/)
|
| 54 |
+
--clean Clean output directory before processing
|
| 55 |
+
--bib-only Only clean bibliography file
|
| 56 |
+
--convert-only Only convert LaTeX to Markdown (skip bib cleaning)
|
| 57 |
+
--help, -h Show this help
|
| 58 |
+
|
| 59 |
+
Examples:
|
| 60 |
+
# Full conversion with bibliography cleaning
|
| 61 |
+
node index.mjs --clean
|
| 62 |
+
|
| 63 |
+
# Only clean bibliography
|
| 64 |
+
node index.mjs --bib-only --input=paper.tex --output=clean/
|
| 65 |
+
|
| 66 |
+
# Only convert LaTeX (use existing clean bibliography)
|
| 67 |
+
node index.mjs --convert-only
|
| 68 |
+
|
| 69 |
+
# Custom paths
|
| 70 |
+
node index.mjs --input=../paper/main.tex --output=../results/ --clean
|
| 71 |
+
`);
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
function main() {
|
| 75 |
+
const args = process.argv.slice(2);
|
| 76 |
+
|
| 77 |
+
if (args.includes('--help') || args.includes('-h')) {
|
| 78 |
+
showHelp();
|
| 79 |
+
process.exit(0);
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
const config = parseArgs();
|
| 83 |
+
|
| 84 |
+
console.log('π LaTeX to Markdown Toolkit');
|
| 85 |
+
console.log('==============================');
|
| 86 |
+
|
| 87 |
+
try {
|
| 88 |
+
if (config.bibOnly) {
|
| 89 |
+
// Only clean bibliography
|
| 90 |
+
console.log('π Bibliography cleaning mode');
|
| 91 |
+
const bibInput = config.input.replace('.tex', '.bib');
|
| 92 |
+
const bibOutput = join(config.output, 'main.bib');
|
| 93 |
+
|
| 94 |
+
cleanBibliography(bibInput, bibOutput);
|
| 95 |
+
console.log('π Bibliography cleaning completed!');
|
| 96 |
+
|
| 97 |
+
} else if (config.convertOnly) {
|
| 98 |
+
// Only convert LaTeX
|
| 99 |
+
console.log('π Conversion only mode');
|
| 100 |
+
convertLatexToMarkdown(config.input, config.output);
|
| 101 |
+
|
| 102 |
+
} else {
|
| 103 |
+
// Full workflow
|
| 104 |
+
console.log('π Full conversion workflow');
|
| 105 |
+
convertLatexToMarkdown(config.input, config.output);
|
| 106 |
+
|
| 107 |
+
// Convert to MDX if requested
|
| 108 |
+
const markdownFile = join(config.output, 'main.md');
|
| 109 |
+
const mdxFile = join(config.output, 'main.mdx');
|
| 110 |
+
|
| 111 |
+
console.log('π Converting Markdown to MDX...');
|
| 112 |
+
convertToMdx(markdownFile, mdxFile);
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
} catch (error) {
|
| 116 |
+
console.error('β Error:', error.message);
|
| 117 |
+
process.exit(1);
|
| 118 |
+
}
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
// Export functions for use as module
|
| 122 |
+
export { convertLatexToMarkdown, cleanBibliography };
|
| 123 |
+
|
| 124 |
+
// Run CLI if called directly
|
| 125 |
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
| 126 |
+
main();
|
| 127 |
+
}
|
app/scripts/latex-to-markdown/input/.gitignore
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.DS_store
|
| 2 |
+
|
| 3 |
+
*.aux
|
| 4 |
+
*.nav
|
| 5 |
+
*.log
|
| 6 |
+
*.snm
|
| 7 |
+
*.toc
|
| 8 |
+
*.out
|
| 9 |
+
*.vrb
|
| 10 |
+
*.blg
|
| 11 |
+
*latexmk*
|
| 12 |
+
*fls
|
| 13 |
+
*synctex*
|
app/scripts/latex-to-markdown/input/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Robot Learning: A Tutorial
|
| 2 |
+
|
| 3 |
+
Google "robot learning tutorial", and you will spend just as much time skimming through sources as actually learning about robot learning.
|
| 4 |
+
This tutorial solves this: a unified entry point to the field of robot learning, presenting the conceptual underpinnings of popular approaches in the field, as well as presenting practical examples of how to use SOTA algorithms in `lerobot`, an open-source library for full-stack robotics.
|
| 5 |
+
|
| 6 |
+
# TODO
|
| 7 |
+
|
| 8 |
+
```markdown
|
| 9 |
+
## 1. Introduction
|
| 10 |
+
- [x] 1.1 Motivation
|
| 11 |
+
- [x] 1.2 Structure of the Report
|
| 12 |
+
|
| 13 |
+
## 2. Classical Robotics
|
| 14 |
+
- [x] 2.1 Different kinds of motion
|
| 15 |
+
- [x] 2.2 Example: (Planar) Manipulation
|
| 16 |
+
- [x] 2.3.1 Adding Feedback Loops
|
| 17 |
+
- [x] 2.4 Limitations of Dynamics-based Robotics
|
| 18 |
+
|
| 19 |
+
## 3. Robot Learning
|
| 20 |
+
- [ ] 3.1 Reinforcement Learning (RL) for Robotics
|
| 21 |
+
- [ ] 3.1.1 A (Concise) Introduction to RL
|
| 22 |
+
- [ ] 3.2 Model-Free RL for Real-world Robotics
|
| 23 |
+
- [ ] 3.2.1 RL in lerobot: sample efficient, data-driven, and real-world
|
| 24 |
+
- [ ] 3.2.2 Code Example: HIL-SERL in lerobot
|
| 25 |
+
- [ ] 3.3 Limitations of RL in Real-World Robotics: Simulators and Reward Design
|
| 26 |
+
- [ ] 3.4 Behavioral Cloning (BC) for Robotics
|
| 27 |
+
- [ ] 4.1.1 Leveraging Real-World Demonstrations
|
| 28 |
+
- [ ] 4.1.2 Reward-Free Training and Betting on Data
|
| 29 |
+
|
| 30 |
+
## 4. Single-Task Policy Architectures
|
| 31 |
+
- [ ] 4.2 Action Chunking with Transformers (ACT)
|
| 32 |
+
- [ ] 4.2.1 Model Architecture and Training Objectives
|
| 33 |
+
- [ ] 4.2.2 Code Example: Use ACT in lerobot
|
| 34 |
+
- [ ] 4.3 Diffusion-Based Policy Models
|
| 35 |
+
- [ ] 4.3.1 Generative Modeling for Action Sequences
|
| 36 |
+
- [ ] 4.3.2 Code Example: Use Diffusion Policy in lerobot
|
| 37 |
+
|
| 38 |
+
## 5. Multi-task Policies: Vision-Language-Action (VLA) Models in Robotics
|
| 39 |
+
- [ ] 5.1 Multi-task Policies: Vision-Language-Action (VLA) Models in Robotics
|
| 40 |
+
- [ ] 5.1.1 Overview of Major Architectures: Pi0, SmolVLA
|
| 41 |
+
- [ ] 5.1.2 Practical Implementation: Using VLA in lerobot
|
| 42 |
+
|
| 43 |
+
## 6. Some Emerging Directions in Robot Learning
|
| 44 |
+
- [ ] 6.1 VLAs Post-Training
|
| 45 |
+
- [ ] 6.1.1 From Imitation to Refinement
|
| 46 |
+
- [ ] 6.1.2 EXPO
|
| 47 |
+
|
| 48 |
+
## 7. Conclusions
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
If time permits (vs current TOC):
|
| 52 |
+
|
| 53 |
+
- [ ] 3.3 Model-based RL for Robotics
|
| 54 |
+
- [ ] 3.3.1 TD-MPC
|
| 55 |
+
- [ ] 3.3.2 Code Example: Use TD-MPC in lerobot
|
| 56 |
+
- [ ] 3.5 Popular benchmarks in Robot Learning
|
| 57 |
+
|
| 58 |
+
- 4.3 Vector-Quantized Behavior Transformer (VQ-BeT)
|
| 59 |
+
- [ ] 4.3.1 Model Architecture and Training Objectives
|
| 60 |
+
- [ ] 4.3.2 Code Example: Use VQ-BeT in lerobot
|
| 61 |
+
|
| 62 |
+
- [ ] 6.1 Using World Models for Robotics
|
| 63 |
+
- [ ] 6.1.1 In the architecture: V-JEPA and V-JEPA2
|
| 64 |
+
- [ ] 6.1.2 In the simulation: GENIE
|
app/scripts/latex-to-markdown/input/_minted/62B8750C0ACEBDA39A95140434E540A8.highlight.minted
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
\begin{MintedVerbatim}[commandchars=\\\{\}]
|
| 2 |
+
\PYG{k+kn}{import}\PYG{+w}{ }\PYG{n+nn}{torch}
|
| 3 |
+
\PYG{k+kn}{from}\PYG{+w}{ }\PYG{n+nn}{lerobot}\PYG{n+nn}{.}\PYG{n+nn}{datasets}\PYG{n+nn}{.}\PYG{n+nn}{lerobot\PYGZus{}dataset}\PYG{+w}{ }\PYG{k+kn}{import} \PYG{n}{LeRobotDataset}
|
| 4 |
+
\PYG{k+kn}{from}\PYG{+w}{ }\PYG{n+nn}{lerobot}\PYG{n+nn}{.}\PYG{n+nn}{datasets}\PYG{n+nn}{.}\PYG{n+nn}{streaming\PYGZus{}dataset}\PYG{+w}{ }\PYG{k+kn}{import} \PYG{n}{StreamingLeRobotDataset}
|
| 5 |
+
|
| 6 |
+
\PYG{n}{delta\PYGZus{}timestamps} \PYG{o}{=} \PYG{p}{\PYGZob{}}
|
| 7 |
+
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{observation.images.wrist\PYGZus{}camera}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.2}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mf}{0.1}\PYG{p}{,} \PYG{l+m+mf}{0.0}\PYG{p}{]} \PYG{c+c1}{\PYGZsh{} 0.2, and 0.1 seconds *before* each frame}
|
| 8 |
+
\PYG{p}{\PYGZcb{}}
|
| 9 |
+
|
| 10 |
+
\PYG{c+c1}{\PYGZsh{} Optionally, use StreamingLeRobotDataset to avoid downloading the dataset}
|
| 11 |
+
\PYG{n}{dataset} \PYG{o}{=} \PYG{n}{LeRobotDataset}\PYG{p}{(}
|
| 12 |
+
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{lerobot/svla\PYGZus{}so101\PYGZus{}pickplace}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
|
| 13 |
+
\PYG{n}{delta\PYGZus{}timestamps}\PYG{o}{=}\PYG{n}{delta\PYGZus{}timestamps}
|
| 14 |
+
\PYG{p}{)}
|
| 15 |
+
|
| 16 |
+
\PYG{c+c1}{\PYGZsh{} Streams frames from the Hugging Face Hub without loading into memory}
|
| 17 |
+
\PYG{n}{streaming\PYGZus{}dataset} \PYG{o}{=} \PYG{n}{StreamingLeRobotDataset}\PYG{p}{(}
|
| 18 |
+
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{lerobot/svla\PYGZus{}so101\PYGZus{}pickplace}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
|
| 19 |
+
\PYG{n}{delta\PYGZus{}timestamps}\PYG{o}{=}\PYG{n}{delta\PYGZus{}timestamps}
|
| 20 |
+
\PYG{p}{)}
|
| 21 |
+
|
| 22 |
+
\PYG{c+c1}{\PYGZsh{} Get the 100th frame in the dataset by }
|
| 23 |
+
\PYG{n}{sample} \PYG{o}{=} \PYG{n}{dataset}\PYG{p}{[}\PYG{l+m+mi}{100}\PYG{p}{]}
|
| 24 |
+
\PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{sample}\PYG{p}{)}
|
| 25 |
+
\PYG{c+c1}{\PYGZsh{} \PYGZob{}}
|
| 26 |
+
\PYG{c+c1}{\PYGZsh{} \PYGZsq{}observation.state\PYGZsq{}: tensor([...]), }
|
| 27 |
+
\PYG{c+c1}{\PYGZsh{} \PYGZsq{}action\PYGZsq{}: tensor([...]), }
|
| 28 |
+
\PYG{c+c1}{\PYGZsh{} \PYGZsq{}observation.images.wrist\PYGZus{}camera\PYGZsq{}: tensor([3, C, H, W]), for delta timesteps}
|
| 29 |
+
\PYG{c+c1}{\PYGZsh{} ...}
|
| 30 |
+
\PYG{c+c1}{\PYGZsh{} \PYGZcb{}}
|
| 31 |
+
|
| 32 |
+
\PYG{n}{batch\PYGZus{}size}\PYG{o}{=}\PYG{l+m+mi}{16}
|
| 33 |
+
\PYG{c+c1}{\PYGZsh{} wrap the dataset in a DataLoader to use process it batches for training purposes}
|
| 34 |
+
\PYG{n}{data\PYGZus{}loader} \PYG{o}{=} \PYG{n}{torch}\PYG{o}{.}\PYG{n}{utils}\PYG{o}{.}\PYG{n}{data}\PYG{o}{.}\PYG{n}{DataLoader}\PYG{p}{(}
|
| 35 |
+
\PYG{n}{dataset}\PYG{p}{,}
|
| 36 |
+
\PYG{n}{batch\PYGZus{}size}\PYG{o}{=}\PYG{n}{batch\PYGZus{}size}
|
| 37 |
+
\PYG{p}{)}
|
| 38 |
+
|
| 39 |
+
\PYG{c+c1}{\PYGZsh{} Iterate over the DataLoader in a training loop}
|
| 40 |
+
\PYG{n}{num\PYGZus{}epochs} \PYG{o}{=} \PYG{l+m+mi}{1}
|
| 41 |
+
\PYG{n}{device} \PYG{o}{=} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{cuda}\PYG{l+s+s2}{\PYGZdq{}} \PYG{k}{if} \PYG{n}{torch}\PYG{o}{.}\PYG{n}{cuda}\PYG{o}{.}\PYG{n}{is\PYGZus{}available}\PYG{p}{(}\PYG{p}{)} \PYG{k}{else} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{cpu}\PYG{l+s+s2}{\PYGZdq{}}
|
| 42 |
+
|
| 43 |
+
\PYG{k}{for} \PYG{n}{epoch} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{n}{num\PYGZus{}epochs}\PYG{p}{)}\PYG{p}{:}
|
| 44 |
+
\PYG{k}{for} \PYG{n}{batch} \PYG{o+ow}{in} \PYG{n}{data\PYGZus{}loader}\PYG{p}{:}
|
| 45 |
+
\PYG{c+c1}{\PYGZsh{} Move data to the appropriate device (e.g., GPU)}
|
| 46 |
+
\PYG{n}{observations} \PYG{o}{=} \PYG{n}{batch}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{observation.state}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{to}\PYG{p}{(}\PYG{n}{device}\PYG{p}{)}
|
| 47 |
+
\PYG{n}{actions} \PYG{o}{=} \PYG{n}{batch}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{action}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{to}\PYG{p}{(}\PYG{n}{device}\PYG{p}{)}
|
| 48 |
+
\PYG{n}{images} \PYG{o}{=} \PYG{n}{batch}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{observation.images.wrist\PYGZus{}camera}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{to}\PYG{p}{(}\PYG{n}{device}\PYG{p}{)}
|
| 49 |
+
|
| 50 |
+
\PYG{c+c1}{\PYGZsh{} Next, you can do amazing\PYGZus{}model.forward(batch)}
|
| 51 |
+
\PYG{o}{.}\PYG{o}{.}\PYG{o}{.}
|
| 52 |
+
\end{MintedVerbatim}
|
app/scripts/latex-to-markdown/input/_minted/_FAD58DE7366495DB4650CFEFAC2FCD61.index.minted
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"jobname": "main",
|
| 3 |
+
"md5": "FAD58DE7366495DB4650CFEFAC2FCD61",
|
| 4 |
+
"timestamp": "20250911180655",
|
| 5 |
+
"cachefiles": [
|
| 6 |
+
"62B8750C0ACEBDA39A95140434E540A8.highlight.minted",
|
| 7 |
+
"_FAD58DE7366495DB4650CFEFAC2FCD61.index.minted",
|
| 8 |
+
"colorful.style.minted"
|
| 9 |
+
]
|
| 10 |
+
}
|
app/scripts/latex-to-markdown/input/_minted/colorful.style.minted
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
\makeatletter
|
| 2 |
+
\def\PYG@reset{\let\PYG@it=\relax \let\PYG@bf=\relax%
|
| 3 |
+
\let\PYG@ul=\relax \let\PYG@tc=\relax%
|
| 4 |
+
\let\PYG@bc=\relax \let\PYG@ff=\relax}
|
| 5 |
+
\def\PYG@tok#1{\csname PYG@tok@#1\endcsname}
|
| 6 |
+
\def\PYG@toks#1+{\ifx\relax#1\empty\else%
|
| 7 |
+
\PYG@tok{#1}\expandafter\PYG@toks\fi}
|
| 8 |
+
\def\PYG@do#1{\PYG@bc{\PYG@tc{\PYG@ul{%
|
| 9 |
+
\PYG@it{\PYG@bf{\PYG@ff{#1}}}}}}}
|
| 10 |
+
\def\PYG#1#2{\PYG@reset\PYG@toks#1+\relax+\PYG@do{#2}}
|
| 11 |
+
|
| 12 |
+
\@namedef{PYG@tok@w}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}}
|
| 13 |
+
\@namedef{PYG@tok@c}{\def\PYG@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
|
| 14 |
+
\@namedef{PYG@tok@cp}{\def\PYG@tc##1{\textcolor[rgb]{0.33,0.47,0.60}{##1}}}
|
| 15 |
+
\@namedef{PYG@tok@cs}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.80,0.00,0.00}{##1}}}
|
| 16 |
+
\@namedef{PYG@tok@k}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}}
|
| 17 |
+
\@namedef{PYG@tok@kp}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.20,0.53}{##1}}}
|
| 18 |
+
\@namedef{PYG@tok@kt}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.20,0.20,0.60}{##1}}}
|
| 19 |
+
\@namedef{PYG@tok@o}{\def\PYG@tc##1{\textcolor[rgb]{0.20,0.20,0.20}{##1}}}
|
| 20 |
+
\@namedef{PYG@tok@ow}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.00}{##1}}}
|
| 21 |
+
\@namedef{PYG@tok@nb}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
|
| 22 |
+
\@namedef{PYG@tok@nf}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.40,0.73}{##1}}}
|
| 23 |
+
\@namedef{PYG@tok@nc}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.73,0.00,0.40}{##1}}}
|
| 24 |
+
\@namedef{PYG@tok@nn}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.05,0.52,0.71}{##1}}}
|
| 25 |
+
\@namedef{PYG@tok@ne}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{1.00,0.00,0.00}{##1}}}
|
| 26 |
+
\@namedef{PYG@tok@nv}{\def\PYG@tc##1{\textcolor[rgb]{0.60,0.40,0.20}{##1}}}
|
| 27 |
+
\@namedef{PYG@tok@vi}{\def\PYG@tc##1{\textcolor[rgb]{0.20,0.20,0.73}{##1}}}
|
| 28 |
+
\@namedef{PYG@tok@vc}{\def\PYG@tc##1{\textcolor[rgb]{0.20,0.40,0.60}{##1}}}
|
| 29 |
+
\@namedef{PYG@tok@vg}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.87,0.47,0.00}{##1}}}
|
| 30 |
+
\@namedef{PYG@tok@no}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.20,0.40}{##1}}}
|
| 31 |
+
\@namedef{PYG@tok@nl}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.60,0.47,0.00}{##1}}}
|
| 32 |
+
\@namedef{PYG@tok@ni}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.53,0.00,0.00}{##1}}}
|
| 33 |
+
\@namedef{PYG@tok@na}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.80}{##1}}}
|
| 34 |
+
\@namedef{PYG@tok@nt}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.47,0.00}{##1}}}
|
| 35 |
+
\@namedef{PYG@tok@nd}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.33,0.33,0.33}{##1}}}
|
| 36 |
+
\@namedef{PYG@tok@s}{\def\PYG@bc##1{{\setlength{\fboxsep}{0pt}\colorbox[rgb]{1.00,0.94,0.94}{\strut ##1}}}}
|
| 37 |
+
\@namedef{PYG@tok@sc}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}}
|
| 38 |
+
\@namedef{PYG@tok@sd}{\def\PYG@tc##1{\textcolor[rgb]{0.87,0.27,0.13}{##1}}}
|
| 39 |
+
\@namedef{PYG@tok@si}{\def\PYG@bc##1{{\setlength{\fboxsep}{0pt}\colorbox[rgb]{0.93,0.93,0.93}{\strut ##1}}}}
|
| 40 |
+
\@namedef{PYG@tok@se}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}\def\PYG@bc##1{{\setlength{\fboxsep}{0pt}\colorbox[rgb]{1.00,0.94,0.94}{\strut ##1}}}}
|
| 41 |
+
\@namedef{PYG@tok@sr}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.00}{##1}}\def\PYG@bc##1{{\setlength{\fboxsep}{0pt}\colorbox[rgb]{1.00,0.94,1.00}{\strut ##1}}}}
|
| 42 |
+
\@namedef{PYG@tok@ss}{\def\PYG@tc##1{\textcolor[rgb]{0.67,0.40,0.00}{##1}}}
|
| 43 |
+
\@namedef{PYG@tok@sx}{\def\PYG@tc##1{\textcolor[rgb]{0.87,0.13,0.00}{##1}}\def\PYG@bc##1{{\setlength{\fboxsep}{0pt}\colorbox[rgb]{1.00,0.94,0.94}{\strut ##1}}}}
|
| 44 |
+
\@namedef{PYG@tok@m}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.40,0.00,0.93}{##1}}}
|
| 45 |
+
\@namedef{PYG@tok@mi}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.87}{##1}}}
|
| 46 |
+
\@namedef{PYG@tok@mf}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.40,0.00,0.93}{##1}}}
|
| 47 |
+
\@namedef{PYG@tok@mh}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.33,0.53}{##1}}}
|
| 48 |
+
\@namedef{PYG@tok@mo}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.27,0.00,0.93}{##1}}}
|
| 49 |
+
\@namedef{PYG@tok@gh}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
|
| 50 |
+
\@namedef{PYG@tok@gu}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}}
|
| 51 |
+
\@namedef{PYG@tok@gd}{\def\PYG@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}}
|
| 52 |
+
\@namedef{PYG@tok@gi}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.63,0.00}{##1}}}
|
| 53 |
+
\@namedef{PYG@tok@gr}{\def\PYG@tc##1{\textcolor[rgb]{1.00,0.00,0.00}{##1}}}
|
| 54 |
+
\@namedef{PYG@tok@ge}{\let\PYG@it=\textit}
|
| 55 |
+
\@namedef{PYG@tok@gs}{\let\PYG@bf=\textbf}
|
| 56 |
+
\@namedef{PYG@tok@ges}{\let\PYG@bf=\textbf\let\PYG@it=\textit}
|
| 57 |
+
\@namedef{PYG@tok@gp}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.78,0.36,0.04}{##1}}}
|
| 58 |
+
\@namedef{PYG@tok@go}{\def\PYG@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
|
| 59 |
+
\@namedef{PYG@tok@gt}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}}
|
| 60 |
+
\@namedef{PYG@tok@err}{\def\PYG@tc##1{\textcolor[rgb]{1.00,0.00,0.00}{##1}}\def\PYG@bc##1{{\setlength{\fboxsep}{0pt}\colorbox[rgb]{1.00,0.67,0.67}{\strut ##1}}}}
|
| 61 |
+
\@namedef{PYG@tok@kc}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}}
|
| 62 |
+
\@namedef{PYG@tok@kd}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}}
|
| 63 |
+
\@namedef{PYG@tok@kn}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}}
|
| 64 |
+
\@namedef{PYG@tok@kr}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.53,0.00}{##1}}}
|
| 65 |
+
\@namedef{PYG@tok@bp}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
|
| 66 |
+
\@namedef{PYG@tok@fm}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.40,0.73}{##1}}}
|
| 67 |
+
\@namedef{PYG@tok@vm}{\def\PYG@tc##1{\textcolor[rgb]{0.60,0.40,0.20}{##1}}}
|
| 68 |
+
\@namedef{PYG@tok@sa}{\def\PYG@bc##1{{\setlength{\fboxsep}{0pt}\colorbox[rgb]{1.00,0.94,0.94}{\strut ##1}}}}
|
| 69 |
+
\@namedef{PYG@tok@sb}{\def\PYG@bc##1{{\setlength{\fboxsep}{0pt}\colorbox[rgb]{1.00,0.94,0.94}{\strut ##1}}}}
|
| 70 |
+
\@namedef{PYG@tok@dl}{\def\PYG@bc##1{{\setlength{\fboxsep}{0pt}\colorbox[rgb]{1.00,0.94,0.94}{\strut ##1}}}}
|
| 71 |
+
\@namedef{PYG@tok@s2}{\def\PYG@bc##1{{\setlength{\fboxsep}{0pt}\colorbox[rgb]{1.00,0.94,0.94}{\strut ##1}}}}
|
| 72 |
+
\@namedef{PYG@tok@sh}{\def\PYG@bc##1{{\setlength{\fboxsep}{0pt}\colorbox[rgb]{1.00,0.94,0.94}{\strut ##1}}}}
|
| 73 |
+
\@namedef{PYG@tok@s1}{\def\PYG@bc##1{{\setlength{\fboxsep}{0pt}\colorbox[rgb]{1.00,0.94,0.94}{\strut ##1}}}}
|
| 74 |
+
\@namedef{PYG@tok@mb}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.40,0.00,0.93}{##1}}}
|
| 75 |
+
\@namedef{PYG@tok@il}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.87}{##1}}}
|
| 76 |
+
\@namedef{PYG@tok@ch}{\def\PYG@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
|
| 77 |
+
\@namedef{PYG@tok@cm}{\def\PYG@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
|
| 78 |
+
\@namedef{PYG@tok@cpf}{\def\PYG@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
|
| 79 |
+
\@namedef{PYG@tok@c1}{\def\PYG@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
|
| 80 |
+
|
| 81 |
+
\def\PYGZbs{\char`\\}
|
| 82 |
+
\def\PYGZus{\char`\_}
|
| 83 |
+
\def\PYGZob{\char`\{}
|
| 84 |
+
\def\PYGZcb{\char`\}}
|
| 85 |
+
\def\PYGZca{\char`\^}
|
| 86 |
+
\def\PYGZam{\char`\&}
|
| 87 |
+
\def\PYGZlt{\char`\<}
|
| 88 |
+
\def\PYGZgt{\char`\>}
|
| 89 |
+
\def\PYGZsh{\char`\#}
|
| 90 |
+
\def\PYGZpc{\char`\%}
|
| 91 |
+
\def\PYGZdl{\char`\$}
|
| 92 |
+
\def\PYGZhy{\char`\-}
|
| 93 |
+
\def\PYGZsq{\char`\'}
|
| 94 |
+
\def\PYGZdq{\char`\"}
|
| 95 |
+
\def\PYGZti{\char`\~}
|
| 96 |
+
% for compatibility with earlier versions
|
| 97 |
+
\def\PYGZat{@}
|
| 98 |
+
\def\PYGZlb{[}
|
| 99 |
+
\def\PYGZrb{]}
|
| 100 |
+
\makeatother
|
app/scripts/latex-to-markdown/input/fancyhdr.sty
ADDED
|
@@ -0,0 +1,485 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
% fancyhdr.sty version 3.2
|
| 2 |
+
% Fancy headers and footers for LaTeX.
|
| 3 |
+
% Piet van Oostrum,
|
| 4 |
+
% Dept of Computer and Information Sciences, University of Utrecht,
|
| 5 |
+
% Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands
|
| 6 |
+
% Telephone: +31 30 2532180. Email: piet@cs.uu.nl
|
| 7 |
+
% ========================================================================
|
| 8 |
+
% LICENCE:
|
| 9 |
+
% This file may be distributed under the terms of the LaTeX Project Public
|
| 10 |
+
% License, as described in lppl.txt in the base LaTeX distribution.
|
| 11 |
+
% Either version 1 or, at your option, any later version.
|
| 12 |
+
% ========================================================================
|
| 13 |
+
% MODIFICATION HISTORY:
|
| 14 |
+
% Sep 16, 1994
|
| 15 |
+
% version 1.4: Correction for use with \reversemargin
|
| 16 |
+
% Sep 29, 1994:
|
| 17 |
+
% version 1.5: Added the \iftopfloat, \ifbotfloat and \iffloatpage commands
|
| 18 |
+
% Oct 4, 1994:
|
| 19 |
+
% version 1.6: Reset single spacing in headers/footers for use with
|
| 20 |
+
% setspace.sty or doublespace.sty
|
| 21 |
+
% Oct 4, 1994:
|
| 22 |
+
% version 1.7: changed \let\@mkboth\markboth to
|
| 23 |
+
% \def\@mkboth{\protect\markboth} to make it more robust
|
| 24 |
+
% Dec 5, 1994:
|
| 25 |
+
% version 1.8: corrections for amsbook/amsart: define \@chapapp and (more
|
| 26 |
+
% importantly) use the \chapter/sectionmark definitions from ps@headings if
|
| 27 |
+
% they exist (which should be true for all standard classes).
|
| 28 |
+
% May 31, 1995:
|
| 29 |
+
% version 1.9: The proposed \renewcommand{\headrulewidth}{\iffloatpage...
|
| 30 |
+
% construction in the doc did not work properly with the fancyplain style.
|
| 31 |
+
% June 1, 1995:
|
| 32 |
+
% version 1.91: The definition of \@mkboth wasn't restored on subsequent
|
| 33 |
+
% \pagestyle{fancy}'s.
|
| 34 |
+
% June 1, 1995:
|
| 35 |
+
% version 1.92: The sequence \pagestyle{fancyplain} \pagestyle{plain}
|
| 36 |
+
% \pagestyle{fancy} would erroneously select the plain version.
|
| 37 |
+
% June 1, 1995:
|
| 38 |
+
% version 1.93: \fancypagestyle command added.
|
| 39 |
+
% Dec 11, 1995:
|
| 40 |
+
% version 1.94: suggested by Conrad Hughes <chughes@maths.tcd.ie>
|
| 41 |
+
% CJCH, Dec 11, 1995: added \footruleskip to allow control over footrule
|
| 42 |
+
% position (old hardcoded value of .3\normalbaselineskip is far too high
|
| 43 |
+
% when used with very small footer fonts).
|
| 44 |
+
% Jan 31, 1996:
|
| 45 |
+
% version 1.95: call \@normalsize in the reset code if that is defined,
|
| 46 |
+
% otherwise \normalsize.
|
| 47 |
+
% this is to solve a problem with ucthesis.cls, as this doesn't
|
| 48 |
+
% define \@currsize. Unfortunately for latex209 calling \normalsize doesn't
|
| 49 |
+
% work as this is optimized to do very little, so there \@normalsize should
|
| 50 |
+
% be called. Hopefully this code works for all versions of LaTeX known to
|
| 51 |
+
% mankind.
|
| 52 |
+
% April 25, 1996:
|
| 53 |
+
% version 1.96: initialize \headwidth to a magic (negative) value to catch
|
| 54 |
+
% most common cases that people change it before calling \pagestyle{fancy}.
|
| 55 |
+
% Note it can't be initialized when reading in this file, because
|
| 56 |
+
% \textwidth could be changed afterwards. This is quite probable.
|
| 57 |
+
% We also switch to \MakeUppercase rather than \uppercase and introduce a
|
| 58 |
+
% \nouppercase command for use in headers. and footers.
|
| 59 |
+
% May 3, 1996:
|
| 60 |
+
% version 1.97: Two changes:
|
| 61 |
+
% 1. Undo the change in version 1.8 (using the pagestyle{headings} defaults
|
| 62 |
+
% for the chapter and section marks. The current version of amsbook and
|
| 63 |
+
% amsart classes don't seem to need them anymore. Moreover the standard
|
| 64 |
+
% latex classes don't use \markboth if twoside isn't selected, and this is
|
| 65 |
+
% confusing as \leftmark doesn't work as expected.
|
| 66 |
+
% 2. include a call to \ps@empty in ps@@fancy. This is to solve a problem
|
| 67 |
+
% in the amsbook and amsart classes, that make global changes to \topskip,
|
| 68 |
+
% which are reset in \ps@empty. Hopefully this doesn't break other things.
|
| 69 |
+
% May 7, 1996:
|
| 70 |
+
% version 1.98:
|
| 71 |
+
% Added % after the line \def\nouppercase
|
| 72 |
+
% May 7, 1996:
|
| 73 |
+
% version 1.99: This is the alpha version of fancyhdr 2.0
|
| 74 |
+
% Introduced the new commands \fancyhead, \fancyfoot, and \fancyhf.
|
| 75 |
+
% Changed \headrulewidth, \footrulewidth, \footruleskip to
|
| 76 |
+
% macros rather than length parameters, In this way they can be
|
| 77 |
+
% conditionalized and they don't consume length registers. There is no need
|
| 78 |
+
% to have them as length registers unless you want to do calculations with
|
| 79 |
+
% them, which is unlikely. Note that this may make some uses of them
|
| 80 |
+
% incompatible (i.e. if you have a file that uses \setlength or \xxxx=)
|
| 81 |
+
% May 10, 1996:
|
| 82 |
+
% version 1.99a:
|
| 83 |
+
% Added a few more % signs
|
| 84 |
+
% May 10, 1996:
|
| 85 |
+
% version 1.99b:
|
| 86 |
+
% Changed the syntax of \f@nfor to be resistent to catcode changes of :=
|
| 87 |
+
% Removed the [1] from the defs of \lhead etc. because the parameter is
|
| 88 |
+
% consumed by the \@[xy]lhead etc. macros.
|
| 89 |
+
% June 24, 1997:
|
| 90 |
+
% version 1.99c:
|
| 91 |
+
% corrected \nouppercase to also include the protected form of \MakeUppercase
|
| 92 |
+
% \global added to manipulation of \headwidth.
|
| 93 |
+
% \iffootnote command added.
|
| 94 |
+
% Some comments added about \@fancyhead and \@fancyfoot.
|
| 95 |
+
% Aug 24, 1998
|
| 96 |
+
% version 1.99d
|
| 97 |
+
% Changed the default \ps@empty to \ps@@empty in order to allow
|
| 98 |
+
% \fancypagestyle{empty} redefinition.
|
| 99 |
+
% Oct 11, 2000
|
| 100 |
+
% version 2.0
|
| 101 |
+
% Added LPPL license clause.
|
| 102 |
+
%
|
| 103 |
+
% A check for \headheight is added. An errormessage is given (once) if the
|
| 104 |
+
% header is too large. Empty headers don't generate the error even if
|
| 105 |
+
% \headheight is very small or even 0pt.
|
| 106 |
+
% Warning added for the use of 'E' option when twoside option is not used.
|
| 107 |
+
% In this case the 'E' fields will never be used.
|
| 108 |
+
%
|
| 109 |
+
% Mar 10, 2002
|
| 110 |
+
% version 2.1beta
|
| 111 |
+
% New command: \fancyhfoffset[place]{length}
|
| 112 |
+
% defines offsets to be applied to the header/footer to let it stick into
|
| 113 |
+
% the margins (if length > 0).
|
| 114 |
+
% place is like in fancyhead, except that only E,O,L,R can be used.
|
| 115 |
+
% This replaces the old calculation based on \headwidth and the marginpar
|
| 116 |
+
% area.
|
| 117 |
+
% \headwidth will be dynamically calculated in the headers/footers when
|
| 118 |
+
% this is used.
|
| 119 |
+
%
|
| 120 |
+
% Mar 26, 2002
|
| 121 |
+
% version 2.1beta2
|
| 122 |
+
% \fancyhfoffset now also takes h,f as possible letters in the argument to
|
| 123 |
+
% allow the header and footer widths to be different.
|
| 124 |
+
% New commands \fancyheadoffset and \fancyfootoffset added comparable to
|
| 125 |
+
% \fancyhead and \fancyfoot.
|
| 126 |
+
% Errormessages and warnings have been made more informative.
|
| 127 |
+
%
|
| 128 |
+
% Dec 9, 2002
|
| 129 |
+
% version 2.1
|
| 130 |
+
% The defaults for \footrulewidth, \plainheadrulewidth and
|
| 131 |
+
% \plainfootrulewidth are changed from \z@skip to 0pt. In this way when
|
| 132 |
+
% someone inadvertantly uses \setlength to change any of these, the value
|
| 133 |
+
% of \z@skip will not be changed, rather an errormessage will be given.
|
| 134 |
+
|
| 135 |
+
% March 3, 2004
|
| 136 |
+
% Release of version 3.0
|
| 137 |
+
|
| 138 |
+
% Oct 7, 2004
|
| 139 |
+
% version 3.1
|
| 140 |
+
% Added '\endlinechar=13' to \fancy@reset to prevent problems with
|
| 141 |
+
% includegraphics in header when verbatiminput is active.
|
| 142 |
+
|
| 143 |
+
% March 22, 2005
|
| 144 |
+
% version 3.2
|
| 145 |
+
% reset \everypar (the real one) in \fancy@reset because spanish.ldf does
|
| 146 |
+
% strange things with \everypar between << and >>.
|
| 147 |
+
|
| 148 |
+
\def\ifancy@mpty#1{\def\temp@a{#1}\ifx\temp@a\@empty}
|
| 149 |
+
|
| 150 |
+
\def\fancy@def#1#2{\ifancy@mpty{#2}\fancy@gbl\def#1{\leavevmode}\else
|
| 151 |
+
\fancy@gbl\def#1{#2\strut}\fi}
|
| 152 |
+
|
| 153 |
+
\let\fancy@gbl\global
|
| 154 |
+
|
| 155 |
+
\def\@fancyerrmsg#1{%
|
| 156 |
+
\ifx\PackageError\undefined
|
| 157 |
+
\errmessage{#1}\else
|
| 158 |
+
\PackageError{Fancyhdr}{#1}{}\fi}
|
| 159 |
+
\def\@fancywarning#1{%
|
| 160 |
+
\ifx\PackageWarning\undefined
|
| 161 |
+
\errmessage{#1}\else
|
| 162 |
+
\PackageWarning{Fancyhdr}{#1}{}\fi}
|
| 163 |
+
|
| 164 |
+
% Usage: \@forc \var{charstring}{command to be executed for each char}
|
| 165 |
+
% This is similar to LaTeX's \@tfor, but expands the charstring.
|
| 166 |
+
|
| 167 |
+
\def\@forc#1#2#3{\expandafter\f@rc\expandafter#1\expandafter{#2}{#3}}
|
| 168 |
+
\def\f@rc#1#2#3{\def\temp@ty{#2}\ifx\@empty\temp@ty\else
|
| 169 |
+
\f@@rc#1#2\f@@rc{#3}\fi}
|
| 170 |
+
\def\f@@rc#1#2#3\f@@rc#4{\def#1{#2}#4\f@rc#1{#3}{#4}}
|
| 171 |
+
|
| 172 |
+
% Usage: \f@nfor\name:=list\do{body}
|
| 173 |
+
% Like LaTeX's \@for but an empty list is treated as a list with an empty
|
| 174 |
+
% element
|
| 175 |
+
|
| 176 |
+
\newcommand{\f@nfor}[3]{\edef\@fortmp{#2}%
|
| 177 |
+
\expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}}
|
| 178 |
+
|
| 179 |
+
% Usage: \def@ult \cs{defaults}{argument}
|
| 180 |
+
% sets \cs to the characters from defaults appearing in argument
|
| 181 |
+
% or defaults if it would be empty. All characters are lowercased.
|
| 182 |
+
|
| 183 |
+
\newcommand\def@ult[3]{%
|
| 184 |
+
\edef\temp@a{\lowercase{\edef\noexpand\temp@a{#3}}}\temp@a
|
| 185 |
+
\def#1{}%
|
| 186 |
+
\@forc\tmpf@ra{#2}%
|
| 187 |
+
{\expandafter\if@in\tmpf@ra\temp@a{\edef#1{#1\tmpf@ra}}{}}%
|
| 188 |
+
\ifx\@empty#1\def#1{#2}\fi}
|
| 189 |
+
%
|
| 190 |
+
% \if@in <char><set><truecase><falsecase>
|
| 191 |
+
%
|
| 192 |
+
\newcommand{\if@in}[4]{%
|
| 193 |
+
\edef\temp@a{#2}\def\temp@b##1#1##2\temp@b{\def\temp@b{##1}}%
|
| 194 |
+
\expandafter\temp@b#2#1\temp@b\ifx\temp@a\temp@b #4\else #3\fi}
|
| 195 |
+
|
| 196 |
+
\newcommand{\fancyhead}{\@ifnextchar[{\f@ncyhf\fancyhead h}%
|
| 197 |
+
{\f@ncyhf\fancyhead h[]}}
|
| 198 |
+
\newcommand{\fancyfoot}{\@ifnextchar[{\f@ncyhf\fancyfoot f}%
|
| 199 |
+
{\f@ncyhf\fancyfoot f[]}}
|
| 200 |
+
\newcommand{\fancyhf}{\@ifnextchar[{\f@ncyhf\fancyhf{}}%
|
| 201 |
+
{\f@ncyhf\fancyhf{}[]}}
|
| 202 |
+
|
| 203 |
+
% New commands for offsets added
|
| 204 |
+
|
| 205 |
+
\newcommand{\fancyheadoffset}{\@ifnextchar[{\f@ncyhfoffs\fancyheadoffset h}%
|
| 206 |
+
{\f@ncyhfoffs\fancyheadoffset h[]}}
|
| 207 |
+
\newcommand{\fancyfootoffset}{\@ifnextchar[{\f@ncyhfoffs\fancyfootoffset f}%
|
| 208 |
+
{\f@ncyhfoffs\fancyfootoffset f[]}}
|
| 209 |
+
\newcommand{\fancyhfoffset}{\@ifnextchar[{\f@ncyhfoffs\fancyhfoffset{}}%
|
| 210 |
+
{\f@ncyhfoffs\fancyhfoffset{}[]}}
|
| 211 |
+
|
| 212 |
+
% The header and footer fields are stored in command sequences with
|
| 213 |
+
% names of the form: \f@ncy<x><y><z> with <x> for [eo], <y> from [lcr]
|
| 214 |
+
% and <z> from [hf].
|
| 215 |
+
|
| 216 |
+
\def\f@ncyhf#1#2[#3]#4{%
|
| 217 |
+
\def\temp@c{}%
|
| 218 |
+
\@forc\tmpf@ra{#3}%
|
| 219 |
+
{\expandafter\if@in\tmpf@ra{eolcrhf,EOLCRHF}%
|
| 220 |
+
{}{\edef\temp@c{\temp@c\tmpf@ra}}}%
|
| 221 |
+
\ifx\@empty\temp@c\else
|
| 222 |
+
\@fancyerrmsg{Illegal char `\temp@c' in \string#1 argument:
|
| 223 |
+
[#3]}%
|
| 224 |
+
\fi
|
| 225 |
+
\f@nfor\temp@c{#3}%
|
| 226 |
+
{\def@ult\f@@@eo{eo}\temp@c
|
| 227 |
+
\if@twoside\else
|
| 228 |
+
\if\f@@@eo e\@fancywarning
|
| 229 |
+
{\string#1's `E' option without twoside option is useless}\fi\fi
|
| 230 |
+
\def@ult\f@@@lcr{lcr}\temp@c
|
| 231 |
+
\def@ult\f@@@hf{hf}{#2\temp@c}%
|
| 232 |
+
\@forc\f@@eo\f@@@eo
|
| 233 |
+
{\@forc\f@@lcr\f@@@lcr
|
| 234 |
+
{\@forc\f@@hf\f@@@hf
|
| 235 |
+
{\expandafter\fancy@def\csname
|
| 236 |
+
f@ncy\f@@eo\f@@lcr\f@@hf\endcsname
|
| 237 |
+
{#4}}}}}}
|
| 238 |
+
|
| 239 |
+
\def\f@ncyhfoffs#1#2[#3]#4{%
|
| 240 |
+
\def\temp@c{}%
|
| 241 |
+
\@forc\tmpf@ra{#3}%
|
| 242 |
+
{\expandafter\if@in\tmpf@ra{eolrhf,EOLRHF}%
|
| 243 |
+
{}{\edef\temp@c{\temp@c\tmpf@ra}}}%
|
| 244 |
+
\ifx\@empty\temp@c\else
|
| 245 |
+
\@fancyerrmsg{Illegal char `\temp@c' in \string#1 argument:
|
| 246 |
+
[#3]}%
|
| 247 |
+
\fi
|
| 248 |
+
\f@nfor\temp@c{#3}%
|
| 249 |
+
{\def@ult\f@@@eo{eo}\temp@c
|
| 250 |
+
\if@twoside\else
|
| 251 |
+
\if\f@@@eo e\@fancywarning
|
| 252 |
+
{\string#1's `E' option without twoside option is useless}\fi\fi
|
| 253 |
+
\def@ult\f@@@lcr{lr}\temp@c
|
| 254 |
+
\def@ult\f@@@hf{hf}{#2\temp@c}%
|
| 255 |
+
\@forc\f@@eo\f@@@eo
|
| 256 |
+
{\@forc\f@@lcr\f@@@lcr
|
| 257 |
+
{\@forc\f@@hf\f@@@hf
|
| 258 |
+
{\expandafter\setlength\csname
|
| 259 |
+
f@ncyO@\f@@eo\f@@lcr\f@@hf\endcsname
|
| 260 |
+
{#4}}}}}%
|
| 261 |
+
\fancy@setoffs}
|
| 262 |
+
|
| 263 |
+
% Fancyheadings version 1 commands. These are more or less deprecated,
|
| 264 |
+
% but they continue to work.
|
| 265 |
+
|
| 266 |
+
\newcommand{\lhead}{\@ifnextchar[{\@xlhead}{\@ylhead}}
|
| 267 |
+
\def\@xlhead[#1]#2{\fancy@def\f@ncyelh{#1}\fancy@def\f@ncyolh{#2}}
|
| 268 |
+
\def\@ylhead#1{\fancy@def\f@ncyelh{#1}\fancy@def\f@ncyolh{#1}}
|
| 269 |
+
|
| 270 |
+
\newcommand{\chead}{\@ifnextchar[{\@xchead}{\@ychead}}
|
| 271 |
+
\def\@xchead[#1]#2{\fancy@def\f@ncyech{#1}\fancy@def\f@ncyoch{#2}}
|
| 272 |
+
\def\@ychead#1{\fancy@def\f@ncyech{#1}\fancy@def\f@ncyoch{#1}}
|
| 273 |
+
|
| 274 |
+
\newcommand{\rhead}{\@ifnextchar[{\@xrhead}{\@yrhead}}
|
| 275 |
+
\def\@xrhead[#1]#2{\fancy@def\f@ncyerh{#1}\fancy@def\f@ncyorh{#2}}
|
| 276 |
+
\def\@yrhead#1{\fancy@def\f@ncyerh{#1}\fancy@def\f@ncyorh{#1}}
|
| 277 |
+
|
| 278 |
+
\newcommand{\lfoot}{\@ifnextchar[{\@xlfoot}{\@ylfoot}}
|
| 279 |
+
\def\@xlfoot[#1]#2{\fancy@def\f@ncyelf{#1}\fancy@def\f@ncyolf{#2}}
|
| 280 |
+
\def\@ylfoot#1{\fancy@def\f@ncyelf{#1}\fancy@def\f@ncyolf{#1}}
|
| 281 |
+
|
| 282 |
+
\newcommand{\cfoot}{\@ifnextchar[{\@xcfoot}{\@ycfoot}}
|
| 283 |
+
\def\@xcfoot[#1]#2{\fancy@def\f@ncyecf{#1}\fancy@def\f@ncyocf{#2}}
|
| 284 |
+
\def\@ycfoot#1{\fancy@def\f@ncyecf{#1}\fancy@def\f@ncyocf{#1}}
|
| 285 |
+
|
| 286 |
+
\newcommand{\rfoot}{\@ifnextchar[{\@xrfoot}{\@yrfoot}}
|
| 287 |
+
\def\@xrfoot[#1]#2{\fancy@def\f@ncyerf{#1}\fancy@def\f@ncyorf{#2}}
|
| 288 |
+
\def\@yrfoot#1{\fancy@def\f@ncyerf{#1}\fancy@def\f@ncyorf{#1}}
|
| 289 |
+
|
| 290 |
+
\newlength{\fancy@headwidth}
|
| 291 |
+
\let\headwidth\fancy@headwidth
|
| 292 |
+
\newlength{\f@ncyO@elh}
|
| 293 |
+
\newlength{\f@ncyO@erh}
|
| 294 |
+
\newlength{\f@ncyO@olh}
|
| 295 |
+
\newlength{\f@ncyO@orh}
|
| 296 |
+
\newlength{\f@ncyO@elf}
|
| 297 |
+
\newlength{\f@ncyO@erf}
|
| 298 |
+
\newlength{\f@ncyO@olf}
|
| 299 |
+
\newlength{\f@ncyO@orf}
|
| 300 |
+
\newcommand{\headrulewidth}{0.4pt}
|
| 301 |
+
\newcommand{\footrulewidth}{0pt}
|
| 302 |
+
\newcommand{\footruleskip}{.3\normalbaselineskip}
|
| 303 |
+
|
| 304 |
+
% Fancyplain stuff shouldn't be used anymore (rather
|
| 305 |
+
% \fancypagestyle{plain} should be used), but it must be present for
|
| 306 |
+
% compatibility reasons.
|
| 307 |
+
|
| 308 |
+
\newcommand{\plainheadrulewidth}{0pt}
|
| 309 |
+
\newcommand{\plainfootrulewidth}{0pt}
|
| 310 |
+
\newif\if@fancyplain \@fancyplainfalse
|
| 311 |
+
\def\fancyplain#1#2{\if@fancyplain#1\else#2\fi}
|
| 312 |
+
|
| 313 |
+
\headwidth=-123456789sp %magic constant
|
| 314 |
+
|
| 315 |
+
% Command to reset various things in the headers:
|
| 316 |
+
% a.o. single spacing (taken from setspace.sty)
|
| 317 |
+
% and the catcode of ^^M (so that epsf files in the header work if a
|
| 318 |
+
% verbatim crosses a page boundary)
|
| 319 |
+
% It also defines a \nouppercase command that disables \uppercase and
|
| 320 |
+
% \Makeuppercase. It can only be used in the headers and footers.
|
| 321 |
+
\let\fnch@everypar\everypar% save real \everypar because of spanish.ldf
|
| 322 |
+
\def\fancy@reset{\fnch@everypar{}\restorecr\endlinechar=13
|
| 323 |
+
\def\baselinestretch{1}%
|
| 324 |
+
\def\nouppercase##1{{\let\uppercase\relax\let\MakeUppercase\relax
|
| 325 |
+
\expandafter\let\csname MakeUppercase \endcsname\relax##1}}%
|
| 326 |
+
\ifx\undefined\@newbaseline% NFSS not present; 2.09 or 2e
|
| 327 |
+
\ifx\@normalsize\undefined \normalsize % for ucthesis.cls
|
| 328 |
+
\else \@normalsize \fi
|
| 329 |
+
\else% NFSS (2.09) present
|
| 330 |
+
\@newbaseline%
|
| 331 |
+
\fi}
|
| 332 |
+
|
| 333 |
+
% Initialization of the head and foot text.
|
| 334 |
+
|
| 335 |
+
% The default values still contain \fancyplain for compatibility.
|
| 336 |
+
\fancyhf{} % clear all
|
| 337 |
+
% lefthead empty on ``plain'' pages, \rightmark on even, \leftmark on odd pages
|
| 338 |
+
% evenhead empty on ``plain'' pages, \leftmark on even, \rightmark on odd pages
|
| 339 |
+
\if@twoside
|
| 340 |
+
\fancyhead[el,or]{\fancyplain{}{\sl\rightmark}}
|
| 341 |
+
\fancyhead[er,ol]{\fancyplain{}{\sl\leftmark}}
|
| 342 |
+
\else
|
| 343 |
+
\fancyhead[l]{\fancyplain{}{\sl\rightmark}}
|
| 344 |
+
\fancyhead[r]{\fancyplain{}{\sl\leftmark}}
|
| 345 |
+
\fi
|
| 346 |
+
\fancyfoot[c]{\rm\thepage} % page number
|
| 347 |
+
|
| 348 |
+
% Use box 0 as a temp box and dimen 0 as temp dimen.
|
| 349 |
+
% This can be done, because this code will always
|
| 350 |
+
% be used inside another box, and therefore the changes are local.
|
| 351 |
+
|
| 352 |
+
\def\@fancyvbox#1#2{\setbox0\vbox{#2}\ifdim\ht0>#1\@fancywarning
|
| 353 |
+
{\string#1 is too small (\the#1): ^^J Make it at least \the\ht0.^^J
|
| 354 |
+
We now make it that large for the rest of the document.^^J
|
| 355 |
+
This may cause the page layout to be inconsistent, however\@gobble}%
|
| 356 |
+
\dimen0=#1\global\setlength{#1}{\ht0}\ht0=\dimen0\fi
|
| 357 |
+
\box0}
|
| 358 |
+
|
| 359 |
+
% Put together a header or footer given the left, center and
|
| 360 |
+
% right text, fillers at left and right and a rule.
|
| 361 |
+
% The \lap commands put the text into an hbox of zero size,
|
| 362 |
+
% so overlapping text does not generate an errormessage.
|
| 363 |
+
% These macros have 5 parameters:
|
| 364 |
+
% 1. LEFTSIDE BEARING % This determines at which side the header will stick
|
| 365 |
+
% out. When \fancyhfoffset is used this calculates \headwidth, otherwise
|
| 366 |
+
% it is \hss or \relax (after expansion).
|
| 367 |
+
% 2. \f@ncyolh, \f@ncyelh, \f@ncyolf or \f@ncyelf. This is the left component.
|
| 368 |
+
% 3. \f@ncyoch, \f@ncyech, \f@ncyocf or \f@ncyecf. This is the middle comp.
|
| 369 |
+
% 4. \f@ncyorh, \f@ncyerh, \f@ncyorf or \f@ncyerf. This is the right component.
|
| 370 |
+
% 5. RIGHTSIDE BEARING. This is always \relax or \hss (after expansion).
|
| 371 |
+
|
| 372 |
+
\def\@fancyhead#1#2#3#4#5{#1\hbox to\headwidth{\fancy@reset
|
| 373 |
+
\@fancyvbox\headheight{\hbox
|
| 374 |
+
{\rlap{\parbox[b]{\headwidth}{\raggedright#2}}\hfill
|
| 375 |
+
\parbox[b]{\headwidth}{\centering#3}\hfill
|
| 376 |
+
\llap{\parbox[b]{\headwidth}{\raggedleft#4}}}\headrule}}#5}
|
| 377 |
+
|
| 378 |
+
\def\@fancyfoot#1#2#3#4#5{#1\hbox to\headwidth{\fancy@reset
|
| 379 |
+
\@fancyvbox\footskip{\footrule
|
| 380 |
+
\hbox{\rlap{\parbox[t]{\headwidth}{\raggedright#2}}\hfill
|
| 381 |
+
\parbox[t]{\headwidth}{\centering#3}\hfill
|
| 382 |
+
\llap{\parbox[t]{\headwidth}{\raggedleft#4}}}}}#5}
|
| 383 |
+
|
| 384 |
+
\def\headrule{{\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi
|
| 385 |
+
\hrule\@height\headrulewidth\@width\headwidth \vskip-\headrulewidth}}
|
| 386 |
+
|
| 387 |
+
\def\footrule{{\if@fancyplain\let\footrulewidth\plainfootrulewidth\fi
|
| 388 |
+
\vskip-\footruleskip\vskip-\footrulewidth
|
| 389 |
+
\hrule\@width\headwidth\@height\footrulewidth\vskip\footruleskip}}
|
| 390 |
+
|
| 391 |
+
\def\ps@fancy{%
|
| 392 |
+
\@ifundefined{@chapapp}{\let\@chapapp\chaptername}{}%for amsbook
|
| 393 |
+
%
|
| 394 |
+
% Define \MakeUppercase for old LaTeXen.
|
| 395 |
+
% Note: we used \def rather than \let, so that \let\uppercase\relax (from
|
| 396 |
+
% the version 1 documentation) will still work.
|
| 397 |
+
%
|
| 398 |
+
\@ifundefined{MakeUppercase}{\def\MakeUppercase{\uppercase}}{}%
|
| 399 |
+
\@ifundefined{chapter}{\def\sectionmark##1{\markboth
|
| 400 |
+
{\MakeUppercase{\ifnum \c@secnumdepth>\z@
|
| 401 |
+
\thesection\hskip 1em\relax \fi ##1}}{}}%
|
| 402 |
+
\def\subsectionmark##1{\markright {\ifnum \c@secnumdepth >\@ne
|
| 403 |
+
\thesubsection\hskip 1em\relax \fi ##1}}}%
|
| 404 |
+
{\def\chaptermark##1{\markboth {\MakeUppercase{\ifnum \c@secnumdepth>\m@ne
|
| 405 |
+
\@chapapp\ \thechapter. \ \fi ##1}}{}}%
|
| 406 |
+
\def\sectionmark##1{\markright{\MakeUppercase{\ifnum \c@secnumdepth >\z@
|
| 407 |
+
\thesection. \ \fi ##1}}}}%
|
| 408 |
+
%\csname ps@headings\endcsname % use \ps@headings defaults if they exist
|
| 409 |
+
\ps@@fancy
|
| 410 |
+
\gdef\ps@fancy{\@fancyplainfalse\ps@@fancy}%
|
| 411 |
+
% Initialize \headwidth if the user didn't
|
| 412 |
+
%
|
| 413 |
+
\ifdim\headwidth<0sp
|
| 414 |
+
%
|
| 415 |
+
% This catches the case that \headwidth hasn't been initialized and the
|
| 416 |
+
% case that the user added something to \headwidth in the expectation that
|
| 417 |
+
% it was initialized to \textwidth. We compensate this now. This loses if
|
| 418 |
+
% the user intended to multiply it by a factor. But that case is more
|
| 419 |
+
% likely done by saying something like \headwidth=1.2\textwidth.
|
| 420 |
+
% The doc says you have to change \headwidth after the first call to
|
| 421 |
+
% \pagestyle{fancy}. This code is just to catch the most common cases were
|
| 422 |
+
% that requirement is violated.
|
| 423 |
+
%
|
| 424 |
+
\global\advance\headwidth123456789sp\global\advance\headwidth\textwidth
|
| 425 |
+
\fi}
|
| 426 |
+
\def\ps@fancyplain{\ps@fancy \let\ps@plain\ps@plain@fancy}
|
| 427 |
+
\def\ps@plain@fancy{\@fancyplaintrue\ps@@fancy}
|
| 428 |
+
\let\ps@@empty\ps@empty
|
| 429 |
+
\def\ps@@fancy{%
|
| 430 |
+
\ps@@empty % This is for amsbook/amsart, which do strange things with \topskip
|
| 431 |
+
\def\@mkboth{\protect\markboth}%
|
| 432 |
+
\def\@oddhead{\@fancyhead\fancy@Oolh\f@ncyolh\f@ncyoch\f@ncyorh\fancy@Oorh}%
|
| 433 |
+
\def\@oddfoot{\@fancyfoot\fancy@Oolf\f@ncyolf\f@ncyocf\f@ncyorf\fancy@Oorf}%
|
| 434 |
+
\def\@evenhead{\@fancyhead\fancy@Oelh\f@ncyelh\f@ncyech\f@ncyerh\fancy@Oerh}%
|
| 435 |
+
\def\@evenfoot{\@fancyfoot\fancy@Oelf\f@ncyelf\f@ncyecf\f@ncyerf\fancy@Oerf}%
|
| 436 |
+
}
|
| 437 |
+
% Default definitions for compatibility mode:
|
| 438 |
+
% These cause the header/footer to take the defined \headwidth as width
|
| 439 |
+
% And to shift in the direction of the marginpar area
|
| 440 |
+
|
| 441 |
+
\def\fancy@Oolh{\if@reversemargin\hss\else\relax\fi}
|
| 442 |
+
\def\fancy@Oorh{\if@reversemargin\relax\else\hss\fi}
|
| 443 |
+
\let\fancy@Oelh\fancy@Oorh
|
| 444 |
+
\let\fancy@Oerh\fancy@Oolh
|
| 445 |
+
|
| 446 |
+
\let\fancy@Oolf\fancy@Oolh
|
| 447 |
+
\let\fancy@Oorf\fancy@Oorh
|
| 448 |
+
\let\fancy@Oelf\fancy@Oelh
|
| 449 |
+
\let\fancy@Oerf\fancy@Oerh
|
| 450 |
+
|
| 451 |
+
% New definitions for the use of \fancyhfoffset
|
| 452 |
+
% These calculate the \headwidth from \textwidth and the specified offsets.
|
| 453 |
+
|
| 454 |
+
\def\fancy@offsolh{\headwidth=\textwidth\advance\headwidth\f@ncyO@olh
|
| 455 |
+
\advance\headwidth\f@ncyO@orh\hskip-\f@ncyO@olh}
|
| 456 |
+
\def\fancy@offselh{\headwidth=\textwidth\advance\headwidth\f@ncyO@elh
|
| 457 |
+
\advance\headwidth\f@ncyO@erh\hskip-\f@ncyO@elh}
|
| 458 |
+
|
| 459 |
+
\def\fancy@offsolf{\headwidth=\textwidth\advance\headwidth\f@ncyO@olf
|
| 460 |
+
\advance\headwidth\f@ncyO@orf\hskip-\f@ncyO@olf}
|
| 461 |
+
\def\fancy@offself{\headwidth=\textwidth\advance\headwidth\f@ncyO@elf
|
| 462 |
+
\advance\headwidth\f@ncyO@erf\hskip-\f@ncyO@elf}
|
| 463 |
+
|
| 464 |
+
\def\fancy@setoffs{%
|
| 465 |
+
% Just in case \let\headwidth\textwidth was used
|
| 466 |
+
\fancy@gbl\let\headwidth\fancy@headwidth
|
| 467 |
+
\fancy@gbl\let\fancy@Oolh\fancy@offsolh
|
| 468 |
+
\fancy@gbl\let\fancy@Oelh\fancy@offselh
|
| 469 |
+
\fancy@gbl\let\fancy@Oorh\hss
|
| 470 |
+
\fancy@gbl\let\fancy@Oerh\hss
|
| 471 |
+
\fancy@gbl\let\fancy@Oolf\fancy@offsolf
|
| 472 |
+
\fancy@gbl\let\fancy@Oelf\fancy@offself
|
| 473 |
+
\fancy@gbl\let\fancy@Oorf\hss
|
| 474 |
+
\fancy@gbl\let\fancy@Oerf\hss}
|
| 475 |
+
|
| 476 |
+
\newif\iffootnote
|
| 477 |
+
\let\latex@makecol\@makecol
|
| 478 |
+
\def\@makecol{\ifvoid\footins\footnotetrue\else\footnotefalse\fi
|
| 479 |
+
\let\topfloat\@toplist\let\botfloat\@botlist\latex@makecol}
|
| 480 |
+
\def\iftopfloat#1#2{\ifx\topfloat\empty #2\else #1\fi}
|
| 481 |
+
\def\ifbotfloat#1#2{\ifx\botfloat\empty #2\else #1\fi}
|
| 482 |
+
\def\iffloatpage#1#2{\if@fcolmade #1\else #2\fi}
|
| 483 |
+
|
| 484 |
+
\newcommand{\fancypagestyle}[2]{%
|
| 485 |
+
\@namedef{ps@#1}{\let\fancy@gbl\relax#2\relax\ps@fancy}}
|
app/{src/content/assets/image β scripts/latex-to-markdown/input/figures}/ch1/ch1-lerobot-figure1.png
RENAMED
|
File without changes
|
app/scripts/latex-to-markdown/input/figures/ch2/ch2-approaches.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch2/ch2-classical-limitations.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch2/ch2-cost-accessibility.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch2/ch2-planar-manipulator-floor-box.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch2/ch2-planar-manipulator-floor-shelf.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch2/ch2-planar-manipulator-floor.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch2/ch2-planar-manipulator-free.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch2/ch2-platforms.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch2/ch2-so100-to-planar-manipulator.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch3/ch3-agent-env.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch3/ch3-duck-sim-vs-real.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch3/ch3-hil-serl-examples.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch3/ch3-learning-atlas.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch3/ch3-learning-benefits.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch3/ch3-many-ducks.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch3/ch3-rl-algorithms-atlas.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch3/ch3-rl-examples.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch4/ch4-act-decoder.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch4/ch4-act-encoder.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch4/ch4-act.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch4/ch4-action-vs-observation-distribution.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch4/ch4-async-inference.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch4/ch4-bc-trajectories.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch4/ch4-diffusion-policy.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch4/ch4-diffusion-robot-actions.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch4/ch4-diffusion-vs-flowmatching.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch4/ch4-issues-with-bc.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch4/ch4-latent-variable-model.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch4/ch4-many-latents.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch4/ch4-normalizing-flows.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch4/ch4-observation-action-mapping.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch4/ch4-queues.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch4/ch4-task-effect-on-pairs.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch5/ch5-generalist-policies-timeline.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch5/ch5-ml-vs-robotics-foundation.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch5/ch5-pi0-sampling-timesteps.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch5/ch5-pi0.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch5/ch5-smolvla.png
ADDED
|
Git LFS Details
|
app/scripts/latex-to-markdown/input/figures/ch5/ch5-trends.png
ADDED
|
Git LFS Details
|