diff options
author | Karl Berry <karl@freefriends.org> | 2023-08-09 19:59:23 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-08-09 19:59:23 +0000 |
commit | 2fc8b759058c8718e1e095285b26162a05921db3 (patch) | |
tree | 2d5ebb51a0824b7a9e81dd1f84eedcce34f9cbe5 /Master/texmf-dist/tex/latex | |
parent | 6a08f132a19953383c8f3bcf8e85d563f6f12130 (diff) |
huawei (9aug23)
git-svn-id: svn://tug.org/texlive/trunk@67863 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/huawei/huawei.cls | 135 |
1 files changed, 67 insertions, 68 deletions
diff --git a/Master/texmf-dist/tex/latex/huawei/huawei.cls b/Master/texmf-dist/tex/latex/huawei/huawei.cls index 72c92ad3597..2e5a68b93a5 100644 --- a/Master/texmf-dist/tex/latex/huawei/huawei.cls +++ b/Master/texmf-dist/tex/latex/huawei/huawei.cls @@ -32,7 +32,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesClass{huawei} -[2023-08-03 0.17.0 Template for Huawei Documents] +[2023-08-09 0.18.0 Template for Huawei Documents] @@ -81,36 +81,29 @@ \LoadClass[12pt]{article} -\makeatletter -\DeclareOption{breaks}{ - \let\huawei@oldsection\section - \renewcommand\section{\clearpage\huawei@oldsection} +\RequirePackage{pgfopts} +\pgfkeys{ + /huawei/.cd, + breaks/.store in=\huawei@breaks, + slides/.store in=\huawei@slides, + nosecurity/.store in=\huawei@nosecurity, + authordraft/.store in=\huawei@authordraft, + nobrand/.store in=\huawei@nobrand, + nodate/.store in=\huawei@nodate, + nocover/.store in=\huawei@nocover, + nopaging/.store in=\huawei@nopaging, + landscape/.store in=\huawei@landscape, + anonymous/.store in=\huawei@anonymous, } -\newif\ifhuawei@dark -\DeclareOption{dark}{\huawei@darktrue} -\newif\ifhuawei@slides -\DeclareOption{slides}{\huawei@slidestrue} -\newif\ifhuawei@nosecurity -\DeclareOption{nosecurity}{\huawei@nosecuritytrue} -\newif\ifhuawei@authordraft -\DeclareOption{authordraft}{\huawei@authordrafttrue} -\newif\ifhuawei@nobrand -\DeclareOption{nobrand}{\huawei@nobrandtrue} -\newif\ifhuawei@nodate -\DeclareOption{nodate}{\huawei@nodatetrue} -\newif\ifhuawei@nocover -\DeclareOption{nocover}{\huawei@nocovertrue} -\newif\ifhuawei@nopaging -\DeclareOption{nopaging}{\huawei@nopagingtrue} -\newif\ifhuawei@landscape -\DeclareOption{landscape}{\huawei@landscapetrue} -\newif\ifhuawei@anonymous -\DeclareOption{anonymous}{\huawei@anonymoustrue} -\ProcessOptions\relax -\makeatother +\ProcessPgfPackageOptions{/huawei} + +\makeatletter\ifdefined\huawei@breaks +\let\huawei@oldsection\section +\renewcommand\section{\clearpage\huawei@oldsection} +\fi\makeatother \RequirePackage{geometry} -\makeatletter\ifhuawei@landscape +\makeatletter\ifdefined\huawei@landscape \geometry{paperwidth=16in, paperheight=9in, left=4in, right=2in, top=1.5in, bottom=1.5in} \else @@ -118,7 +111,7 @@ top=1.2in, bottom=1.2in} \fi\makeatother -\makeatletter\ifhuawei@slides +\makeatletter\ifdefined\huawei@slides \usepackage[fontsize=24pt]{fontsize} \fi\makeatother @@ -196,7 +189,7 @@ \definecolor{orange}{HTML}{F06543} \makeatletter\newcommand\huawei@header[1]{{% - \ifhuawei@slides% + \ifdefined\huawei@slides% \setstretch{0.8}% \fontsize{19pt}{24pt}\selectfont% \else% @@ -214,8 +207,8 @@ }\makeatother \makeatletter\newcommand\huawei@logo[1]{ -\def\BLACK{\ifhuawei@dark white\else black\fi} -\def\BLANK{\ifhuawei@dark black\else white\fi} +\def\BLACK{\ifdefined\huawei@dark white\else black\fi} +\def\BLANK{\ifdefined\huawei@dark black\else white\fi} \begin{tikzpicture}[y=0.80pt, x=0.80pt, yscale=-#1, xscale=#1, inner sep=0pt, outer sep=0pt] \begin{scope}[even odd rule,line width=0.800pt] @@ -359,7 +352,7 @@ xscale=#1, inner sep=0pt, outer sep=0pt] \fancyhf{} \makeatletter\fancyfoot[L]{ \huawei@bar - \ifhuawei@authordraft% + \ifdefined\huawei@authordraft% \begin{textblock}{14}[0.5,0.5](8,8)% \tikz \node[minimum width=14\TPHorizModule] {% \fontsize{64}{64}\selectfont\sffamily\scshape% @@ -370,9 +363,9 @@ xscale=#1, inner sep=0pt, outer sep=0pt] }\makeatother \makeatletter\fancyhead[L]{ \ifnum\value{page}=1\else% - \ifhuawei@nobrand\else% + \ifdefined\huawei@nobrand\else% \begin{textblock}{8}[0,0](1.2,0.2)% - \huawei@logo{\ifhuawei@slides 1.8\else 1\fi}% + \huawei@logo{\ifdefined\huawei@slides 1.8\else 1\fi}% \end{textblock}% \fi% \fi% @@ -380,7 +373,7 @@ xscale=#1, inner sep=0pt, outer sep=0pt] \makeatletter\fancyhead[R]{ \begin{textblock}{8}[1,0](15.8,0.2)% \raggedleft\huawei@header{% - \ifhuawei@nosecurity\else% + \ifdefined\huawei@nosecurity\else% \thesecurity \fi% }% @@ -390,16 +383,16 @@ xscale=#1, inner sep=0pt, outer sep=0pt] \begin{textblock}{8}[0,1](1.2,15.8)% \ifnum\value{page}=1\else% \huawei@header{\raggedright% - \ifhuawei@anonymous\else% + \ifdefined\huawei@anonymous\else% \theauthor% - \ifhuawei@nosecurity\else% + \ifdefined\huawei@nosecurity\else% \ifx\theid\empty\else, \theid\fi \fi% - \ifhuawei@nobrand\else% + \ifdefined\huawei@nobrand\else% \newline \fi% \fi% - \ifhuawei@nobrand\else% + \ifdefined\huawei@nobrand\else% \thecompany{} \fi% }% @@ -408,14 +401,14 @@ xscale=#1, inner sep=0pt, outer sep=0pt] \begin{textblock}{8}[1,1](15.8,15.8)% \raggedleft\huawei@header{% \ifnum\value{page}=1\else% - \ifhuawei@nopaging\else% + \ifdefined\huawei@nopaging\else% Page \#\thepage{} of \pageref*{LastPage}% - \ifhuawei@nodate\else% + \ifdefined\huawei@nodate\else% \\ \fi% \fi% \fi% - \ifhuawei@nodate\else% + \ifdefined\huawei@nodate\else% \today{} \settimeformat{daytime}\currenttime{}% \fi% }% @@ -433,23 +426,23 @@ xscale=#1, inner sep=0pt, outer sep=0pt] \ifx\thesubtitle\empty\else% {\color{gray!50!black}\large\thesubtitle\par} \fi - \ifhuawei@nobrand\else% - \ifhuawei@anonymous\else% + \ifdefined\huawei@nobrand\else% + \ifdefined\huawei@anonymous\else% \ifx\thecompany\empty\else% \thecompany\newline \fi \fi \fi \ifx\theauthor\empty\else% - {\scshape\ifhuawei@anonymous + {\scshape\ifdefined\huawei@anonymous Anonymous Authors \else% \theauthor \fi}% \fi% - \ifhuawei@anonymous\else% + \ifdefined\huawei@anonymous\else% \ifx\theauthor\empty\else - \ifhuawei@nobrand\else% + \ifdefined\huawei@nobrand\else% \ifx\theid\empty\else $\;$/ {\theid} \fi @@ -483,7 +476,7 @@ xscale=#1, inner sep=0pt, outer sep=0pt] \textbf{Disclaimer}: The opinions expressed in this document are in good faith and while every care has been taken in preparing it, - \ifhuawei@nobrand% + \ifdefined\huawei@nobrand% the author% \else% \thecompany{}% @@ -492,7 +485,7 @@ xscale=#1, inner sep=0pt, outer sep=0pt] of whatever nature in respect of these documents, including but not limited to the accuracy or completeness of any information, facts and/or opinions contained therein. - \ifhuawei@nobrand% + \ifdefined\huawei@nobrand% The author% \else% \thecompany{}% @@ -506,7 +499,7 @@ xscale=#1, inner sep=0pt, outer sep=0pt] }\makeatother \makeatletter\newcommand\PrintFirstPage[1]{ - \ifhuawei@landscape\else + \ifdefined\huawei@landscape\else \PackageError{huawei}{It's allowed to use PrintFirstPage only in landscape mode}{Read huawei.pdf for more information} @@ -519,7 +512,7 @@ xscale=#1, inner sep=0pt, outer sep=0pt] \fi \vspace*{0.5in} \maketitle - \ifhuawei@nocover\else + \ifdefined\huawei@nocover\else \begin{textblock}{14}[1,1](14,14) \raggedleft\includegraphics[height=3.6in]{huawei-cover-picture.pdf} \end{textblock} @@ -527,7 +520,7 @@ xscale=#1, inner sep=0pt, outer sep=0pt] }\makeatother \makeatletter\newcommand\PrintLastPage{ - \ifhuawei@landscape\else + \ifdefined\huawei@landscape\else \PackageError{huawei}{It's allowed to use PrintLastPage only in landscape mode}{Read huawei.pdf for more information} @@ -560,7 +553,7 @@ xscale=#1, inner sep=0pt, outer sep=0pt] from those expressed or implied in the predictive statements. Therefore, such information is provided for reference purpose only and constitutes neither an offer nor an acceptance. - \ifhuawei@nobrand% + \ifdefined\huawei@nobrand% The author% \else% \thecompany{}% @@ -570,22 +563,28 @@ xscale=#1, inner sep=0pt, outer sep=0pt] \end{center}% }\makeatother -\makeatletter\newcommand\PrintBibliography{ - \setlength\bibitemsep{3pt} - \AtNextBibliography{\small} - \newpage - \raggedright - \ifhuawei@landscape - \begin{multicols}{3}\setstretch{0.95}\printbibliography\end{multicols} - \else - \begin{multicols}{2}\setstretch{0.95}\printbibliography\end{multicols} - \fi +\makeatletter\newcommand\PrintBibliography{% + \setlength\bibitemsep{3pt}% + \AtNextBibliography{\small}% + \ifdefined\huawei@breaks\newpage\fi% + \begingroup% + \raggedright% + \setstretch{0.95}% + \ifdefined\huawei@landscape% + \begin{multicols}{3}\printbibliography\end{multicols}% + \else% + \ifdefined\huawei@breaks% + \begin{multicols}{2}\printbibliography\end{multicols}% + \else + \printbibliography% + \fi% + \fi% }\makeatother -\makeatletter\ifhuawei@dark - \RequirePackage{pagecolor} - \pagecolor{black} - \color{white} +\makeatletter\ifdefined\huawei@dark + \RequirePackage{pagecolor}% + \pagecolor{black}% + \color{white}% \fi \AtBeginDocument{% |