-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-build-bookmarks.bat
More file actions
49 lines (39 loc) · 1.68 KB
/
docker-build-bookmarks.bat
File metadata and controls
49 lines (39 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
@echo off
echo 🐳 Building LaTeX document with bookmarks using Docker...
REM Check if Docker container is running
docker ps | findstr "latex" >nul
if errorlevel 1 (
echo ❌ Docker container 'latex' is not running.
echo 💡 Start it with: docker-compose up -d latex
pause
exit /b 1
)
REM Clean previous build
echo 🧹 Cleaning previous build...
docker exec latex rm -rf /workspace/output/*
docker exec latex mkdir -p /workspace/output
REM Build the document multiple times to ensure proper bookmarks
echo 📖 First compilation...
docker exec latex bash -c "cd /workspace/latex && pdflatex -interaction=nonstopmode -output-directory=../output book.tex"
echo 📖 Second compilation (for references)...
docker exec latex bash -c "cd /workspace/latex && pdflatex -interaction=nonstopmode -output-directory=../output book.tex"
echo 📖 Third compilation (for bookmarks)...
docker exec latex bash -c "cd /workspace/latex && pdflatex -interaction=nonstopmode -output-directory=../output book.tex"
REM Generate index
echo 📋 Generating index...
docker exec latex bash -c "cd /workspace/latex && makeindex -o ../output/book.ind ../output/book.idx"
echo 📖 Final compilation with index...
docker exec latex bash -c "cd /workspace/latex && pdflatex -interaction=nonstopmode -output-directory=../output book.tex"
echo ✅ Build with bookmarks completed successfully!
echo 📄 PDF generated at: output/book.pdf
echo 🔖 Bookmarks should now be visible in the PDF viewer
REM Check if PDF was created
if exist "output\book.pdf" (
echo ✅ PDF file exists and is ready!
dir output\book.pdf
) else (
echo ❌ PDF file was not created. Check for errors above.
pause
exit /b 1
)
pause