Standardizes copyedit PDF font size

Ensures copyedit PDFs use the same font size as regular PDFs.

Increases float capacity for copy-edit mode to accommodate double-spacing and prevent potential layout issues.

Copies the base configuration file by first removing any existing symbolic link to prevent errors.
This commit is contained in:
Vijay Janapa Reddi
2026-02-03 07:14:37 -05:00
parent 25d1dca02b
commit 8bdaf339ae

View File

@@ -18,7 +18,7 @@ set -e
# Configurable settings — edit these as needed
# =============================================================================
REGULAR_FONTSIZE="9pt" # Font size for regular PDF
COPYEDIT_FONTSIZE="12pt" # Font size for copy-edit PDF
COPYEDIT_FONTSIZE="9pt" # Font size for copy-edit PDF (same as regular)
COPYEDIT_LINESTRETCH="2" # Line spacing for copy-edit PDF (2 = double)
# =============================================================================
@@ -100,7 +100,8 @@ echo " Config: $SOURCE_CONFIG"
echo " Output: $QUARTO_DIR/$OUTPUT_DIR"
echo "============================================="
# Copy base config
# Copy base config (remove symlink first if it exists, then copy)
rm -f "$TARGET_CONFIG"
cp "$SOURCE_CONFIG" "$TARGET_CONFIG"
# For copyedit mode, patch fontsize and linestretch in-place
@@ -117,6 +118,15 @@ if [[ "$COPYEDIT" == true ]]; then
sed -i.bak "/fontsize: ${COPYEDIT_FONTSIZE}/a\\
linestretch: ${COPYEDIT_LINESTRETCH}" "$TARGET_CONFIG"
# Add extra float capacity for copy-edit (double-spacing needs more floats)
# Insert after the existing include-in-header section
sed -i.bak '/include-in-header:/,/include-before-body:/ {
/include-before-body:/i\
- text: |\
\\extrafloats{1000}\
\\AtBeginDocument{\\let\\dumpmargins\\relax}
}' "$TARGET_CONFIG"
# Clean up sed backup files
rm -f "$TARGET_CONFIG.bak"
fi