latex-toolbox 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- latex_toolbox-0.1.0/LICENSE +21 -0
- latex_toolbox-0.1.0/PKG-INFO +8 -0
- latex_toolbox-0.1.0/README.md +443 -0
- latex_toolbox-0.1.0/latex_toolbox/.vscode/extensions.json +9 -0
- latex_toolbox-0.1.0/latex_toolbox/__init__.py +3 -0
- latex_toolbox-0.1.0/latex_toolbox/assets/images/common/README.md +8 -0
- latex_toolbox-0.1.0/latex_toolbox/assets/logos/README.md +8 -0
- latex_toolbox-0.1.0/latex_toolbox/assets/logos/logo-university.png +0 -0
- latex_toolbox-0.1.0/latex_toolbox/assets/logos/logo-up-maths-info.jpg +0 -0
- latex_toolbox-0.1.0/latex_toolbox/cli.py +141 -0
- latex_toolbox-0.1.0/latex_toolbox/project.py +638 -0
- latex_toolbox-0.1.0/latex_toolbox/setup.py +256 -0
- latex_toolbox-0.1.0/latex_toolbox/styles/packages/report-code-bash.sty +24 -0
- latex_toolbox-0.1.0/latex_toolbox/styles/packages/report-code-python.sty +25 -0
- latex_toolbox-0.1.0/latex_toolbox/styles/packages/report-colors.sty +11 -0
- latex_toolbox-0.1.0/latex_toolbox/styles/packages/report-metadata.sty +63 -0
- latex_toolbox-0.1.0/latex_toolbox/styles/packages/report-tables.sty +11 -0
- latex_toolbox-0.1.0/latex_toolbox/styles/packages/report-ter-titlepage.sty +146 -0
- latex_toolbox-0.1.0/latex_toolbox/styles/packages/report-theorems-en.sty +17 -0
- latex_toolbox-0.1.0/latex_toolbox/styles/packages/report-theorems-fr.sty +17 -0
- latex_toolbox-0.1.0/latex_toolbox/styles/packages/research-article.sty +113 -0
- latex_toolbox-0.1.0/latex_toolbox/styles/packages/university-project-report.sty +105 -0
- latex_toolbox-0.1.0/latex_toolbox/styles/packages/university-ter-report.sty +112 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-projet-en/README.md +254 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-projet-en/backmatter/ai-statement.tex +34 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-projet-en/figures/.gitkeep +1 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-projet-en/frontmatter/metadata.tex +22 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-projet-en/frontmatter/toc.tex +5 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-projet-en/images/.gitkeep +1 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-projet-en/main.tex +62 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-projet-en/screens/.gitkeep +1 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-projet-en/sections/conclusion.tex +3 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-projet-en/sections/introduction.tex +3 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-projet-fr/README.md +254 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-projet-fr/backmatter/ai-statement.tex +34 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-projet-fr/figures/.gitkeep +1 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-projet-fr/frontmatter/metadata.tex +22 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-projet-fr/frontmatter/toc.tex +5 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-projet-fr/images/.gitkeep +1 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-projet-fr/main.tex +62 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-projet-fr/screens/.gitkeep +1 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-projet-fr/sections/conclusion.tex +3 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-projet-fr/sections/introduction.tex +3 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-ter/README.md +260 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-ter/appendices/annexes.tex +4 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-ter/backmatter/ai-statement.tex +6 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-ter/bibliography/references.bib +6 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-ter/figures/.gitkeep +1 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-ter/frontmatter/metadata.tex +17 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-ter/frontmatter/toc.tex +7 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-ter/images/.gitkeep +1 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-ter/main.tex +28 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-ter/screens/.gitkeep +1 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-ter/sections/conclusion.tex +4 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-ter/sections/contribution.tex +5 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-ter/sections/etat-de-l-art.tex +4 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/rapport-ter/sections/introduction.tex +4 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/research/README.md +259 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/research/appendix/ai-usage.tex +11 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/research/backmatter/bibliography.tex +2 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/research/figures/.gitkeep +1 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/research/frontmatter/abstract.tex +6 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/research/frontmatter/metadata.tex +21 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/research/frontmatter/toc.tex +5 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/research/images/.gitkeep +1 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/research/main.tex +77 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/research/references/references.bib +16 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/research/screens/.gitkeep +1 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/research/sections/conclusion.tex +3 -0
- latex_toolbox-0.1.0/latex_toolbox/templates/research/sections/introduction.tex +3 -0
- latex_toolbox-0.1.0/latex_toolbox.egg-info/PKG-INFO +8 -0
- latex_toolbox-0.1.0/latex_toolbox.egg-info/SOURCES.txt +75 -0
- latex_toolbox-0.1.0/latex_toolbox.egg-info/dependency_links.txt +1 -0
- latex_toolbox-0.1.0/latex_toolbox.egg-info/entry_points.txt +2 -0
- latex_toolbox-0.1.0/latex_toolbox.egg-info/top_level.txt +1 -0
- latex_toolbox-0.1.0/pyproject.toml +26 -0
- latex_toolbox-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Thomas Gourmelen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
# LaTeX Toolbox
|
|
2
|
+
|
|
3
|
+
[Read this in French](./README.fr.md)
|
|
4
|
+
|
|
5
|
+
LaTeX Toolbox is a local toolkit for creating polished, reusable, standalone LaTeX projects from ready-made templates.
|
|
6
|
+
|
|
7
|
+
It is built for a simple workflow:
|
|
8
|
+
- keep your templates, styles, and shared assets in this repository;
|
|
9
|
+
- generate a new project with the `latex-toolbox` command;
|
|
10
|
+
- work on the generated project in VS Code;
|
|
11
|
+
- version each generated project in its own Git repository if needed.
|
|
12
|
+
|
|
13
|
+
If you regularly write course reports, research papers, TER reports, or collaborative LaTeX documents, this repository gives you a clean starting point every time without rebuilding your structure from scratch.
|
|
14
|
+
|
|
15
|
+
## What the toolbox does
|
|
16
|
+
|
|
17
|
+
When you create a project, the toolbox:
|
|
18
|
+
- copies the selected template;
|
|
19
|
+
- renames the main `.tex` file to match the project name;
|
|
20
|
+
- copies the required LaTeX styles into the project;
|
|
21
|
+
- copies the logos from `assets/logos/`;
|
|
22
|
+
- creates a project-level `.gitignore` for common LaTeX build files;
|
|
23
|
+
- creates a project that can compile on its own.
|
|
24
|
+
|
|
25
|
+
Generated projects do not depend on this repository at compile time.
|
|
26
|
+
|
|
27
|
+
## Requirements
|
|
28
|
+
|
|
29
|
+
Recommended setup:
|
|
30
|
+
- Python 3
|
|
31
|
+
- a LaTeX distribution such as `MacTeX`
|
|
32
|
+
- VS Code
|
|
33
|
+
- the `LaTeX Workshop` extension
|
|
34
|
+
|
|
35
|
+
Useful VS Code extensions:
|
|
36
|
+
- `LaTeX Workshop`
|
|
37
|
+
- `LTeX+`
|
|
38
|
+
- `Code Spell Checker`
|
|
39
|
+
|
|
40
|
+
Important:
|
|
41
|
+
- if you use `LaTeX Workshop`, disable `vscode-pdf` to avoid PDF viewer conflicts.
|
|
42
|
+
|
|
43
|
+
## Install the command
|
|
44
|
+
|
|
45
|
+
The easiest installation method is `pipx`.
|
|
46
|
+
|
|
47
|
+
From this repository root:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
cd /path/to/latex-toolbox
|
|
51
|
+
brew install pipx
|
|
52
|
+
pipx install --editable .
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
After that, the command is available as:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
latex-toolbox
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
If the command is not found after installation:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pipx ensurepath
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Then open a new terminal window.
|
|
68
|
+
|
|
69
|
+
## Quick start
|
|
70
|
+
|
|
71
|
+
Create a project report in the current directory:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
latex-toolbox create --name signal-processing-report --template rapport-projet-en
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Create a research-style paper:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
latex-toolbox create --name audio-search-paper --template research
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Then open the generated folder in VS Code and start editing the main file:
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
./signal-processing-report/signal-processing-report.tex
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Available commands
|
|
90
|
+
|
|
91
|
+
List templates:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
latex-toolbox list-templates
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Check or bootstrap a machine for LaTeX work:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
latex-toolbox setup
|
|
101
|
+
latex-toolbox setup --check-only
|
|
102
|
+
latex-toolbox setup --install-tex
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Supported automatic installation paths:
|
|
106
|
+
- macOS: `brew`
|
|
107
|
+
- Ubuntu / Debian: `apt-get`
|
|
108
|
+
- Fedora: `dnf`
|
|
109
|
+
- Arch Linux: `pacman`
|
|
110
|
+
- Windows: `winget`
|
|
111
|
+
|
|
112
|
+
Create a project:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
latex-toolbox create --name my-project --template rapport-projet-en
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Rules:
|
|
119
|
+
- `--name` is required
|
|
120
|
+
- `--template` is required
|
|
121
|
+
- the project is created in the current directory
|
|
122
|
+
- the created folder uses the project name
|
|
123
|
+
|
|
124
|
+
Example:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
cd ~/Desktop
|
|
128
|
+
latex-toolbox create --name shazam-report --template research
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
This creates:
|
|
132
|
+
|
|
133
|
+
```text
|
|
134
|
+
~/Desktop/shazam-report/
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Rename a generated project:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
latex-toolbox rename shazam-report shazam-final-report
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
This renames:
|
|
144
|
+
- the project folder
|
|
145
|
+
- the main `.tex` file
|
|
146
|
+
- the main build artifacts when they already exist
|
|
147
|
+
|
|
148
|
+
You can also run the command from inside the project folder itself:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
cd shazam-report
|
|
152
|
+
latex-toolbox rename shazam-final-report
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Recommended workflow
|
|
156
|
+
|
|
157
|
+
### 1. Create a project
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
latex-toolbox create --name my-project --template rapport-projet-en
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Real examples:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
latex-toolbox create --name deep-learning-lab --template rapport-projet-en
|
|
167
|
+
latex-toolbox create --name rapport-analyse-signaux --template rapport-projet-fr
|
|
168
|
+
latex-toolbox create --name keyword-spotting-paper --template research
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### 2. Open the project in VS Code
|
|
172
|
+
|
|
173
|
+
Open the main file, for example:
|
|
174
|
+
|
|
175
|
+
```text
|
|
176
|
+
./my-project/my-project.tex
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### 3. Fill in the metadata
|
|
180
|
+
|
|
181
|
+
Cover-page information is centralized in:
|
|
182
|
+
|
|
183
|
+
```text
|
|
184
|
+
frontmatter/metadata.tex
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Typical values include:
|
|
188
|
+
- report title
|
|
189
|
+
- course name
|
|
190
|
+
- authors
|
|
191
|
+
- supervisors
|
|
192
|
+
- project links
|
|
193
|
+
- university logo
|
|
194
|
+
|
|
195
|
+
Example:
|
|
196
|
+
|
|
197
|
+
```tex
|
|
198
|
+
\newcommand{\reporttitle}{Audio Fingerprinting Study}
|
|
199
|
+
\newcommand{\coursename}{Machine Learning}
|
|
200
|
+
|
|
201
|
+
\resetauthors
|
|
202
|
+
\addauthor{Alice Martin}{}
|
|
203
|
+
\addauthor{Bob Durand}{}
|
|
204
|
+
|
|
205
|
+
\resetteachers
|
|
206
|
+
\addteacher{Dr Example}{}
|
|
207
|
+
|
|
208
|
+
\resetprojectlinks
|
|
209
|
+
\addprojectlink{Repository}{https://github.com/example/audio-fingerprinting}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
If you leave the second argument empty in `\addauthor{...}{}` or `\addteacher{...}{}`, no role is displayed.
|
|
213
|
+
|
|
214
|
+
### 4. Compile in VS Code
|
|
215
|
+
|
|
216
|
+
With `LaTeX Workshop`:
|
|
217
|
+
- open the main `.tex` file;
|
|
218
|
+
- run `LaTeX Workshop: View LaTeX PDF`;
|
|
219
|
+
- save the file to rebuild;
|
|
220
|
+
- the PDF refreshes after each successful compilation.
|
|
221
|
+
|
|
222
|
+
### 5. Version the generated project
|
|
223
|
+
|
|
224
|
+
Each generated project is standalone, so you can version it separately:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
cd my-project
|
|
228
|
+
git init
|
|
229
|
+
git add .
|
|
230
|
+
git commit -m "Initial report"
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Then create a dedicated GitHub repository for that project only.
|
|
234
|
+
|
|
235
|
+
Typical collaboration workflow:
|
|
236
|
+
- create the project with `latex-toolbox`;
|
|
237
|
+
- initialize Git inside the generated folder;
|
|
238
|
+
- create one private GitHub repository for that project;
|
|
239
|
+
- invite only the people who should access that document.
|
|
240
|
+
|
|
241
|
+
## Available templates
|
|
242
|
+
|
|
243
|
+
### `rapport-projet-en`
|
|
244
|
+
|
|
245
|
+
English project-report template with:
|
|
246
|
+
- cover page
|
|
247
|
+
- table of contents
|
|
248
|
+
- introduction
|
|
249
|
+
- conclusion
|
|
250
|
+
- AI statement
|
|
251
|
+
|
|
252
|
+
### `rapport-projet-fr`
|
|
253
|
+
|
|
254
|
+
Same structure as `rapport-projet-en`, but in French.
|
|
255
|
+
|
|
256
|
+
### `rapport-ter`
|
|
257
|
+
|
|
258
|
+
English TER-style report template with a more detailed academic structure.
|
|
259
|
+
|
|
260
|
+
### `research`
|
|
261
|
+
|
|
262
|
+
English research-style template with:
|
|
263
|
+
- cover page
|
|
264
|
+
- abstract
|
|
265
|
+
- table of contents
|
|
266
|
+
- two-column main body
|
|
267
|
+
- introduction
|
|
268
|
+
- conclusion
|
|
269
|
+
- appendix
|
|
270
|
+
- AI usage note
|
|
271
|
+
- BibTeX bibliography
|
|
272
|
+
|
|
273
|
+
## Generated project structure
|
|
274
|
+
|
|
275
|
+
Typical structure:
|
|
276
|
+
|
|
277
|
+
```text
|
|
278
|
+
my-project/
|
|
279
|
+
├── my-project.tex
|
|
280
|
+
├── frontmatter/
|
|
281
|
+
├── sections/
|
|
282
|
+
├── backmatter/ or appendix/
|
|
283
|
+
├── references/ or bibliography/
|
|
284
|
+
├── figures/
|
|
285
|
+
├── images/
|
|
286
|
+
├── screens/
|
|
287
|
+
├── assets/
|
|
288
|
+
│ ├── images/common/
|
|
289
|
+
│ └── logos/
|
|
290
|
+
└── styles/packages/
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
Important points:
|
|
294
|
+
- the main file uses the project name;
|
|
295
|
+
- LaTeX styles are copied into the project;
|
|
296
|
+
- logos are copied into the project;
|
|
297
|
+
- the project can be shared without shipping the whole toolbox repository.
|
|
298
|
+
|
|
299
|
+
## Modular styles
|
|
300
|
+
|
|
301
|
+
The source styles live in:
|
|
302
|
+
|
|
303
|
+
```text
|
|
304
|
+
styles/packages/
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
Main files:
|
|
308
|
+
- `university-project-report.sty`
|
|
309
|
+
- `university-ter-report.sty`
|
|
310
|
+
- `research-article.sty`
|
|
311
|
+
- `report-metadata.sty`
|
|
312
|
+
- `report-tables.sty`
|
|
313
|
+
- `report-code-python.sty`
|
|
314
|
+
- `report-code-bash.sty`
|
|
315
|
+
- `report-colors.sty`
|
|
316
|
+
- `report-ter-titlepage.sty`
|
|
317
|
+
- `report-theorems-fr.sty`
|
|
318
|
+
|
|
319
|
+
When a project is created, these styles are copied into the generated project under:
|
|
320
|
+
|
|
321
|
+
```text
|
|
322
|
+
styles/packages/
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
## Assets and logos
|
|
326
|
+
|
|
327
|
+
The repository-level folder:
|
|
328
|
+
|
|
329
|
+
```text
|
|
330
|
+
assets/logos/
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
is used as the source for logos copied into new projects.
|
|
334
|
+
|
|
335
|
+
In a generated project:
|
|
336
|
+
- place logos in `assets/logos/`
|
|
337
|
+
- place reusable images in `assets/images/common/`
|
|
338
|
+
|
|
339
|
+
## Bibliography
|
|
340
|
+
|
|
341
|
+
The `research` template uses a separate BibTeX file.
|
|
342
|
+
|
|
343
|
+
Typical path:
|
|
344
|
+
|
|
345
|
+
```text
|
|
346
|
+
references/references.bib
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
Add your references there and compile the document normally.
|
|
350
|
+
|
|
351
|
+
## VS Code snippets
|
|
352
|
+
|
|
353
|
+
Snippets are provided in:
|
|
354
|
+
|
|
355
|
+
```text
|
|
356
|
+
.vscode/latex.code-snippets
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
Useful snippet prefixes:
|
|
360
|
+
- `ltx-code-py`
|
|
361
|
+
- `ltx-code-sh`
|
|
362
|
+
- `ltx-fig`
|
|
363
|
+
- `ltx-screen`
|
|
364
|
+
- `ltx-ai`
|
|
365
|
+
- `ltx-toc`
|
|
366
|
+
|
|
367
|
+
## Evolving the toolbox
|
|
368
|
+
|
|
369
|
+
If you update:
|
|
370
|
+
- templates in `templates/`
|
|
371
|
+
- styles in `styles/packages/`
|
|
372
|
+
- logos in `assets/logos/`
|
|
373
|
+
|
|
374
|
+
then future generated projects will include those changes.
|
|
375
|
+
|
|
376
|
+
Already-generated projects are not updated automatically, because they embed their own local copies.
|
|
377
|
+
|
|
378
|
+
## Repository structure
|
|
379
|
+
|
|
380
|
+
```text
|
|
381
|
+
LaTeX/
|
|
382
|
+
├── assets/
|
|
383
|
+
├── latex_toolbox/
|
|
384
|
+
├── projects/
|
|
385
|
+
├── scripts/
|
|
386
|
+
├── styles/
|
|
387
|
+
├── templates/
|
|
388
|
+
└── .vscode/
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
Role of each folder:
|
|
392
|
+
- `latex_toolbox/`: Python code for the CLI
|
|
393
|
+
- `templates/`: source templates
|
|
394
|
+
- `styles/`: shared toolbox styles
|
|
395
|
+
- `assets/`: shared logos and reusable resources
|
|
396
|
+
- `projects/`: optional place to keep real generated projects
|
|
397
|
+
- `scripts/`: compatibility wrappers
|
|
398
|
+
|
|
399
|
+
## Quick command reference
|
|
400
|
+
|
|
401
|
+
List templates:
|
|
402
|
+
|
|
403
|
+
```bash
|
|
404
|
+
latex-toolbox list-templates
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
Rename a project:
|
|
408
|
+
|
|
409
|
+
```bash
|
|
410
|
+
latex-toolbox rename old-project-name new-project-name
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
Check the local machine setup:
|
|
414
|
+
|
|
415
|
+
```bash
|
|
416
|
+
latex-toolbox setup --check-only
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
Create an English project report:
|
|
420
|
+
|
|
421
|
+
```bash
|
|
422
|
+
latex-toolbox create --name my-project --template rapport-projet-en
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
Create a French project report:
|
|
426
|
+
|
|
427
|
+
```bash
|
|
428
|
+
latex-toolbox create --name mon-projet --template rapport-projet-fr
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
Create a research project:
|
|
432
|
+
|
|
433
|
+
```bash
|
|
434
|
+
latex-toolbox create --name paper-audio-search --template research
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
## Summary
|
|
438
|
+
|
|
439
|
+
LaTeX Toolbox helps you:
|
|
440
|
+
- create LaTeX projects quickly;
|
|
441
|
+
- reuse your styles and logos;
|
|
442
|
+
- work comfortably in VS Code;
|
|
443
|
+
- share each generated project as its own Git repository.
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
from .project import (
|
|
7
|
+
available_templates,
|
|
8
|
+
create_project,
|
|
9
|
+
rename_current_project,
|
|
10
|
+
rename_project,
|
|
11
|
+
)
|
|
12
|
+
from .setup import run_setup
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
16
|
+
parser = argparse.ArgumentParser(
|
|
17
|
+
prog="latex-toolbox",
|
|
18
|
+
description="Utilities for generating standalone LaTeX projects from the toolbox.",
|
|
19
|
+
)
|
|
20
|
+
subparsers = parser.add_subparsers(dest="command", required=True)
|
|
21
|
+
|
|
22
|
+
create_parser = subparsers.add_parser(
|
|
23
|
+
"create",
|
|
24
|
+
help="Create a new LaTeX project from a template.",
|
|
25
|
+
)
|
|
26
|
+
create_parser.add_argument(
|
|
27
|
+
"--name",
|
|
28
|
+
required=True,
|
|
29
|
+
help="Name of the report and of the generated main .tex file.",
|
|
30
|
+
)
|
|
31
|
+
create_parser.add_argument(
|
|
32
|
+
"--template",
|
|
33
|
+
required=True,
|
|
34
|
+
help="Template name to use.",
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
rename_parser = subparsers.add_parser(
|
|
38
|
+
"rename",
|
|
39
|
+
help="Rename a generated LaTeX project folder and its main .tex file.",
|
|
40
|
+
)
|
|
41
|
+
rename_parser.add_argument(
|
|
42
|
+
"names",
|
|
43
|
+
nargs="+",
|
|
44
|
+
help="Use `old_name new_name` from the parent folder, or only `new_name` from inside the project folder.",
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
setup_parser = subparsers.add_parser(
|
|
48
|
+
"setup",
|
|
49
|
+
help="Install VS Code extensions when possible and check LaTeX prerequisites.",
|
|
50
|
+
)
|
|
51
|
+
setup_parser.add_argument(
|
|
52
|
+
"--check-only",
|
|
53
|
+
action="store_true",
|
|
54
|
+
help="Only check the current environment without installing VS Code extensions.",
|
|
55
|
+
)
|
|
56
|
+
setup_parser.add_argument(
|
|
57
|
+
"--skip-extensions",
|
|
58
|
+
action="store_true",
|
|
59
|
+
help="Skip VS Code extension installation.",
|
|
60
|
+
)
|
|
61
|
+
setup_parser.add_argument(
|
|
62
|
+
"--install-tex",
|
|
63
|
+
action="store_true",
|
|
64
|
+
help="Try to install a LaTeX distribution with a common package manager for the current OS.",
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
subparsers.add_parser(
|
|
68
|
+
"list-templates",
|
|
69
|
+
help="List the available templates.",
|
|
70
|
+
)
|
|
71
|
+
return parser
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def main(argv: list[str] | None = None) -> int:
|
|
75
|
+
parser = build_parser()
|
|
76
|
+
args = parser.parse_args(argv)
|
|
77
|
+
|
|
78
|
+
if args.command == "list-templates":
|
|
79
|
+
for template_name in available_templates():
|
|
80
|
+
print(template_name)
|
|
81
|
+
return 0
|
|
82
|
+
|
|
83
|
+
if args.command == "create":
|
|
84
|
+
try:
|
|
85
|
+
target_dir, main_tex_file = create_project(
|
|
86
|
+
name=args.name,
|
|
87
|
+
template=args.template,
|
|
88
|
+
)
|
|
89
|
+
except (ValueError, FileExistsError) as exc:
|
|
90
|
+
print(str(exc), file=sys.stderr)
|
|
91
|
+
return 1
|
|
92
|
+
|
|
93
|
+
print(f"Project created in: {target_dir}")
|
|
94
|
+
print(f"Open next: {main_tex_file}")
|
|
95
|
+
print("The project now embeds its local styles in styles/packages/.")
|
|
96
|
+
print(f"Template used: {args.template}")
|
|
97
|
+
print(f"Current parent folder: {target_dir.parent}")
|
|
98
|
+
print("Remember to customise frontmatter/metadata.tex and the sections.")
|
|
99
|
+
return 0
|
|
100
|
+
|
|
101
|
+
if args.command == "rename":
|
|
102
|
+
try:
|
|
103
|
+
if len(args.names) == 1:
|
|
104
|
+
target_dir, main_tex_file = rename_current_project(
|
|
105
|
+
new_name=args.names[0],
|
|
106
|
+
)
|
|
107
|
+
elif len(args.names) == 2:
|
|
108
|
+
target_dir, main_tex_file = rename_project(
|
|
109
|
+
old_name=args.names[0],
|
|
110
|
+
new_name=args.names[1],
|
|
111
|
+
)
|
|
112
|
+
else:
|
|
113
|
+
print(
|
|
114
|
+
"Usage: latex-toolbox rename <new-name> "
|
|
115
|
+
"or latex-toolbox rename <old-name> <new-name>",
|
|
116
|
+
file=sys.stderr,
|
|
117
|
+
)
|
|
118
|
+
return 1
|
|
119
|
+
except (FileNotFoundError, FileExistsError) as exc:
|
|
120
|
+
print(str(exc), file=sys.stderr)
|
|
121
|
+
return 1
|
|
122
|
+
|
|
123
|
+
print(f"Project renamed in: {target_dir}")
|
|
124
|
+
print(f"New main file: {main_tex_file}")
|
|
125
|
+
print("The project folder and the main .tex file have been renamed.")
|
|
126
|
+
print("Build files tied to the main name were also renamed when they existed.")
|
|
127
|
+
return 0
|
|
128
|
+
|
|
129
|
+
if args.command == "setup":
|
|
130
|
+
return run_setup(
|
|
131
|
+
check_only=args.check_only,
|
|
132
|
+
skip_extensions=args.skip_extensions,
|
|
133
|
+
install_tex=args.install_tex,
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
parser.print_help()
|
|
137
|
+
return 1
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
if __name__ == "__main__":
|
|
141
|
+
raise SystemExit(main())
|