diff options
-rw-r--r-- | Master/texmf-dist/doc/latex/huawei/huawei.pdf | bin | 807934 -> 808197 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/huawei/huawei.dtx | 148 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/huawei/huawei.cls | 135 |
3 files changed, 143 insertions, 140 deletions
diff --git a/Master/texmf-dist/doc/latex/huawei/huawei.pdf b/Master/texmf-dist/doc/latex/huawei/huawei.pdf Binary files differindex 8355c298f14..f002dcbce5f 100644 --- a/Master/texmf-dist/doc/latex/huawei/huawei.pdf +++ b/Master/texmf-dist/doc/latex/huawei/huawei.pdf diff --git a/Master/texmf-dist/source/latex/huawei/huawei.dtx b/Master/texmf-dist/source/latex/huawei/huawei.dtx index 7546b37e567..7297aae9414 100644 --- a/Master/texmf-dist/source/latex/huawei/huawei.dtx +++ b/Master/texmf-dist/source/latex/huawei/huawei.dtx @@ -50,7 +50,7 @@ %<class>\NeedsTeXFormat{LaTeX2e} %<class>\ProvidesClass{huawei} %<*class> -[2023-08-03 0.17.0 Template for Huawei Documents] +[2023-08-09 0.18.0 Template for Huawei Documents] %</class> %<*driver> \documentclass{ltxdoc} @@ -351,42 +351,39 @@ $pdflatex = 'pdflatex %O --shell-escape %S'; \LoadClass[12pt]{article} % \end{macrocode} -% Then, we parse package options: +% Then, we parse class options: % \changes{v0.15.0}{2022/12/13}{A new package option \texttt{breaks} introduced, which forces all sections to start from a new page.} -% \begin{macrocode} -\makeatletter -\DeclareOption{breaks}{ - \let\huawei@oldsection\section - \renewcommand\section{\clearpage\huawei@oldsection} +% \changes{v0.18.0}{2023/08/09}{Now we use \texttt{pfgopts} for parsing class options.} +% \begin{macrocode} +\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} +% \end{macrocode} + +% Then, we redefine |\section| command in order to break pages for each section: +% \begin{macrocode} +\makeatletter\ifdefined\huawei@breaks +\let\huawei@oldsection\section +\renewcommand\section{\clearpage\huawei@oldsection} +\fi\makeatother % \end{macrocode} % Then, we set the size of the page: % \begin{macrocode} \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 @@ -397,7 +394,7 @@ $pdflatex = 'pdflatex %O --shell-escape %S'; % Then, we set the size of the font: % \begin{macrocode} -\makeatletter\ifhuawei@slides +\makeatletter\ifdefined\huawei@slides \usepackage[fontsize=24pt]{fontsize} \fi\makeatother % \end{macrocode} @@ -529,7 +526,7 @@ $pdflatex = 'pdflatex %O --shell-escape %S'; % Then, we define |\huawei@header|: % \begin{macrocode} \makeatletter\newcommand\huawei@header[1]{{% - \ifhuawei@slides% + \ifdefined\huawei@slides% \setstretch{0.8}% \fontsize{19pt}{24pt}\selectfont% \else% @@ -557,8 +554,8 @@ $pdflatex = 'pdflatex %O --shell-escape %S'; % Then, we define |\huawei@logo|: % \begin{macrocode} \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] @@ -706,7 +703,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% @@ -717,9 +714,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% @@ -727,7 +724,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% }% @@ -737,16 +734,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% }% @@ -755,14 +752,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% }% @@ -789,23 +786,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 @@ -854,7 +851,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{}% @@ -863,7 +860,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{}% @@ -882,7 +879,7 @@ xscale=#1, inner sep=0pt, outer sep=0pt] % Then, we define |\PrintFirstPage|: % \begin{macrocode} \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} @@ -895,7 +892,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} @@ -908,7 +905,7 @@ xscale=#1, inner sep=0pt, outer sep=0pt] % Then, we define |\PrintLastPage|: % \begin{macrocode} \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} @@ -941,7 +938,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{}% @@ -955,31 +952,38 @@ xscale=#1, inner sep=0pt, outer sep=0pt] % \begin{macro}{\PrintBibliography} % Then, we define |\PrintBibliography|: +% \changes{v0.18.0}{2023/08/09}{The bibliography prints in one column unless \texttt{breaks} class option is specified.} % \begin{macrocode} -\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 % \end{macrocode} % \end{macro} -% Then, we set the background color of the document: +% Then, we set the background color of the document, if required by the |dark| class option: % \begin{macrocode} -\makeatletter\ifhuawei@dark - \RequirePackage{pagecolor} - \pagecolor{black} - \color{white} +\makeatletter\ifdefined\huawei@dark + \RequirePackage{pagecolor}% + \pagecolor{black}% + \color{white}% \fi % \end{macrocode} -% Then, we configure layout: +% Then, we configure the layout: % \begin{macrocode} \AtBeginDocument{% \raggedbottom% 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{% |