Repository navigation
Expand file tree
/
Copy pathcv.tex
More file actions
1036 lines (946 loc) · 43 KB
/
Copy pathcv.tex
File metadata and controls
1036 lines (946 loc) · 43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%==============================================================================
% SHABNAM HAKIMI — CURRICULUM VITAE
% Built with Awesome-CV (https://github.com/posquit0/Awesome-CV)
%==============================================================================
\documentclass[11pt, a4paper]{awesome-cv}
%------------------------------------------------------------------------------
% PACKAGES
%------------------------------------------------------------------------------
\usepackage{etoolbox}
\usepackage{needspace} % \needspace{N} ensures N of vspace remain on
% the page or forces a break — used to keep
% short sections (Reviewing, Mentorship) from
% being orphaned across page boundaries.
%------------------------------------------------------------------------------
% BIBLIOGRAPHY STYLE
%
% Change the style name below. Common options:
% numeric — [1], [2], … (default)
% ieee — numbered, abbreviated authors & journal names
% nature — numbered superscripts, condensed
% apa — author-year (disable showBibNumbers / reverseBibNumbers)
% authoryear — generic author-year
% chicago-authordate
% mla
%
% NOTE: showBibNumbers and reverseBibNumbers only work with numeric-family
% styles (numeric, ieee, nature). For author-year styles, also set:
% \togglefalse{showBibNumbers}
%------------------------------------------------------------------------------
\PassOptionsToPackage{style=numeric}{biblatex} % ← change style here
\usepackage[backend=biber,
sorting=none,
defernumbers=true,
maxbibnames=99]{biblatex}
\usepackage{xstring}
\usepackage[symbol,perpage]{footmisc} % symbol footnotes, reset per page
\usepackage{perpage} % gives us \MakePerPage for custom resets
% Preserve the custom 'status' field so Biber passes it through to LaTeX.
% Without this, Biber silently drops unknown fields and \iffieldequalstr
% on 'status' always evaluates false (skipping all patent entries).
% \DeclareSourcemap fires during Biber's source-mapping phase and copies
% the raw 'status' value into 'addendum' (a known biblatex field).
% \iffieldequalstr then tests 'addendum' instead of 'status'.
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=status, fieldtarget=addendum]
}
% Drop any entry tagged keywords={unlisted} during source-mapping so it
% never reaches biblatex. Used for items kept in a bib file for the
% corpus pipeline but intentionally excluded from every compiled CV
% (e.g., PhD thesis in chapters.bib).
\map{
\step[fieldsource=keywords, match=\regexp{\bunlisted\b}, final]
\step[entrynull]
}
}
}
%------------------------------------------------------------------------------
% PUBLICATION ANNOTATION SYMBOLS
%
% \cvfnmark{equalcontrib} — superscript * (equal contributions / shared 1st)
% \cvfnmark{mentee} — superscript † (mentee co-author)
%
% Used in usera fields and emitted automatically by the default name format
% for surnames listed in \cvmentees.
%
% The legend is printed once at the top of the Publications section via
% \cvpublegend, not repeated per subsection.
%------------------------------------------------------------------------------
\newcommand{\cvfnmark}[1]{%
\IfStrEq{#1}{equalcontrib}{\textsuperscript{*}}{%
\IfStrEq{#1}{mentee}{\textsuperscript{\textdagger}}{%
\textsuperscript{?}}}%
}
% \cvpublegend: prints the symbol legend on its own line below the section heading.
% \bodyfontlight = Roboto-Thin which has no italic variant, so \textit silently
% falls back to upright. \bodyfont = Roboto-Regular which does have Roboto-Italic.
\newcommand{\cvpublegend}{%
% The preceding \cvsection heading is a 16pt line; the interline glue that
% would place this 9pt legend below it can't clear a heading that tall, so
% the legend collides with the heading + rule. Suppress the interline glue
% (\nointerlineskip → prevdepth = -1000pt) and drop the legend an explicit,
% measured distance below the heading's bottom edge instead — independent of
% baselineskip. (Was \par\vspace{-4pt}, which overlapped the heading.)
\par\nointerlineskip\vspace{5pt}%
{\bodyfont\fontsize{9pt}{1em}\selectfont\textit{* equal contributions, shared first authorship\quad\textup{\textbar}\quad\textdagger\ mentee co-author}}%
\par%
% Flag: the legend is visually part of the section heading block, so
% the next \cvsubsection should tuck under it (\cvsubsectionAfterLegend)
% instead of using the After-Section gap. Also clear cvprevwassection
% so the cvpublegend tight-tuck takes priority over the After-Section
% gap (both flags would otherwise be true between \cvsection and the
% next \cvsubsection when \cvpublegend appears between them).
\global\booltrue{cvafterlegend}%
\global\boolfalse{cvprevwassection}%
}
%==============================================================================
% BIBLIOGRAPHY NUMBERING TOGGLES & MACHINERY
%==============================================================================
%
% \toggletrue{showBibNumbers} → show [1], [2], … labels
% \togglefalse{showBibNumbers} → hide labels entirely
%
% \toggletrue{reverseBibNumbers} → N…1 (most recent = highest number)
% \togglefalse{reverseBibNumbers}→ 1…N (forward order)
%
% Numbering restarts at 1 (or N) for each bibliography section.
%
% Implementation: we use our own per-item counter entirely independent of
% biblatex's internal numbering. \AtEveryBibitem increments a running index;
% we write each section's total to the .aux so the next pass can compute
% reverse labels. No refsection environments needed.
%==============================================================================
\newtoggle{showBibNumbers}
\newtoggle{reverseBibNumbers}
\toggletrue{showBibNumbers} % true = show numbers | false = hide numbers
\togglefalse{reverseBibNumbers} % true = reverse (N…1) | false = forward (1…N)
% Per-section counters
\newcounter{cvbibindex} % increments with each printed entry (reset per section)
\newcounter{cvbibtotal} % total entries in current section (loaded from aux)
% cvbibindex starts at 1. \AtEveryBibitem fires AFTER the label is rendered,
% so the label reads the current value (1, 2, 3…) and then the increment
% advances it for the next entry.
\AtEveryBibitem{\stepcounter{cvbibindex}}
% Override the printed label to use our own counter.
% labelnumber controls the number inside brackets in the entry body.
% We also override the list \item label via the labelnumberwidth format
% and the blx@lbx numeric label macro.
\DeclareFieldFormat{labelnumber}{%
\iftoggle{showBibNumbers}{%
\iftoggle{reverseBibNumbers}{%
\number\numexpr\value{cvbibtotal}-\value{cvbibindex}+1\relax%
}{%
\number\value{cvbibindex}%
}%
}{%
\hspace{-\labelsep}%
}%
}
% Also patch the label used for \item[...] in the bibliography list env.
% In biblatex's numeric style this is \printtext[labelnumberwidth]{...}
% which calls \mkbibbrackets{\printfield{labelnumber}} — so overriding
% labelnumber above is sufficient.
% Redefine the bibliography list environment to control indentation.
% When numbers are shown: label in a compact gutter, text flush after.
% When numbers are hidden: no gutter, hanging indent of \bibhang.
\AtBeginDocument{%
\iftoggle{showBibNumbers}{%
\setlength{\bibhang}{0pt}%
\defbibenvironment{bibliography}
{\list{\mkbibbrackets{\printfield{labelnumber}}}
{\setlength{\labelwidth}{2em}%
\setlength{\labelsep}{0.5em}%
\setlength{\leftmargin}{\labelwidth}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemindent}{0pt}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}%
% Zero topsep/partopsep so \end{thebibliography} doesn't add
% extra glue that escapes \removelastskip in the patched
% \cvsubsection — keeps biblatex-routed within-section gaps
% uniform with cvparagraph-routed ones.
\setlength{\topsep}{0pt}%
\setlength{\partopsep}{0pt}%
% R5: each entry is one paragraph, so an infinite interline penalty
% forbids a break BETWEEN LINES OF AN ENTRY while leaving breaks
% between entries (\itemsep glue) free.
\iftoggle{keepCitationsWhole}{\interlinepenalty=10000\relax}{}}}
{\endlist}
{\item}%
}{%
\setlength{\biblabelsep}{0pt}%
\defbibenvironment{bibliography}
{\list{}
{\setlength{\leftmargin}{\bibhang}%
\setlength{\itemindent}{-\leftmargin}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}%
\setlength{\topsep}{0pt}%
\setlength{\partopsep}{0pt}%
% R5: see the numbered branch above -- both must carry this, or the
% rule silently lapses whenever showBibNumbers is flipped.
\iftoggle{keepCitationsWhole}{\interlinepenalty=10000\relax}{}}}
{\endlist}
{\item}%
}%
}
% \startbibsection{name} — call before each \printbibliography block.
% Resets the index counter and loads the stored total for this section.
% On the first compile the total is 0 (labels may be wrong); correct on
% subsequent compiles once \finishbibsection has written the total to .aux.
\newcommand{\startbibsection}[1]{%
\setcounter{cvbibindex}{1}%
\ifcsdef{cvbibtotal@#1}{%
\setcounter{cvbibtotal}{\csname cvbibtotal@#1\endcsname}%
}{%
\setcounter{cvbibtotal}{0}%
}%
}
% \finishbibsection stores (cvbibindex - 1) as the total, since cvbibindex
% ends up one past the last entry after the final increment.
\newwrite\cvbibcountsfile
\AtBeginDocument{\immediate\openout\cvbibcountsfile=cvbibcounts.tex}
\AtEndDocument{\immediate\closeout\cvbibcountsfile}
\newcommand{\finishbibsection}[1]{%
\immediate\write\cvbibcountsfile{%
\string\expandafter\string\def
\string\csname\space cvbibtotal@#1\string\endcsname
{\number\numexpr\value{cvbibindex}-1\relax}%
}%
}
% Load counts written by previous pass
\AtBeginDocument{\IfFileExists{cvbibcounts.tex}{\input{cvbibcounts.tex}}{}}
%------------------------------------------------------------------------------
% BOLD OWN NAME IN BIBLIOGRAPHY
%
% Entries without a usera field go through the biblatex name formatter.
% standard.bbx (used by the numeric style) calls:
% \DeclareNameAlias{sortname}{default}
% during bibliography output, unconditionally overriding any sortname alias
% we set. The only reliable fix is to redefine the 'default' name format
% itself to do the bolding — that way standard.bbx's alias routes straight
% into our bolding code.
%
% Entries with a usera field bypass the formatter entirely; bold is applied
% manually via \cvbibname{} in the .bib file.
%
% Change \cvownfamilyname if the CV owner's name changes.
%------------------------------------------------------------------------------
\def\cvownfamilyname{Hakimi}
%------------------------------------------------------------------------------
% MENTEE LIST — auto-marks listed surnames in author lists with \cvfnmark{mentee}.
%
% Comma-separated. Surname-only matching (case-sensitive, exact word). Hyphenated
% surnames are fine. KEEP ON ONE LINE — line breaks inside the list become spaces
% and break matching.
%
% Surnames not on this list:
% - Wang: collides with non-mentee co-authors Wang, S. (Wang2016autism) and
% Wang, C. (Hakimi2020snbf). Mentee Ashley Wang has no current co-authored
% pubs; if she does, hand-mark her name via usera with \cvfnmark{mentee}.
%
% Note: usera fields bypass the name formatter, so manually add \cvfnmark{mentee}
% to mentee names in any usera string.
%------------------------------------------------------------------------------
\newcommand{\cvmentees}{Nath,Nandy,Madden-Rusnak,Sinclair,Wright,Hsiung,Vu,Jung,Christiano,Eom,Muzekari,Jiang,Shrestha,Thorp,Parelman,George,Som,Firuz,Zhou,Lakshmanan,Ouyang,Candelora,Fulford,Gupta,Tseng,Geisman,Chandrashekharan,Morfin,Paniagua,Stella}
% \cvtestmentee{<surname-macro>}: emit \cvfnmark{mentee} if the macro's
% expansion exactly matches one of the comma-separated items in \cvmentees.
% Iterates with \@for and uses \ifx (which compares macro replacement text)
% so the test is exact-string equality, not substring.
\makeatletter
\newcommand{\cvtestmentee}[1]{%
\def\cv@menteefound{0}%
\@for\cv@menteeitem:=\cvmentees\do{%
\edef\cv@menteeitemexp{\cv@menteeitem}%
\ifx\cv@menteeitemexp#1%
\def\cv@menteefound{1}%
\fi
}%
\ifnum\cv@menteefound=1 \cvfnmark{mentee}\fi
}
\makeatother
% Redefine the 'default' name format (used by all numeric-style entries via
% the sortname alias) to bold the CV owner's name.
\AtBeginDocument{%
% Redefine the 'default' name format to bold the CV owner's name.
% Must be in \AtBeginDocument so it fires after biblatex and numeric.bbx
% have finished setting their own defaults.
%
% Comparison technique: \ifstrequal does NOT expand its arguments (it
% compares literal token streams, not string values). \namepartfamily and
% \cvownfamilyname are macros, so we \edef both into plain temporaries
% first, then use \ifx — which compares macro replacement texts — to
% get a reliable string equality test.
\DeclareNameFormat{default}{%
\edef\cvboldtmpA{\namepartfamily}%
\edef\cvboldtmpB{\cvownfamilyname}%
\ifx\cvboldtmpA\cvboldtmpB
% Print delimiter OUTSIDE the bold wrapper, then bold just the name.
% name:family-given includes name:delim internally, so we call
% name:delim first here, then replicate the name output inside cvbibname.
\usebibmacro{name:delim}{\namepartfamily}%
\cvbibname{%
\mkbibnamefamily{\namepartfamily}\isdot
\ifdefvoid{\namepartgiveni}{}{\revsdnamepunct\bibnamedelimd\mkbibnamegiven{\namepartgiveni}\isdot}%
}%
\else
\usebibmacro{name:family-given}{\namepartfamily}{\namepartgiveni}%
{\namepartprefix}{\namepartsuffix}%
% Mentee marker: append \cvfnmark{mentee} if surname is in \cvmentees.
\cvtestmentee{\cvboldtmpA}%
\fi
\usebibmacro{name:andothers}%
}%
}
% NOTE: entries using the `usera` field bypass the name formatter entirely.
% Bold your name manually there using \cvbibname{}, e.g.:
% usera = {\cvbibname{Hakimi,~S}\cvfnmark{equalcontrib}, ...}
%------------------------------------------------------------------------------
% CUSTOM AUTHOR STRING — uses built-in `usera` field
%
% For entries with equal-contribution authors or other non-standard author
% formatting, set the `usera` field in the .bib file to a pre-formatted
% LaTeX string. Biber always passes `usera` through as a literal (no parsing).
%
% Use \cvbibname{} (not \textbf{}) for bold names — it uses \bfseries which
% works reliably in Awesome-CV's fontspec context. Use ~ for spaces inside
% name initials, e.g. "Hakimi,~S" to prevent TeX from dropping the space.
%
% Example:
% usera = {\cvbibname{Hakimi,~S}\cvfnmark{equalcontrib}, Lee,~J\cvfnmark{equalcontrib}},
%
% When `usera` is present it replaces the normal \printnames{author} output.
% When absent, \printnames{author} runs normally (with default format applied).
%------------------------------------------------------------------------------
% \cvbibname: bold name for usera fields and the default name format.
% Keeps \sffamily (matching bib body font) but forces series b (Bold),
% overriding the \fontseries{l} (Light) set by \bodyfontlight.
\newcommand{\cvbibname}[1]{{\sffamily\bfseries #1}}
\DeclareFieldFormat{usera}{#1}
% Addendum styling: new line + italic for non-patent entries (Best Paper, SciComm note).
% For patents, addendum holds "Granted"/"Filed" — used only for filtering, not display.
\DeclareFieldFormat[patent]{addendum}{}
\DeclareFieldFormat{addendum}{\newline\textit{#1}}
\renewbibmacro*{author}{%
\iffieldundef{usera}{%
\printnames{author}%
}{%
\printfield{usera}%
}%
}
% Note: the note field prints normally for all entry types.
% Equal-contribution markers should be in the authorlist field (via \cvfnmark),
% NOT in the note field. See journals.bib and conference.bib for examples.
% Entries with note = {* equal contributions...} should have that note removed.
\addbibresource{refs/journals.bib}
\addbibresource{refs/preprints.bib}
\addbibresource{refs/conference.bib}
\addbibresource{refs/chapters.bib}
\addbibresource{refs/patents.bib}
\addbibresource{refs/scicomm.bib}
\addbibresource{refs/presentations.bib}
\nocite{*} % include all entries from all .bib files
%------------------------------------------------------------------------------
% \cvsubsection — patched for consistent leading spacing.
%
% Design:
% R1. \cvsection above gap: unchanged (\acvSectionTopSkip = 7mm, cls default).
% R2a. FIRST \cvsubsection after \cvsection: \cvsubsectionAfterSectionGap
% (larger) — gives breathing room under the section rule before the
% first subsection content begins.
% R2b. \cvsubsection in any other context (sibling subsection after content,
% after \end{cvparagraph}, after biblatex bibliography end, etc.):
% \cvsubsectionGap (smaller, uniform).
% R3. EXCEPTION: \cvsubsection following \cvpublegend uses
% \cvsubsectionAfterLegend (tight tuck). The legend is visually part
% of the section heading block (sits under the rule), so the next
% subsection tucks under it instead of taking the After-Section gap.
% R4. \cvsubsubsection above gap: 3pt (defined in \cvsubsubsection itself,
% unchanged).
%
% Implementation: \par\removelastskip wipes whatever trailing glue the
% previous element left (cvsection rule's \parskip, cvparagraph's
% \vspace{2mm}, biblatex's pre-heading glue), then \vspace writes the
% correct gap for the current context.
%
% Awesome-CV's default \cvsubsection (cls) does:
% \vspace{2.5mm} + \vspace{-3mm} + text → net -0.5mm
% We patch only the leading skip; the cls's existing vspaces remain.
%------------------------------------------------------------------------------
% Hierarchy: end-of-section (\acvSectionTopSkip=10mm above) > begin-of-section
% (\cvsubsectionAfterSectionGap=18pt~6.4mm) > within-section
% (\cvsubsectionGap=14pt~5mm). Each gap should be visibly distinct from the
% next so the document's vertical rhythm signals section structure at a glance.
\newcommand{\cvsubsectionGap}{14pt}
\newcommand{\cvsubsectionAfterSectionGap}{18pt}
\newcommand{\cvsubsectionAfterLegend}{2pt}
%------------------------------------------------------------------------------
% PAGE-BREAK STYLE RULES (keepCitationsWhole / keepHeadingsWithContent)
%
% R5. A bibliography entry is never split across a page break; a would-be
% split entry moves whole to the top of the next page.
% R6. A heading is never stranded at the foot of a page without its content.
%
% Declared here (before \input{cv-preset}) so a preset can switch it off --
% e.g. if a page-count ceiling ever matters more than the ragged bottom the
% rule creates.
% R5 and R6 are independent toggles: R5 is free (it never changed a page
% count in any preset), while R6 can push content onto a new page. Splitting
% them lets a page-constrained preset keep split-prevention and drop only the
% heading guard -- config/speaking.tex does exactly that.
\newtoggle{keepCitationsWhole}
\toggletrue{keepCitationsWhole}
\newtoggle{keepHeadingsWithContent}
\toggletrue{keepHeadingsWithContent}
% Space a heading must have below it, or it moves to the next page. Sized as
% "heading + its first two lines of content".
\newcommand{\cvsectionNeed}{9\baselineskip}
\newcommand{\cvsubsectionNeed}{4\baselineskip}
\newcommand{\cvsubsubsectionNeed}{3\baselineskip}
% \cvsubsubsection labels sit 2.18pt left of their parent \cvsubsection because
% \subsectionstyle's 12pt \scshape carries a left pen offset that the 9pt
% italic sub-label does not. Measured from the built PDF (word-level bboxes):
% cvsection/cvsubsubsection land at x=39.69, cvsubsection at x=41.87. This
% length re-aligns the sub-label to its parent heading. Re-measure if
% \subsectionstyle or the body font changes.
\newlength{\cvsubsubsectionIndent}
\setlength{\cvsubsubsectionIndent}{2.18pt}
\newbool{cvafterlegend}
\boolfalse{cvafterlegend}
\newbool{cvprevwassection}
\boolfalse{cvprevwassection}
\apptocmd{\cvsection}{\global\booltrue{cvprevwassection}}{}{}
% R6: a heading must not be stranded at the foot of a page without its
% content. \pretocmd (not a redefinition) so the tuned bodies of these macros
% -- and the cvprevwassection bookkeeping above -- are left exactly as they
% are; the guard runs before any of their vspace does. \needspace only acts
% near a page boundary, so ordinary inter-section spacing is untouched.
% \cvsubsubsection is defined further down this file, so it is NOT patched
% here -- its guard is inline in its own definition. The failure branches
% below raise an error rather than failing silently: a \pretocmd that quietly
% no-ops would leave the rule looking applied while doing nothing.
% The toggle is tested INSIDE the injected code, not around the \pretocmd:
% \input{cv-preset} runs near the end of this file, so a preset's
% \togglefalse must be read when the heading is typeset, not when the patch
% is installed. (Installing the patch from \AtBeginDocument instead does not
% work -- verified: a 30\baselineskip guard changed nothing.)
\pretocmd{\cvsection}%
{\iftoggle{keepHeadingsWithContent}{\needspace{\cvsectionNeed}}{}}{}%
{\PackageError{cv}{R6: could not patch \string\cvsection}{}}%
\pretocmd{\cvsubsection}%
{\iftoggle{keepHeadingsWithContent}{%
% A subsection immediately after a section is already covered by
% \cvsectionNeed. Re-guarding here would let the child break away and
% strand its parent at the foot of the page.
\ifbool{cvprevwassection}{}{\needspace{\cvsubsectionNeed}}%
}{}}{}%
{\PackageError{cv}{R6: could not patch \string\cvsubsection}{}}
% Priority: cvafterlegend > cvprevwassection > default.
% Each branch clears all flags so subsequent cvsubsections fall through to
% the default sibling gap.
\patchcmd{\cvsubsection}%
{\vspace{\acvSectionContentTopSkip}}%
{\par\removelastskip
\ifbool{cvafterlegend}{%
\vspace{\cvsubsectionAfterLegend}%
\global\boolfalse{cvafterlegend}\global\boolfalse{cvprevwassection}%
}{%
\ifbool{cvprevwassection}{%
\vspace{\cvsubsectionAfterSectionGap}%
\global\boolfalse{cvprevwassection}%
}{%
\vspace{\cvsubsectionGap}%
}%
}%
\noindent\vspace{\acvSectionContentTopSkip}}%
{}{}
\defbibheading{cvsubsection}[\bibname]{%
\cvsubsection{#1}%
}
%------------------------------------------------------------------------------
% \cvsubsubsection — lightweight label one level below \cvsubsection.
% Used to group entries inside a combined cvsubsection (e.g. Commentaries
% and Book Chapters under "Reviews, Book Chapters & Commentaries").
% Style matches \cvpublegend: 9pt italic Roboto-Regular, on its own line —
% deliberately smaller than cvsubsection (12pt smallcaps) so the sub-label
% reads as subordinate rather than competing with the umbrella heading.
%------------------------------------------------------------------------------
\newcommand{\cvsubsubsection}[1]{%
% \removelastskip eats biblatex's pre-heading glue so the label
% lands tight (≈3pt) above its content — the label is meant to read
% as a compact divider, not a section break.
\par\removelastskip%
\iftoggle{keepHeadingsWithContent}{\needspace{\cvsubsubsectionNeed}}{}%
\vspace{3pt}%
\hspace*{\cvsubsubsectionIndent}%
{\bodyfont\fontsize{9pt}{1em}\selectfont\textit{#1}}%
\par\vspace{-3pt}%
}
\defbibheading{cvsubsubsection}[\bibname]{%
\cvsubsubsection{#1}%
}
%------------------------------------------------------------------------------
% BIBLATEX CUSTOM CHECKS — patent status × selected toggle
%------------------------------------------------------------------------------
% Exclude entries tagged keyword=presentation from preprints section
\defbibcheck{notpresentation}{%
\ifkeyword{presentation}{\skipentry}{}%
}
% Exclude entries tagged keyword=commentary from the journals section --
% they render under "Reviews, Book Chapters & Commentaries" instead.
\defbibcheck{notcommentary}{%
\ifkeyword{commentary}{\skipentry}{}%
}
% Empty heading used when a \printbibliography continues under an existing
% section heading (e.g. commentary articles under Book Chapters).
\defbibheading{none}{}
% AND filter: keyword=presentation AND keyword=selected
% (multiple keyword= in \printbibliography is OR; this enforces AND)
\defbibcheck{presentationselected}{%
\ifkeyword{presentation}{%
\ifkeyword{selected}{}{\skipentry}%
}{\skipentry}%
}
\defbibcheck{grantedpatents}{%
\ifentrytype{patent}{%
\iffieldequalstr{addendum}{Granted}{}{\skipentry}%
}{\skipentry}%
}
\defbibcheck{grantedpatentsselected}{%
\ifentrytype{patent}{%
\iffieldequalstr{addendum}{Granted}{%
\ifkeyword{selected}{}{\skipentry}%
}{\skipentry}%
}{\skipentry}%
}
\defbibcheck{filedpatents}{%
\ifentrytype{patent}{%
\iffieldequalstr{addendum}{Filed}{}{\skipentry}%
}{\skipentry}%
}
\defbibcheck{filedpatentsselected}{%
\ifentrytype{patent}{%
\iffieldequalstr{addendum}{Filed}{%
\ifkeyword{selected}{}{\skipentry}%
}{\skipentry}%
}{\skipentry}%
}
%------------------------------------------------------------------------------
% PATENT PRINT COMMAND
%------------------------------------------------------------------------------
% Each subsection (Granted, Filed) gets its own \startbibsection scope so
% \cvbibindex restarts at [1] per subsection — Filed should not continue
% numbering where Granted left off.
\newcommand{\printpatents}{%
\ifthenelse{\equal{\patentMode}{none}}{%
% Print nothing
}{%
\ifthenelse{\equal{\patentMode}{granted}}{%
\startbibsection{patents-granted}%
\ifthenelse{\equal{\patentFilter}{selected}}{%
\leavevmode\printbibliography[check=grantedpatentsselected,
title={Granted},
heading=cvsubsection]%
}{%
\leavevmode\printbibliography[check=grantedpatents,
title={Granted},
heading=cvsubsection]%
}%
\finishbibsection{patents-granted}%
}{%
% All (granted + filed) — separate counter scope per subsection
\startbibsection{patents-granted}%
\ifthenelse{\equal{\patentFilter}{selected}}{%
\leavevmode\printbibliography[check=grantedpatentsselected,
title={Granted},
heading=cvsubsection]%
}{%
\leavevmode\printbibliography[check=grantedpatents,
title={Granted},
heading=cvsubsection]%
}%
\finishbibsection{patents-granted}%
\startbibsection{patents-filed}%
\ifthenelse{\equal{\patentFilter}{selected}}{%
\leavevmode\printbibliography[check=filedpatentsselected,
title={Filed},
heading=cvsubsection]%
}{%
\leavevmode\printbibliography[check=filedpatents,
title={Filed},
heading=cvsubsection]%
}%
\finishbibsection{patents-filed}%
}%
}%
}
%==============================================================================
% TOGGLES — SECTION VISIBILITY
%==============================================================================
\newtoggle{showJournals}
\newtoggle{showPreprints}
\newtoggle{showConferenceProceedings}
\newtoggle{showPatents}
\newtoggle{showSciComm}
\newtoggle{showBookChapters}
\newtoggle{showTalks}
\newtoggle{showConferencePresentations}
\newtoggle{showTeaching}
\newtoggle{showService}
\newtoggle{showReviewer}
\newtoggle{showGrants}
\newtoggle{showMentorship}
\newtoggle{showMemberships}
\newtoggle{showReferences}
\newtoggle{showFullReferences}
\newtoggle{showFullCVNote} % true = closing "Full CV available upon request."
\toggletrue{showJournals}
\toggletrue{showPreprints}
\toggletrue{showConferenceProceedings}
\toggletrue{showPatents}
\toggletrue{showSciComm}
\toggletrue{showBookChapters}
\toggletrue{showTalks}
\toggletrue{showConferencePresentations}
\toggletrue{showTeaching}
\toggletrue{showService}
\toggletrue{showReviewer}
\toggletrue{showGrants}
\toggletrue{showMentorship}
\toggletrue{showMemberships}
\toggletrue{showReferences}
\togglefalse{showFullReferences} % false = "Available upon request"
\togglefalse{showFullCVNote} % true = closing "Full CV available upon request." (industry/speaking presets)
%==============================================================================
% TOGGLES — PUBLICATION FILTERS
%==============================================================================
\newtoggle{selectedOnlyPublications} % true = "Selected Publications" section title
\newtoggle{selectedOnlyPatents} % true = "Selected Patents" section title
\newtoggle{selectedOnlyJournals}
\newtoggle{selectedOnlyConferenceProceedings}
\newtoggle{selectedOnlyPreprints}
\newtoggle{selectedOnlyPresentations}
\newtoggle{selectedOnlyService} % true = "Selected Professional Service \& Outreach"
\togglefalse{selectedOnlyPublications} % true = "Selected Publications" heading
\togglefalse{selectedOnlyPatents} % true = "Selected Patents" heading (mirrors patentFilter)
\togglefalse{selectedOnlyJournals}
\togglefalse{selectedOnlyConferenceProceedings}
\togglefalse{selectedOnlyPreprints}
\togglefalse{selectedOnlyService}
\toggletrue{selectedOnlyPresentations}
%------------------------------------------------------------------------------
% PATENT DISPLAY MODE
%
% \def\patentMode{none} → omit patents section entirely
% \def\patentMode{granted} → show granted patents only
% \def\patentMode{all} → show granted + filed patents
%
% \def\patentFilter{selected} → only entries with keywords={selected}
% \def\patentFilter{all} → all entries regardless of keyword
%------------------------------------------------------------------------------
\def\patentMode{granted} % none | granted | all
\def\patentFilter{selected} % selected | all
%==============================================================================
% TOGGLES — SECTION DEPTH
%==============================================================================
\newtoggle{showAllGrants}
\newtoggle{showAllTalks}
\newtoggle{showAllTeaching}
\newtoggle{showAllService}
\togglefalse{showAllGrants}
\togglefalse{showAllTalks}
\togglefalse{showAllTeaching}
\togglefalse{showAllService}
% Load preset overrides (must come after all \newtoggle/\def declarations).
\input{cv-preset}
% First-pass guard: skip all \printbibliography calls until the .bbl exists.
% This prevents xelatex from crashing before biber has run, which would
% produce a malformed .bcf that biber then refuses to process.
\newif\ifbblexists
\IfFileExists{\jobname.bbl}{\bblexiststrue}{\bblexistsfalse}
% Wrap \printbibliography to be a no-op on the first pass
\let\origprintbibliography\printbibliography
\renewcommand{\printbibliography}[1][]{%
\ifbblexists\origprintbibliography[#1]\fi%
}
% Note: \leavevmode before each \printbibliography ensures LaTeX is in
% horizontal mode, preventing \spacefactor crashes from biblatex warnings.
%------------------------------------------------------------------------------
% AWESOME-CV CONFIGURATION
%------------------------------------------------------------------------------
\geometry{left=1.4cm, top=.8cm, right=1.4cm, bottom=1.8cm, footskip=.5cm}
\colorlet{awesome}{black}
\colorlet{darktext}{black}
\setbool{acvSectionColorHighlight}{false}
% The cls loads the parskip package, which sets \parskip to ~0.5\baselineskip.
% Awesome-CV uses explicit \vspace{} calls for all spacing, so parskip just
% adds unwanted gaps between paragraphs (e.g. around \cvsubsection headings).
% Override to zero globally.
\setlength{\parskip}{0pt}
% Inter-section breathing room (cls default: 3mm). Sized to be the
% LARGEST vertical gap in the document — the hierarchy:
% end-of-section (this) > beginning-of-section (\cvsubsectionAfterSectionGap)
% > within-section (\cvsubsectionGap)
\renewcommand{\acvSectionTopSkip}{10mm}
% Enforce consistent vertical spacing between \cventry blocks.
%
% Root cause of the indent bug: \apptocmd{\cventry}{\vspace{N}} appends a
% \vspace after the tabular. Inside \begin{center}, this leaves a vertical-mode
% artefact that makes the NEXT \cventry's tabular shift right. Using \pretocmd
% instead — and skipping the gap for the first entry in each block — avoids
% any post-tabular state and keeps all entries flush-left.
%
% Gap value: 0pt — the natural tabular bottom-padding (~15pt) provides
% sufficient visual separation between entries. Any positive value here adds
% on top of that and makes gaps too large in dense sections like Teaching/Service.
\newbool{firstcventry}
\newbool{prevhaddesc}
\booltrue{firstcventry}
\boolfalse{prevhaddesc}
\AtBeginEnvironment{cventries}{%
\booltrue{firstcventry}%
\boolfalse{prevhaddesc}%
\setlength{\parskip}{0pt}%
\setlength{\parindent}{0pt}%
}
% Tighten the leading on \cventry's position field (1st argument, e.g. talk
% quotes) when it wraps to a second line.
%
% \baselineskip governs interline glue, which TeX inserts when the array
% column's internal \par runs — that happens AFTER \entrypositionstyle's own
% brace group has already closed, so a \baselineskip assignment made inside
% that group (even via \fontsize's 2nd argument) is discarded before it can
% take effect. Font size/color don't have this problem because glyphs are
% rendered immediately, per character, not deferred to \par-time.
% Workaround: assign \baselineskip globally here, then reset it globally back
% to the document default at the start of every \cventry (below) — title
% always runs before position within a single \cventry, so the reset always
% happens before the next wrapped title is typeset.
\newlength{\cvdefaultbaselineskip}
\AtBeginDocument{\setlength{\cvdefaultbaselineskip}{\baselineskip}}
\renewcommand*{\entrypositionstyle}[1]{{\global\baselineskip=7pt\relax\fontsize{8pt}{1em}\selectfont\bodyfont\scshape\color{graytext} #1}}
% Before each \cventry: add the right vertical gap based on context.
% - First entry in a cventries block: no leading gap.
% - Previous entry had bullets (cvitems): \cvgapAfterBullets — clears the
% bullet content which extends below the tabular's measured height.
% - Plain entry → plain entry: \cvgapPlain — matches cls default.
\newcommand{\cvgapPlain}{8pt}
\newcommand{\cvgapAfterBullets}{10pt}
\pretocmd{\cventry}{%
\global\baselineskip=\cvdefaultbaselineskip\relax
\ifbool{firstcventry}{%
\boolfalse{firstcventry}%
}{%
\ifbool{prevhaddesc}{%
\vspace{\cvgapAfterBullets}%
}{%
\vspace{\cvgapPlain}%
}%
}%
\boolfalse{prevhaddesc}%
\noindent%
}{}{}
% After each \cventry: record whether arg #5 was non-empty (had description).
% We can't inspect #5 directly in apptocmd, so we patch cvitems end instead.
\AtEndEnvironment{cvitems}{\booltrue{prevhaddesc}}
% cvitems: bullet block inside a \cventry's 5th argument (description cell).
%
% Opening \vspace pulls bullets up close to the entry's position line.
% Closing \vspace inflates the cell so its measured bottom matches where
% the bullets actually end — without it, bullet content overflows the
% tabular row and the next entry's header overlaps it. \cvgapAfterBullets
% in pretocmd handles inter-entry breathing room on top of that.
\renewenvironment{cvitems}{%
\vspace{-3.0mm}%
\begin{justify}%
\begin{itemize}[leftmargin=2.5em, nosep, noitemsep]%
\setlength{\parskip}{0pt}%
\renewcommand{\labelitemi}{\bullet}%
}{%
\end{itemize}%
\end{justify}%
\vspace{2mm}%
}
%------------------------------------------------------------------------------
% PERSONAL INFO
%------------------------------------------------------------------------------
% Make the full name bold by overriding the first-name style to match the
% last-name style (both use \headerfont\bfseries).
\renewcommand*{\headerfirstnamestyle}[1]{{\fontsize{28pt}{1em}\headerfont\bfseries\color{text} #1}}
\name{Shabnam}{Hakimi, Ph.D.}
% \position{Behavioral Science | Computational Neuroscience | Human-Centered AI}
% \position{Senior Research Scientist{\enskip\cdotp\enskip}Human-Centered AI}
% \address{Toyota Research Institute, 4440 El Camino Real, Los Altos, CA 94022}
\email{mail@shabnamhakimi.com}
\homepage{www.shabnamhakimi.com}
\github{shabtastic}
\linkedin{shabnam-hakimi-phd}
\orcid{0000-0003-4122-6041}
%------------------------------------------------------------------------------
% DOCUMENT
%------------------------------------------------------------------------------
\begin{document}
\makecvheader[C]
\makecvfooter
{\today}
{Shabnam Hakimi ~~·~~ Curriculum Vitae}
{\thepage}
%------------------------------------------------------------------------------
% SECTIONS
%------------------------------------------------------------------------------
\input{sections/education}
\input{sections/experience}
\iftoggle{showGrants}{\input{sections/grants}}{}
%-- Publications --------------------------------------------------------------
% Top-level heading: "Publications" or "Selected Publications"
% Subsections: Journals · Preprints · Conference Proceedings ·
% Conference Presentations · Book Chapters
%
% Toggle \toggletrue{selectedOnlyPublications} to switch the section title.
% Individual subsection selected-only filters remain independent.
\newbool{showPublications}
\boolfalse{showPublications}
\iftoggle{showJournals}{\booltrue{showPublications}}{}
\iftoggle{showPreprints}{\booltrue{showPublications}}{}
\iftoggle{showConferenceProceedings}{\booltrue{showPublications}}{}
\iftoggle{showConferencePresentations}{\booltrue{showPublications}}{}
\iftoggle{showBookChapters}{\booltrue{showPublications}}{}
\iftoggle{showSciComm}{\booltrue{showPublications}}{}
\ifbool{showPublications}{%
\iftoggle{selectedOnlyPublications}{%
\cvsection{Selected Publications}%
}{%
\cvsection{Publications}%
}%
\cvpublegend%
\iftoggle{showJournals}{%
\startbibsection{journals}%
\iftoggle{selectedOnlyJournals}{%
\leavevmode\printbibliography[type=article, keyword=selected,
check=notcommentary,
title={Peer-Reviewed Journal Publications (Selected)},
heading=cvsubsection]%
}{%
\leavevmode\printbibliography[type=article,
check=notcommentary,
title={Peer-Reviewed Journal Publications},
heading=cvsubsection]%
}%
\finishbibsection{journals}%
}{}
\iftoggle{showPreprints}{%
\startbibsection{preprints}%
\iftoggle{selectedOnlyPreprints}{%
\leavevmode\printbibliography[type=unpublished, keyword=selected,
check=notpresentation,
title={Preprints \& Working Papers (Selected)},
heading=cvsubsection]%
}{%
\leavevmode\printbibliography[type=unpublished,
check=notpresentation,
title={Preprints \& Working Papers},
heading=cvsubsection]%
}%
\finishbibsection{preprints}%
}{}
\iftoggle{showConferenceProceedings}{%
\startbibsection{conference}%
\iftoggle{selectedOnlyConferenceProceedings}{%
\leavevmode\printbibliography[type=inproceedings, keyword=selected,
title={Peer-Reviewed Conference Proceedings (Selected)},
heading=cvsubsection]%
}{%
\leavevmode\printbibliography[type=inproceedings,
title={Peer-Reviewed Conference Proceedings},
heading=cvsubsection]%
}%
\finishbibsection{conference}%
}{}
\iftoggle{showConferencePresentations}{%
\startbibsection{presentations}%
\iftoggle{selectedOnlyPresentations}{%
% Use a bibcheck for AND logic (keyword=presentation AND keyword=selected),
% since multiple keyword= filters in \printbibliography are OR not AND.
\leavevmode\printbibliography[check=presentationselected,
title={Selected Conference Presentations},
heading=cvsubsection]%
}{%
\leavevmode\printbibliography[keyword=presentation,
title={Conference Presentations},
heading=cvsubsection]%
}%
\finishbibsection{presentations}%
}{}
\iftoggle{showBookChapters}{%
\startbibsection{bookchapters}%
% Umbrella cvsubsection heading printed once via \printbibheading
% (biblatex's heading-only entry point). It routes through
% \defbibheading{cvsubsection} -> \cvsubsection, which the patched
% \cvsubsection treats like any other cvsubsection: \cvsubsectionGap
% uniform leading space, applied via \removelastskip + \vspace.
% \cvsubsubsection labels group the two entry types below it.
% Commentary articles (e.g. AI Magazine, newsletters) are tagged
% keywords={commentary} in refs/chapters.bib; book chapters are
% @incollection. Commentaries come first so the section reads
% newest-first (matching the rest of the CV).
\printbibheading[heading=cvsubsection,
title={Reviews, Book Chapters \& Commentaries}]%
\leavevmode\printbibliography[type=article, keyword=commentary,
title={Commentaries},
heading=cvsubsubsection]%
\leavevmode\printbibliography[type=incollection,
title={Book Chapters},
heading=cvsubsubsection]%
\finishbibsection{bookchapters}%
}{}
% Science Communication — always at end of Publications section
\iftoggle{showSciComm}{%
\startbibsection{scicomm}%
\leavevmode\printbibliography[type=misc, keyword=scicomm,
title={Science Communication},
heading=cvsubsection]%
\finishbibsection{scicomm}%
}{}%
}{}
%-- Patents -------------------------------------------------------------------
\iftoggle{showPatents}{%
\ifthenelse{\equal{\patentMode}{none}}{}{%
\iftoggle{selectedOnlyPatents}{%
\cvsection{Selected Patents}%
}{%
\cvsection{Patents}%
}%
% \startbibsection / \finishbibsection now live inside \printpatents