Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[todo] Page numbers should be multiple of 4 #277

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions tex/scripts/count_pages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Check if a PDF file is specified
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <pdf-file>"
exit 1
fi

# Check if pdfinfo is available
if ! command -v pdfinfo &> /dev/null; then
echo "pdfinfo could not be found. Please install poppler-utils."
exit 1
fi

PDF_FILE="$1"

# Use pdfinfo to get the number of pages
NUM_PAGES=$(pdfinfo "$PDF_FILE" | grep Pages | awk '{print $2}')

# Check if the number of pages is a multiple of 8
if [ $((NUM_PAGES % 8)) -ne 0 ]; then
echo "Warning: The number of pages in $PDF_FILE is not a multiple of 8."
else
echo "The number of pages in $PDF_FILE is a multiple of 8."
fi