-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemuserutils.sty
More file actions
101 lines (85 loc) · 2.67 KB
/
emuserutils.sty
File metadata and controls
101 lines (85 loc) · 2.67 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
% --------------------------------
% Utilities for emuser.tex
% License: GNU GPLv3
% Copyright 2023
% https://github.com/quinnouyang/emuser
% --------------------------------
\usepackage{titlesec}
\usepackage{tabularx}
\usepackage{enumitem}
\usepackage{fancyhdr}
\usepackage{bookmark}
\usepackage{xparse}
\usepackage{etoolbox}
\usepackage{accsupp}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\pagenumbering{gobble}
\setlength\parindent{0pt}
\hypersetup{colorlinks=true, urlcolor=blue}
\titleformat{\section}{\scshape \LARGE}{}{0pt}{}[\titlerule \vspace{0.1\baselineskip}]
\newenvironment{lrColumns}
{\large \tabularx{\textwidth}{@{} >{\raggedright\arraybackslash}X >{\hfill} l @{}}}{\endtabularx}
\newenvironment{lcrColumns}
{\large \tabularx{\textwidth}{@{} >{\raggedright\arraybackslash}X c >{\raggedleft\arraybackslash}X @{}}}
{\endtabularx}
\newcommand{\bulletStyle}{}
\newcommand{\setBulletStyle}[1]{
\renewcommand{\bulletStyle}{#1}
}
\newlength{\sectionSpacing}
\newcommand{\setSectionSpacing}[1]{
\setlength{\sectionSpacing}{#1} % Spacing between items
\titlespacing\section{0pt}{\sectionSpacing}{\sectionSpacing} % Top and bottom margins of header
}
\newcommand{\setBulletsSpacing}[1]{
\setlist{nosep, itemsep={#1}, topsep={#1}, partopsep={#1}}
}
\newcommand{\alttext}[2]
{\BeginAccSupp{method=pdfstringdef,ActualText={#2}}#1\EndAccSupp{}}
% Huge Bold ... Normal
\newcommand{\lrHeader}[2]{
\alttext
{\begin{lrColumns}
\Huge\textbf{#1} & #2
\end{lrColumns}
\vspace{-2\sectionSpacing}
\relax}
{#1 #2}
}
% Bold ... Italicized (if optional text specified, otherwise: Normal)
% Italicized ... Normal (optional)
% Italicized ... Normal (optional)
\NewDocumentCommand{\lr}{m m O{} O{} O{} O{}}{
\alttext
{\begin{lrColumns}
\ifblank{#3}{\textbf{#1} & #2 \\}{\textbf{#1} & \textit{#2} \\}
\ifblank{#3}{}{\textit{#3} & #4 \\}
\ifblank{#5}{}{\textit{#5} & #6 \\}
\end{lrColumns}}
{#1 #2 #3 #4 #5 #6}
}
% Bold ... Italicized ... Normal
\newcommand{\lcr}[3]{
\alttext
{\begin{lcrColumns}
\textbf{#1} & \textit{#2} & #3
\end{lcrColumns}}
{#1 #2 #3}
}
\newcommand{\labeled}[2]{
{\textbf{#1}{: #2}}
}
\NewDocumentEnvironment{bullets}{O{\bulletStyle}}
{\begin{itemize}[label={#1}, leftmargin=1.5em]}{\end{itemize}}
\newenvironment{nobullets}
{\begin{itemize}[label={}, leftmargin=0pt]}{\end{itemize}}
\newenvironment{sectionList}[1]
{\begin{nobullets}\setlength\itemsep{\sectionSpacing} \section{#1}}{\end{nobullets}}
\newcommand{\dateFooter}{
\setlength{\footskip}{1.5\baselineskip}
\alttext
{\lfoot{\small{Rev. \today}}}
{}
}