all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Auto-populate TexLive
@ 2024-06-05 18:18 outlook user
  0 siblings, 0 replies; only message in thread
From: outlook user @ 2024-06-05 18:18 UTC (permalink / raw)
  To: help-guix@gnu.org

A CoPilot generated script to auto-populate needed packages to compile a LuaLaTeX file without getting all the packages

```bash
#!/bin/bash

# Initialize an empty string for packages
packages=""

# Loop until no missing .sty files are found
while true; do
    # Attempt to compile the LuaLaTeX document
    missing_sty=$(guix shell texlive-scheme-basic $packages -- lualatex -file-line-error -halt-on-error -interaction=nonstopmode main.tex 2>&1 | grep "! LaTeX Error: File \`.*.sty' not found." | cut --delimiter '`' -f 2 | cut --delimiter "." -f 1)
    
    # Break the loop if no missing .sty files are detected
    if [ -z "$missing_sty" ]; then
        echo "Compilation successful, no missing .sty files."
        break
    fi
    
    # Prepend 'texlive-' to the missing .sty file name and add it to the packages string
    package_name=$(echo $missing_sty | sed 's/^/texlive-/g')
    packages="$packages $package_name"
    
    # Inform the user which package is being added
    echo "Adding missing package: $package_name"
done

# Final message
echo "All required packages have been included."

```

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-06-05 18:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-05 18:18 Auto-populate TexLive outlook user

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.