上海上港主场球票在哪:設計一個可定制的精致章樣式

上海上港高清海报 www.wqytv.com.cn 前文,我們分享很多了,今天,這一個章節設計代碼上還是有不少定制性的,若是有興趣的用戶可以研讀下其代碼,這樣對于章節樣式的定制性會增加不少認識,也可以更加擴展自己的章節樣式。

chap20150917002719代碼如下:

\begin{filecontents}{chapterhead.sty}
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{chapterhead}[2012/07/16 v0.0.1 Chapter head and epigraph (AM)]
\RequirePackage{xkeyval}
\RequirePackage{catoptions}
\[email protected]\[email protected]#1\endif{#1}
\[email protected]\[email protected]#1#2\endif{#1}
\[email protected]*\chdifnumcmpTF#1#2#3{\ifnumcmpTF#1#2{#3}}
% \chdifchoice can be used to define choice keys via command keys:
\[email protected]*\chdifchoice{\chdifcase\ifstrcmpTF}
\[email protected]*\chdifcase#1#2{%
 \ifstrcmpTF{#1}\ifnone{%
 \[email protected]
 }{%
 \ifstrcmpTF{#1}\endif{}{%
 \ifstrcmpTF{#2}\ifnone{%
 \[email protected]
 }{%
 \ifstrcmpTF{#2}\endif{}{\[email protected]{#1}{#2}}%
 }%
 }%
 }%
}
\[email protected]*\[email protected]#1#2#3{%
 \ifstrcmpTF{#3}\ifnone{%
 \[email protected]
 }{%
 \ifstrcmpTF{#3}\endif{}{%
 #1{#2}{#3}\[email protected]{\[email protected]@i{#1}{#2}}%
 }%
 }%
}
\[email protected]*\[email protected]@i#1#2#3{\[email protected]{#1}{#2}}
\[email protected][DKV]{definekeys}[[email protected]]{prefix}[KV]{}
\[email protected][DKV]{definekeys}[[email protected]]{family}{}
\[email protected][DKV]{definekeys}[[email protected]]{holder prefix}[[email protected]]{}
\[email protected][DKV]{definekeys}[[email protected]]{initialize}[true]{}
\[email protected][DKV]{definekeys}[[email protected]]{preset}[true]{}
% Keys not specified in the optional argument of \chddefinekeys will
% get default values:
\presetkeys[DKV]{definekeys}{prefix,family,holder prefix,
 initialize=false,preset=false}{}

\[email protected]*\chddefinekeys{\@testopt\[email protected]{}}
\[email protected]*\[email protected][#1]#2{%
 \setkeys[DKV]{definekeys}{#1}%
 \def\[email protected]{}%
 \edef\[email protected]{\cptcommanormalize{#2}}%
 \expandafter\[email protected]\[email protected],\[email protected],%
 \ifboolTF{[email protected]}{%
 \cptexpanded{\noexpand\presetkeys
 [\[email protected]]{\[email protected]}{\expandcsonce\[email protected]}{}%
 }%
 }{}%
 \ifboolTF{[email protected]}{%
 \cptexpanded{\noexpand\setkeys
 [\[email protected]]{\[email protected]}{\expandcsonce\[email protected]}%
 }%
 }{}%
}
\begingroup
\lccode`\&=1 \catcode`\&=7
\lowercase{\endgroup
 \[email protected]*\[email protected]{&}%
 \[email protected]*\[email protected]#1,{%
 \def\[email protected]{\[email protected]}%
 \edef\[email protected]{\cpttrimspace{#1}}%
 \ifx\[email protected]\[email protected]\expandafter\@gobble\else\expandafter\@iden\fi
 {\[email protected]#1/&/&/&/&/&/&/&/\[email protected]\[email protected]}%
 }
}
\[email protected]*\[email protected]#1{\ifx#1\[email protected]\else\expandcsonce#1\fi}
\[email protected]*\[email protected]#1/#2/#3/#4/#5/#6/#7/#8/#9\[email protected]{%
 \edef\keytype{\cpttrimspace{#1}}%
 \edef\keyname{\cpttrimspace{#2}}%
 \edef\keydefault{\cpttrimspace{#3}}%
 \edef\keycode{\cpttrimspace{#4}}%
 \ifx\keyname\[email protected]
 \@latexerr{Empty key name}\@ehd
 \fi
 \def\[email protected]##1{%
 \def\[email protected]####1##1####2####3\@nil{%
 \def\[email protected]{####2}%
 }%
 \[email protected] cmd{0}bool{1}\@nil
 }%
 \expandafter\[email protected]\expandafter{\keytype}%
 \ifcase\[email protected]\relax
 \let\[email protected]\[email protected]
 \or
 \xifinsetTF{,\cptoxdetok\keydefault,}{,\detokenize{true,false},}{%
 \let\[email protected]\[email protected]
 }{%
 \@latexerr{Illegal default value '\cptoxdetok\keydefault'
 \MessageBreak for bool key '\keyname'}\@ehd
 }%
 \else
 \@latexerr{Illegal key type '#1'}\@ehd
 \fi
 \cptexpanded{\noexpand\[email protected]
 [\[email protected]]{\[email protected]}[\usecsn{[email protected] prefix}]%
 {\[email protected]\keyname}%
 \ifx\keydefault\[email protected]\else[\expandcsonce\keydefault]\fi
 {\[email protected]\keycode}%
 }%
 \edef\[email protected]{%
 \ifx\[email protected]\@empty\else\expandcsonce\[email protected],\fi
 \keyname
 \ifx\keydefault\[email protected]\else=%
 \oifstrcmpTF\keytype{bool}{%
 \oifstrcmpTF\keydefault{true}{false}{false}%
 }{%
 \expandcsonce\keydefault
 }%
 \fi
 }%
}
\chddefinekeys[
 prefix=CHD,family=epigraf,holder [email protected],initialize,preset
]{%
 cmd/width/\hsize,
 cmd/author/,
 cmd/color/black,
 cmd/authorcolor/black,
 bool/use italics for author/true,
 cmd/fontencoding/\encodingdefault,
 cmd/fontfamily/\familydefault,
 cmd/fontseries/\seriesdefault,
 cmd/fontshape/\shapedefault,
 cmd/fontsize/10pt,
 cmd/hskip/0ex,
 cmd/prevskip/0ex,
 cmd/postvskip/1ex,
 bool/frame/true,
}
\chddefinekeys[
 prefix=CHD,family=chapterhead,holder [email protected],initialize,preset
]{%
 cmd/textcolor/black,
 cmd/textfontencoding/\encodingdefault,
 cmd/textfontfamily/\familydefault,
 cmd/textfontseries/eb,
 cmd/textfontshape/\shapedefault,
 cmd/textfontsize/100pt,
 cmd/numberfontencoding/\encodingdefault,
 cmd/numberfontfamily/\familydefault,
 cmd/numberfontseries/eb,
 cmd/numberfontshape/\shapedefault,
 cmd/numberfontsize/100pt,
% cmd/leftmargin/\leftmargin,
% cmd/rightmargin/\rightmargin,
 cmd/texthskip/0em,
 cmd/textprevskip/0ex,
 cmd/textpostvskip/1ex,
 cmd/numberprevskip/0ex,
 cmd/numberpostvskip/0ex,
 cmd/numberhskip/0em,
 cmd/numbercolor/black,
 cmd/pagestyle/empty,
 bool/make text raggedleft/true,
 bool/make number raggedleft/true,
 bool/print number before text/true,
 bool/frame number/true,
 bool/no clear page/true
}
\newbox\[email protected]
\newcommand\epigraf[2][]{%
 \setkeys[CHD]{epigraf}{#1}%
 \setbox\[email protected]=\vbox{%
 \[email protected]\fbox{\fi
 \parbox\[email protected]{%
 \fontsize{\[email protected]}{1.5\[email protected]}%
 \usefont{\[email protected]}{\[email protected]}%
 {\[email protected]}{\[email protected]}%
 \ignorespaces
 \textcolor{\[email protected]}{#2}%
 \hspace*{\fill}\nolinebreak[1]%
 \quad\hspace*{\fill}\finalhyphendemerits\[email protected]\relax
 \begingroup
 \ifboolTF{[email protected] italics for author}{\itshape}{}%
 \textcolor{\[email protected]}{\[email protected]}%
 \endgroup
 }%
 \[email protected]}\fi
 }%
 \global\let\[email protected]\[email protected]
 \@ignoretrue
}

\AtBeginDocument{%
 \@ifundefined{@mainmattertrue}{\newif\[email protected]\@mainmattertrue}{}%
}
\[email protected]*\[email protected]#1{%
 \begingroup
 \ifboolTF{[email protected] text raggedleft}{%
 \raggedleft
 }{%
 \hskip\[email protected]\relax
 }%
 \advance\leftmargin10em
 \interlinepenalty\@M
 \vskip\[email protected]\relax
 \fontsize{\[email protected]}{1.2\[email protected]}%
 \usefont{\[email protected]}{\[email protected]}%
 {\[email protected]}{\[email protected]}%
 \textcolor{\[email protected]}{\ignorespaces#1}%
 \par\nobreak
 \vskip\[email protected]\relax
 \endgroup
}
\[email protected]*\[email protected]{%
 \begingroup
 \ifnum\[email protected]>\[email protected]
 \[email protected]
 \vskip\[email protected]\relax
 \fontsize{\[email protected]}{1.2\[email protected]}%
 \usefont{\[email protected]umberfontencoding}{\[email protected]}%
 {\[email protected]}{\[email protected]}%
 \usecsn{[email protected] number}\fbox{\fi
 \textcolor{\[email protected]}{\thechapter}%
 \usecsn{[email protected] number}}\fi
 \par\nobreak
 \vskip\[email protected]\relax
 \fi
 \fi
 \endgroup
}
\renewcommand\chapter[1][]{%
 \setkeys[CHD]{chapterhead}{#1}%
 \ifboolTF{[email protected] clear page}{}{%
 \[email protected]\cleardoublepage\else\clearpage\fi
 }%
 \thispagestyle{\[email protected]}%
 \global\@topnum\[email protected]
 \ifdefTF\[email protected]\[email protected]\relax
 \@afterindentfalse
 \secdef\@chapter\@schapter
}
\renewcommand{\@makechapterhead}[1]{%
 \begingroup
 \begingroup
 \leavevmode
 \ifboolTF{[email protected] number raggedleft}{%
 \raggedleft
 }{%
 \hskip\[email protected]\relax
 }%
 \ifboolTF{[email protected] number before text}{%
 \[email protected]\[email protected]{#1}%
 }{%
 \[email protected]{#1}\[email protected]
 }%
 \endgroup
 \nobreak
 \endgroup
}
\renewcommand{\@makeschapterhead}[1]{%
 \begingroup
 \let\[email protected]\[email protected]\@makechapterhead{#1}%
 \endgroup
}
\newcommand*\[email protected]{%
 \vskip\[email protected]
 \hskip\[email protected]\relax
 \copy\[email protected]
 \vskip\[email protected]
 \global\let\[email protected]\relax
}
\endinput
\end{filecontents}

\documentclass{book}
\usepackage{chapterhead}
\usepackage[dvipsnames]{xcolor}

\begin{document}
\epigraf[
 author={Lewis Carroll, \textit{Alice in Wonderland}},
 color=blue,
 width=.75\hsize,
 use italics for author=false,
 fontsize=8pt,
 fontfamily=cmr,
 hskip=10em,
 postvskip=2ex,
 frame,
]{
 ``Begin at the beginning,'' the King said, gravely, ``and go on till you
 come to an end; then stop.''
}

\chapter[
 numberpostvskip=.2ex,
 numberfontseries=ux,
 numberfontfamily=cmbr,
 textfontseries=ex,
 textfontsize=50pt,
 textfontfamily=cmbr,
 textfontshape=it,% not obtainable because of other choices above
 textcolor=red,
 make text raggedleft=false,
 make number raggedleft=false,
 print number before text,
 no clear page
]{Graph Theory}

\noindent The Pregolya River passes through the city once known as K\"onigsberg.
In the 1700s seven bridges were situated across this river in a manner similar
to what you see in Figure \ldots

\par\vskip3\baselineskip
\hrule height.5pt depth .4pt \relax

\epigraf[
 author={Lewis Carroll, \textit{Alice in Wonderland}},
 color=black,
 width=.75\hsize,
 use italics for author,
 fontsize=8pt,
 fontfamily=cmr,
 hskip=-3em,
 prevskip=2ex,
 postvskip=2ex,
]{
 ``Begin at the beginning,'' the King said, gravely, ``and go on till you
 come to an end; then stop.''
}

\chapter[
 numberpostvskip=.2ex,
 numberfontseries=ux,
 numberfontfamily=cmbr,
 textfontseries=ex,
 textfontsize=50pt,
 textfontfamily=cmss,
 textfontshape=it,
 textcolor=Brown,
 numbercolor=ForestGreen,
 make text raggedleft,
 make number raggedleft,
 frame number,
 no clear page
]{Graph Theory}

\noindent The Pregolya River passes through the city once known as K\"onigsberg.
In the 1700s seven bridges were situated across this river in a manner similar
to what you see in Figure \ldots
\end{document}

選自://tex.stackexchange.com/questions/53377/inspirational-quote-at-start-of-chapter

分享到:
未經允許不得轉載:設計一個可定制的精致章樣式
已有 條意見

    最新文章

    加載中...
      本站提供專業LaTeX排版、咨詢、定制服務,請點擊下圖咨詢詳情


      全國首個精品的LaTeX視頻教程,大牛帶著你入門,讓LaTeX學習不再糾結,請點擊下圖咨詢詳情

      熱門評論

        聯系我們

        交流QQ群:91940767
        本站QQ號:343083553
        郵箱聯系[email protected]
        淘寶店鋪https://shop240512713.taobao.com/ 提供排版,模板定制,培訓,圖片處理,視頻教程等LaTeX服務。

        關注我們微信公眾號

        如果您投稿或者希望加入我們團隊,請發送您的簡歷到[email protected]。
        手机版吉祥棋牌 捕鱼达人3d刷金币封包 北京快乐8开奖走势图360 波克千炮捕鱼最新官网 七星彩走势图表 天天快报 阅读 赚钱 学英语好还是日语赚钱 怎样坐家里赚钱 天天捕鱼 3d捕鱼 现在卖pos机还能赚钱吗 彩票中奖 自动播放视频赚钱软件是什么 快3赚钱投注方法 fg捕鱼赢钱的方法 街机欢乐捕鱼下载 3d走势图(带线专业版)