all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: outlook user <RACP@outlook.fr>
To: "help-guix@gnu.org" <help-guix@gnu.org>
Subject: Auto-populate TexLive
Date: Wed, 5 Jun 2024 18:18:52 +0000	[thread overview]
Message-ID: <AS8P251MB085429E0EE5869E3CEFF22D097F92@AS8P251MB0854.EURP251.PROD.OUTLOOK.COM> (raw)

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."

```

                 reply	other threads:[~2024-06-05 18:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AS8P251MB085429E0EE5869E3CEFF22D097F92@AS8P251MB0854.EURP251.PROD.OUTLOOK.COM \
    --to=racp@outlook.fr \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.