unofficial mirror of help-guix@gnu.org 
 help / color / mirror / 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).