From efd7999992f7884ab62ad9a90217e8f3fa7f92da Mon Sep 17 00:00:00 2001 From: zack Date: Sat, 23 Nov 2024 23:37:58 -0500 Subject: [PATCH] updates: add zoey resume --- .latexmkrc | 35 +++++++++++++++++++++++++++++++++++ flake.nix | 49 ++++++++++++++++++++++++++++++++++++++++++------- resume.tex | 36 ++++++++++++++++++++++++++++++++---- 3 files changed, 109 insertions(+), 11 deletions(-) create mode 100644 .latexmkrc diff --git a/.latexmkrc b/.latexmkrc new file mode 100644 index 0000000..bd1aa4d --- /dev/null +++ b/.latexmkrc @@ -0,0 +1,35 @@ +# .latexmkrc +$pdf_mode = 4; # Generate PDF using lualatex +$lualatex = 'lualatex -interaction=nonstopmode -shell-escape'; +$clean_ext = 'aux fdb_latexmk fls log synctex.gz xdv'; + +# Check if isZoey is set +$is_zoey = $ENV{isZoey} || '0'; # Default to false + +# Set variables based on isZoey +if ($is_zoey eq '1') { + $name = 'Zoey Myers'; + $email = 'hi@zoeys.computer'; + $website = 'zoeys.computer'; + $social = '\\emoji{transgender-flag}'; + $linkedin = ''; # Empty or alternative URL if needed +} else { + $name = 'Zachary Myers'; + $email = 'me@zackmyers.io'; + $website = 'zackmyers.io'; + $social = 'zackartz'; + $linkedin = 'https://www.linkedin.com/in/zachary-myers-b9a150186/'; +} + +$lualatex = "lualatex '\\newcommand{\\myname}{Default}" . + "\\newcommand{\\myemail}{Default}" . + "\\newcommand{\\mywebsite}{Default}" . + "\\newcommand{\\mysocial}{Default}" . + "\\newcommand{\\mylinkedin}{Default}" . + "\\newcommand{\\gituser}{zackartz}" . + "\\renewcommand{\\myname}{$name}" . + "\\renewcommand{\\myemail}{$email}" . + "\\renewcommand{\\mywebsite}{$website}" . + "\\renewcommand{\\mysocial}{$social}" . + "\\renewcommand{\\mylinkedin}{$linkedin}" . + "\\input{%S}'"; diff --git a/flake.nix b/flake.nix index 1e3a1aa..ebdb84e 100644 --- a/flake.nix +++ b/flake.nix @@ -24,24 +24,59 @@ pkgs.coreutils pkgs.findutils pkgs.texlive.combined.scheme-full + pkgs.noto-fonts-color-emoji + pkgs.fontconfig + pkgs.dejavu_fonts + pkgs.gnugrep ]; + + FONTCONFIG_FILE = pkgs.makeFontsConf { + fontDirectories = [ + pkgs.noto-fonts-color-emoji + pkgs.dejavu_fonts + ]; + }; + buildPhase = '' export PATH="${pkgs.lib.makeBinPath buildInputs}" - echo $PATH - mkdir -p .cache/texmf-var + export XDG_CACHE_HOME="$PWD/.cache" + export FONTCONFIG_CACHE_DIR="$PWD/.cache/fontconfig" + + mkdir -p .cache/texmf-var $FONTCONFIG_CACHE_DIR + + # Rebuild font cache (redirect stderr to suppress font cache messages) + fc-cache -f -v 2>&1 | grep -v "caching" | grep -v "skipping" || true + + # Run latexmk and filter out specific warnings env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \ - latexmk -interaction=nonstopmode -f -pdf \ - resume.tex + isZoey=1 latexmk -interaction=nonstopmode -f resume.tex 2>&1 \ + | grep -v "Missing character" \ + | grep -v "Font.*cache" \ + | grep -v "fontconfig:" \ + | grep -v "looped directory detected" \ + || [ $? -eq 1 ] # Allow latexmk to fail but still show output + mv resume.pdf ZoeyMyersResume.pdf + + env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \ + isZoey=0 latexmk -interaction=nonstopmode -f resume.tex 2>&1 \ + | grep -v "Missing character" \ + | grep -v "Font.*cache" \ + | grep -v "fontconfig:" \ + | grep -v "looped directory detected" \ + || [ $? -eq 1 ] + mv resume.pdf ZacharyMyersResume.pdf ''; installPhase = '' mkdir -p $out - cp resume.pdf $out/ + cp *.pdf $out/ ''; }; pdf = pkgs.runCommand "resume-pdf" {} '' mkdir -p $out/nix-support - cp ${self.packages.${pkgs.system}.default}/resume.pdf $out/ - echo "file pdf $out/resume.pdf" > $out/nix-support/hydra-build-products + cp ${self.packages.${pkgs.system}.default}/ZoeyMyersResume.pdf $out/ + cp ${self.packages.${pkgs.system}.default}/ZacharyMyersResume.pdf $out/ + echo "file pdf $out/ZoeyMyersResume.pdf" > $out/nix-support/hydra-build-products + echo "file pdf $out/ZacharyMyersResume.pdf" >> $out/nix-support/hydra-build-products ''; }); diff --git a/resume.tex b/resume.tex index 794d4ac..49afe92 100644 --- a/resume.tex +++ b/resume.tex @@ -6,6 +6,16 @@ \documentclass[letterpaper,5pt]{article} +\providecommand{\myname}{Zachary Myers} +\providecommand{\myemail}{me@zackmyers.io} +\providecommand{\mywebsite}{zackmyers.io} +\providecommand{\mysocial}{zackartz} +\providecommand{\mylinkedin}{https://www.linkedin.com/in/zachary-myers-b9a150186/} + +\usepackage[utf8]{inputenc} +\usepackage{newunicodechar} +\usepackage{fontspec} % For Unicode symbols + \usepackage[mocha]{catppuccin} \usepackage{latexsym} \usepackage[empty]{fullpage} @@ -16,8 +26,16 @@ \usepackage[english]{babel} \usepackage{tabularx} \usepackage{fontawesome5} +\usepackage{emoji} % \input{glyphtounicode} + +\setemojifont{Noto Color Emoji}[ + Path = /nix/store/y2h3pmlj3msxm8f1fw99kpbl2kfr2sr3-noto-fonts-color-emoji-2.042/share/fonts/noto/, + Extension = .ttf +] + + \setlength{\footskip}{3.60004pt} \pagestyle{fancy} \fancyhf{} % clear all header and footer fields @@ -85,18 +103,28 @@ } \newcommand{\resumeItemListEnd}{\end{itemize}\vspace{0pt}} +\newcommand{\equal}[2]{\ifnum\pdf@strcmp{#1}{#2}=0 } +\newcommand{\sociallinks}{% + \ifx\mysocial\gituser + {\faLinkedin\space\href{\mylinkedin}{\underline{\myname}}} {\space\space\space}% + {\faIcon{github}\space\href{https://github.com/\mysocial}{\underline{\mysocial}}} {\space\space\space}% + \else + {\mysocial} {\space\space\space}% + \fi +} + %------------------------------------------- %%%%%% CV STARTS HERE %%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} + %----------HEADING----------------- \begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}r} - \textbf{\href{https://zackmyers.io/}{\Large \color{ctpBlue}Zachary Myers}} & {\faIcon{envelope}\space}Email : \href{mailto:me@zackmyers.io}{me@zackmyers.io}\\ - {\faLinkedin\space\href{https://www.linkedin.com/in/zachary-myers-b9a150186/}{\underline{Zachary Myers}}} {\space\space\space} - {\faIcon{github}\space\href{https://github.com/zackartz}{\underline{zackartz}}} {\space\space\space} - {\faIcon{user}\space \href{https://zackmyers.io}{\underline{Website}}} {\space\space\space} + \textbf{\href{https://\mywebsite/}{\Large \color{ctpBlue}\myname}} & {\faIcon{envelope}\space}Email : \href{mailto:\myemail}{\myemail}\\ + \sociallinks + {\faIcon{user}\space \href{https://\mywebsite}{\underline{Website}}} {\space\space\space} {\faIcon{passport}\space{{US Citizen}}}{\space\space\space} {\faIcon{clock}\space{EST/EDT}} {\space\space\space}