This Node.js script processes a single LaTeX resume source file (main.tex) and generates multiple resume versions based on inline filtering and sorting annotations.
This is to help automate resume customization for different audiences.
Ex: You want to apply to two different types of jobs that have similar skills in some areas, but some of the skills are irrelevant to each other. Now you can change all your different resumes from just one location and easily create more resumes.
- Inline Block Filtering: Use
%Res:{include} - {exclude}[syntax to define which resumes should include or exclude specific content blocks. - Custom Sorting: Apply
%Sort:{ResumeA: 1, ResumeB: 2}[to control the order of sections per resume. - Nested Block Support: Blocks can be nested to represent hierarchical LaTeX structures.
- Stable Sorting: Consecutive blocks are sorted only when necessary, preserving original order where priority values are equal or unspecified.
- Multiple Output Files: Generates a
.texfile for each specified resume, with filtered and sorted content and filtering and sorting comments removed while other comments remain.
- Node.js (version 14 or later)
- Clone or download the project.
- Ensure your LaTeX file is named
main.texand placed in the root directory. - Define your resume variants in the header of the LaTeX file like so:
% RESUMES START
% RESUMES: Resume1, Resume2, Resume3
% RESUMES END- Annotate blocks within the document using:
%Res:{Resume1, Resume2} - {Resume3}[
... content ...
%]
%Sort:{Resume1: 1, Resume2: 2}[
... content ...
%]
%Res:{Resume1, Resume2} - {Resume3} Sort:{Resume1: 1, Resume2: 2}[
... content ...
%]- Run the script:
node resume.jsThis will generate one .tex file per resume in the ./Resumes directory.
main.tex # Your annotated LaTeX resume source file
resume.js # Main processing script
Resumes/ # Output directory for generated .tex files
%Res:{ResumeA, ResumeB} - {ResumeX}[
Includes this block only in ResumeA and ResumeB, and excludes it from ResumeX.%Sort:{ResumeA: 1, ResumeB: 2}[
Sort priority for this block across different resumes. Lower numbers are higher priority.
%]
Marks the end of the current block.
A generic example file is provided as mainexample.tex
MIT License. See LICENSE file for details.