-
Notifications
You must be signed in to change notification settings - Fork 1
/
comgipp.sty
executable file
·88 lines (79 loc) · 2.29 KB
/
comgipp.sty
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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{comgipp}[2017/06/29 Package file for publications on
gipp.com/pub]
\RequirePackage{xcolor}
\PassOptionsToPackage{usenames,dvipsnames}{xcolor}
\RequirePackage{listings}
\RequirePackage[most]{tcolorbox}
\RequirePackage{fancyhdr}
%\RequirePackage{titling}
\newbool{@acm}
\setbool{@acm}{false}
\DeclareOption{acm}{\setbool{@acm}{true}}
\ProcessOptions%
\newlength{\preprintTopmargin}
\setlength{\preprintTopmargin}{-2cm}
\newlength{\preprintHeadheight}
\setlength{\preprintHeadheight}{0pt}
\if@acm
\setlength{\preprintTopmargin}{-1cm}%
\setlength{\preprintHeadheight}{1cm}%
\fi
\definecolor{knblue}{RGB}{0,169,224}
\definecolor{turqois}{RGB}{19, 178, 241}
\fancypagestyle{firststyle}
{
\fancyhead[C]{\vspace{\preprintTopmargin}
\begin{tcolorbox}[title=Preprint from \url{https://www.gipp.com/pub/},
colbacktitle=knblue!35!white,
coltitle=black]
\theReferenceText
\end{tcolorbox}
}
\renewcommand{\headrulewidth}{0pt}
\setlength{\headheight}{\preprintHeadheight}
%\fancyfoot[C]{\footnotesize Page \thepage\ of \pageref{LastPage}}
\if@acm
\fancyhead[L]{\ACM@linecountL}%
\fancyhead[R]{\ACM@linecountR}%
%\fancyfoot[C]{\if@ACM@printfolios\footnotesize\thepage\fi}%
\else
\fi
}
\AtEndDocument{
\onecolumn
\lstset{%
%backgroundcolor=\color{knblue!20},
basicstyle=\small\ttfamily,
breaklines = true,
keywordstyle=\color{red!75},
%columns=fullflexible,
framerule=0pt,
}%
\vfill
\lstdefinelanguage{BibTeX}
{keywords={%
@article,@book,@collectedbook,@conference,@electronic,@ieeetranbstctl,%
@inbook,@incollectedbook,@incollection,@injournal,@inproceedings,%
@manual,@mastersthesis,@misc,@patent,@periodical,@phdthesis,@preamble,%
@proceedings,@standard,@string,@techreport,@unpublished%
},
comment=[l][\itshape]{@comment},
sensitive=false,
}
\if@acm%
\captionof{lstlisting}{Use the following \texttt{BibTeX}
code to cite this article}
\newbox{\mybox}
\begin{lrbox}{\mybox}
\begin{minipage}{\linewidth}
\lstinputlisting[language=BibTeX]{references.bib}
\end{minipage}
\end{lrbox}
\colorbox{knblue!20}{\usebox{\mybox}}
\else%
\lstset{backgroundcolor=\color{knblue!20}}
\lstinputlisting[language=BibTeX,caption=Use the following \texttt{BibTeX}
code to cite this article]{references.bib}
\fi
}