Dodaj slike v tex verzijo

This commit is contained in:
Martin Vuk 2026-01-14 13:10:02 +01:00
parent eb034aff97
commit 65af0b39b0
10 changed files with 724 additions and 4 deletions

28
pripravi_slike.ps1 Normal file
View file

@ -0,0 +1,28 @@
$diagramsDir = "diagrams"
$outputDir = "slike"
# Create output directory if it doesn't exist
if (!(Test-Path -Path $outputDir)) {
New-Item -ItemType Directory -Path $outputDir | Out-Null
}
# Get all wrapper .typ files in the diagrams directory (files ending in -img.typ)
$files = Get-ChildItem -Path $diagramsDir -Filter "*-img.typ"
foreach ($file in $files) {
# Remove -img from the output filename to match the desired naming convention
$baseName = $file.BaseName -replace "-img$", ""
$outputFile = Join-Path -Path $outputDir -ChildPath ($baseName + ".pdf")
Write-Host "Compiling $($file.Name) to $outputFile..."
# Run typst compile with necessary flags
# --root . : Allow access to files in the project root (like definicije.typ)
# --ppi 300 : Increase resolution for better quality
typst compile --root . --ppi 300 $file.FullName $outputFile
if ($LASTEXITCODE -ne 0) {
Write-Error "Failed to compile $($file.Name)"
}
}
Write-Host "All diagrams compiled."