Created
October 16, 2024 06:49
-
-
Save hasandiwan/6ed0259e82ae70635e6853dd47ef767b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use strict; | |
use warnings; | |
use diagnostics; | |
`latexmk -xelatex -pdf ~/texRepo/HouseWarmingInvitation.tex`; | |
`mv HouseWarmingInvitation.pdf ~/public_html`; | |
`pdfseparate ./public_html/HouseWarmingInvitation.pdf public_html/invitees/%d`; | |
`rm -f ~/HouseWarmingInvitation.*`; | |
open my $tex, '/home/ec2-user/texRepo/HouseWarmingInvitation.tex' or die "$!"; | |
my $counter = 0; | |
foreach my $line (<$tex>) { | |
next unless $line =~ /^\\mailentry\{([^}]+)}/; | |
$counter++; | |
my @invitee_parts = split / /, $1; | |
my $newfilename = lc($invitee_parts[0]).$invitee_parts[1].'.pdf'; | |
print "$counter\t$newfilename\n"; | |
`mv ~/public_html/invitees/$counter ~/public_html/invitees/$newfilename`; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment