Skip to content

Instantly share code, notes, and snippets.

@hasandiwan
Created October 16, 2024 06:49
Show Gist options
  • Save hasandiwan/6ed0259e82ae70635e6853dd47ef767b to your computer and use it in GitHub Desktop.
Save hasandiwan/6ed0259e82ae70635e6853dd47ef767b to your computer and use it in GitHub Desktop.
#!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