Files
md_to_gost/md2latex/README.md
T
Igor20264 516abe7b83
Python application / build (push) Has been cancelled
BigUpdate
2026-09-03 10:44:08 +03:00

52 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# MD → LaTeX → PDF (XeLaTeX)
Два пайплайна на базе шаблона [mirea-ninja/Latex-Template-for-Report-Diploma-Thesis](https://github.com/mirea-ninja/Latex-Template-for-Report-Diploma-Thesis).
| # | Шаг | Инструмент | Результат |
|---|-----|------------|-----------|
| **1** | MD → LaTeX | `python -m md2latex` | каталог проекта (`main.tex`, `content.tex`, …) |
| **2** | LaTeX → PDF | **XeLaTeX** / `latexmk -xelatex` | `main.pdf` |
Таблицы → **`longtable`** с `\endfirsthead` / `\endhead` и подписью **«Продолжение таблицы N»** на следующих страницах (это делает сам LaTeX, без угадывания высоты в Python).
## Требования
- Python 3.10+ (тот же venv, что и md2gost)
- [MiKTeX](https://miktex.org) или TeX Live с **XeLaTeX**
- Шрифт **Times New Roman** (Windows обычно есть)
## Быстрый старт
```powershell
# оба пайплайна сразу
python -m md2latex examples/example.md -o build/example_latex --pdf
# или
powershell -File scripts/md2pdf.ps1 examples/example.md
```
Только пайплайн 1 (без PDF):
```powershell
python -m md2latex report.md -o report_latex
# затем:
cd report_latex
latexmk -xelatex main.tex
# или: xelatex main.tex && xelatex main.tex
```
Титул:
```powershell
python -m md2latex report.md -o report_latex --titlepage title.pdf --pdf
```
## Синтаксис MD
Тот же диалект, что у **md2gost** (`# *ВВЕДЕНИЕ`, `%id`, `@Таблица:id`, pipe-tables, `$$`, fenced code, `[n]: …`).
## Структура шаблона
`latex/mirea/` — вендор шаблона МИРЭА (ГОСТ: TNR 14, интервал 1.5, поля 30/10/20/20).
Генератор копирует его в `-o` и перезаписывает только `content.tex`.