-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathomg.sty
More file actions
191 lines (160 loc) · 5.88 KB
/
omg.sty
File metadata and controls
191 lines (160 loc) · 5.88 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
\ProvidesPackage{omg}
%% Basic formatting for Object Management Group documents
%% Fine tuning of margins
\newlength{\myparindent}
\setlength{\myparindent}{0.5in}
% start with equal margins
\newlength{\margins}
\setlength{\margins}{1.25in}
% left = 1.25in + \myparindent
\newlength{\newleft}
\setlength{\newleft}{\margins}
\addtolength{\newleft}{1\myparindent}
\usepackage[letterpaper, tmargin=1in, bmargin=1in, left=1\newleft, right=\margins, marginpar=1in]{geometry}
%% Control indenting of paragraphs and headers
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{enumitem}
\usepackage{ragged2e}
\usepackage[colorlinks=true,urlcolor=cyan,linkcolor=blue,linktoc=page]{hyperref}
%% Draft watermark
\usepackage{everypage}
\usepackage{draftwatermark}
% See RFP_UserPreamble.tex to turn off
%% Control fonts
%% Use Helvetica font for titles
\usepackage[scaled]{helvet}
\renewcommand\familydefault{\sfdefault}
\usepackage[T1]{fontenc}
%% Use Times font for body
\usepackage{times}
%% IPR handling
\usepackage{ifthen}
%% Make appendix have same numbering as other sections
\usepackage[title]{appendix}
%% The following items are *ONLY* for the red italic notes in stub text
\usepackage{textcomp}
\usepackage{color}
% For future use with Jira and auto changebar doc production
\usepackage{changebar}
\usepackage{marginnote}
% \adjustwidth
\usepackage{changepage}
%% Set header offsets and styles
\usepackage[raggedright]{titlesec}
\titlespacing\section{-1\myparindent}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
\titlespacing\subsection{-1\myparindent}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
\titlespacing\subsubsection{-1\myparindent}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
\titlespacing\paragraph{-1\myparindent}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
% show paragraph numbering
\setcounter{secnumdepth}{8}
% Paragraph titles are italicized
\titleformat{\section}{\sffamily\Large\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}{\sffamily\large\bfseries}{\thesubsection}{1em}{}
\titleformat{\subsubsection}{\sffamily\normalsize\bfseries}{\thesubsubsection}{1em}{}
\titleformat{\paragraph}{\itshape}{\theparagraph}{0.75em}{}
\usepackage{xspace}
\newcommand{\setvalue}[2]{
\ifdefined #1
\renewcommand{#1}{#2\xspace}
\else
\newcommand{#1}{#2\xspace}
\fi
}
% Requirement and subrequirement sections for 6.5
\usepackage{titletoc}
\titleclass{\requirement}{straight}[\subsection]
\newcounter{requirement}[subsection]
\setvalue{\reqlabel}{REQ}
\titleformat{\requirement}
{\sffamily\normalsize\bfseries}{}{0em}{\reqlabel \therequirement:~}
\titlespacing*{\requirement}{-1\myparindent}{0pt}{0pt}
\newcommand{\requirementautorefname}{requirement}
\titlecontents{requirement}[0pt]{}{}{}{}
\titleclass{\subrequirement}{straight}[\requirement]
\newcounter{subrequirement}[requirement]
\setvalue{\subreqlabel}{REQ}
\titleformat{\subrequirement}
{\sffamily\normalsize\bfseries\itshape}{}{0em}{\subreqlabel \therequirement.\thesubrequirement:~}
\titlespacing*{\subrequirement}{0pt}{0pt}{0pt}
\newcommand{\subrequirementautorefname}{subrequirement}
\titlecontents{subrequirement}[0pt]{}{}{}{}
%% New parameters to fill in by automated tooling
\newcommand{\REPLACEME}[1]{\textit{\color{red}#1}}
\setvalue{\specname}{\REPLACEME{Specification Name Placeholder}}
\setvalue{\specacro}{\REPLACEME{Placeholder}}
\setvalue{\docnum}{\REPLACEME{<taskforce>/YY-MM-NN}}
\setvalue{\loidue}{\REPLACEME{<day><month><year>}}
\setvalue{\subdue}{\REPLACEME{<day><month><year>}}
\setvalue{\votereg}{\REPLACEME{<day><month><year>}}
\setvalue{\subpres}{\REPLACEME{<day><month><year>}}
\setvalue{\rsubdue}{\REPLACEME{<day><month><year>}}
\setvalue{\rsubpres}{\REPLACEME{<day><month><year>}}
%% for IPR mode
\setvalue{\iprmode}{}
\title{\REPLACEME{<Title>}}
%% No indent on paragraphs
\setlength{\parindent}{0pt}
\setlength{\parskip}{0.7em}
%% Header and footer
\renewcommand{\headrulewidth}{0pt}
\lhead{\hspace*{-\myparindent}\small\docnum}
\rhead{}
\setvalue{\leftfooter}{}% set in enclosing document or style (i.e. omg_rfp.sty)
\lfoot{\hspace*{-\myparindent}\footnotesize {\leftfooter}}
\cfoot{\hspace*{-0.5\myparindent}\footnotesize\today}
\rfoot{\footnotesize\thepage}
\setcounter{tocdepth}{2}
%% Margin comments
\usepackage{soul} % highlighting
\usepackage[backgroundcolor=lightgray,textwidth=\marginparwidth,textsize=scriptsize]{todonotes} % margin comment
\newcounter{mycomment}
\newboolean{hidecomments}
\setboolean{hidecomments}{false}
\makeatletter
\newcommand{\mycomment}[3][]{%
\ifthenelse{\boolean{hidecomments} \or \boolean{@todonotes@disabled} }%
{#2}% margin notes off, just emit the raw text
{\refstepcounter{mycomment}% increment comment counter
\hl{#2}% highlight the target text
\todo[fancyline]% insert the margin note so it points to the END of the target text
{%
\protect\renewcommand{\baselinestretch}{0.75}% tighter line spacing
\selectfont\textbf{[\uppercase{#1}\themycomment]:}% insert option text, counter
~#3 \par% insert comment body
}%
}%
}
\makeatother
% VERY odd bug in soul, and while this works around it, it means that the specname *will not be highlighted* when pointed to by a \mycomment
\soulregister{\specname}{0}
% Macros for checking the existence or emptiness of a file.
% They follow the \ifthenelse idiom
\def\firstoftwo#1#2{#1}
\def\secondoftwo#1#2{#2}
\def\iffileexistelse#1{%
\expandafter\ifx\expandafter&\pdffilesize{#1}&%
\expandafter\secondoftwo
\else
\expandafter\firstoftwo
\fi
}
\def\iffileemptyelse#1{%
\ifnum0\pdffilesize{#1}>0
\expandafter\secondoftwo
\else
\expandafter\firstoftwo
\fi
}
\def\test#1{%
\iffileexistelse{#1}{File #1 exists}{File #1 doesn't exist}
\iffileemptyelse{#1}{File #1 is empty}{File #1 isn't empty}\par
}
\newcommand{\ifnotemptyfileinputwithpre}[2]{
\iffileexistelse{#1}{
\iffileemptyelse{#1}{}{
#2
\input{#1}
}
}
}