diff options
author | Karl Berry <karl@freefriends.org> | 2016-01-11 22:12:17 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-01-11 22:12:17 +0000 |
commit | 4d5ecf8fcf4e6667025feb557ddbb30c9f671c7a (patch) | |
tree | b4673eb7b310c02a8d5a222d5a654fdf0a9ebab0 /Master/texmf-dist/doc/latex/thuthesis/dtx-style.sty | |
parent | 8e4a709fa64caddcfe3600d3a8ba56826ef750e1 (diff) |
thuthesis (11jan16)
git-svn-id: svn://tug.org/texlive/trunk@39351 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/thuthesis/dtx-style.sty')
-rw-r--r-- | Master/texmf-dist/doc/latex/thuthesis/dtx-style.sty | 174 |
1 files changed, 121 insertions, 53 deletions
diff --git a/Master/texmf-dist/doc/latex/thuthesis/dtx-style.sty b/Master/texmf-dist/doc/latex/thuthesis/dtx-style.sty index c4c0e773198..f2279b5bedd 100644 --- a/Master/texmf-dist/doc/latex/thuthesis/dtx-style.sty +++ b/Master/texmf-dist/doc/latex/thuthesis/dtx-style.sty @@ -1,67 +1,135 @@ +%% +%% This is file `dtx-style.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% thuthesis.dtx (with options: `dtx-style') +%% +%% This is a generated file. +%% +%% Copyright (C) 2005-2016 by Ruini Xue <xueruini@gmail.com> +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3a +%% of this license or (at your option) any later version. +%% The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3a or later is part of all distributions of LaTeX +%% version 2004/10/01 or later. +%% +%% To produce the documentation run the original source files ending with `.dtx' +%% through LaTeX. +%% +%% \end{latex} \ProvidesPackage{dtx-style} - +\RequirePackage{hypdoc} \RequirePackage[UTF8,scheme=chinese]{ctex} -\RequirePackage[top=2.5cm, bottom=2.5cm, headsep=5mm]{geometry} - +\RequirePackage[ + top=2.5cm, bottom=2.5cm, + left=4cm, right=2cm, + headsep=3mm]{geometry} \RequirePackage{calc} -\RequirePackage{array,longtable} -\RequirePackage{fancybox,fancyvrb} +\RequirePackage{array,longtable,booktabs} +\RequirePackage{listings} \RequirePackage{fancyhdr} \RequirePackage{xcolor} -\RequirePackage{url} -\RequirePackage{hyperref} \RequirePackage{enumitem} -\RequirePackage{ifxetex} +\RequirePackage{etoolbox} -\hypersetup{% - bookmarksnumbered=true, - bookmarksopen=true, - bookmarksopenlevel=1, - breaklinks=true, - colorlinks=true, - linkcolor=blue, - plainpages=false, - pdfborder=0 0 0} -\ifxetex - \hypersetup{% - CJKbookmarks=true} -\else - \hypersetup{% - unicode=true, - CJKbookmarks=false} -\fi +\colorlet{thu@macro}{blue!60!black} +\colorlet{thu@env}{blue!70!black} +\colorlet{thu@option}{purple} +\patchcmd{\PrintMacroName}{\MacroFont}{\MacroFont\bfseries\color{thu@macro}}{}{} +\patchcmd{\PrintDescribeMacro}{\MacroFont}{\MacroFont\bfseries\color{thu@macro}}{}{} +\patchcmd{\PrintDescribeEnv}{\MacroFont}{\MacroFont\bfseries\color{thu@env}}{}{} +\patchcmd{\PrintEnvName}{\MacroFont}{\MacroFont\bfseries\color{thu@env}}{}{} -\setlist{nosep} -\def\SpecialOptionIndex#1{\@bsphack% - \index{#1\actualchar{\protect\bfseries #1}}\@esphack} -\newenvironment{options} - {\list{}{\setlength\labelwidth{2cm}% - \setlength\labelsep{3pt}% - \setlength\leftmargin{\labelwidth+\labelsep}% - \addtolength{\itemsep}{3pt}% - \renewcommand\makelabel[1]{% - \ovalbox{\color{magenta}\bfseries\sffamily ##1}% - \SpecialOptionIndex{##1}}} - }{\endlist} +\def\DescribeOption{% + \leavevmode\@bsphack\begingroup\MakePrivateLetters% + \Describe@Option} +\def\Describe@Option#1{\endgroup + \marginpar{\raggedleft\PrintDescribeOption{#1}}% + \thu@special@index{option}{#1}\@esphack\ignorespaces} +\def\PrintDescribeOption#1{\strut \MacroFont\bfseries\sffamily\color{thu@option} #1\ } +\def\thu@special@index#1#2{\@bsphack + \begingroup + \HD@target + \let\HDorg@encapchar\encapchar + \edef\encapchar usage{% + \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage}% + }% + \index{#2\actualchar{\string\ttfamily\space#2} + (#1)\encapchar usage}% + \index{#1:\levelchar#2\actualchar + {\string\ttfamily\space#2}\encapchar usage}% + \endgroup + \@esphack} -\DefineVerbatimEnvironment{example}{Verbatim}% - {frame=single,framerule=0.3mm,rulecolor=\color{violet},% - fillcolor=\color{violet!5},framesep=1mm,baselinestretch=1.2,% - fontsize=\small,gobble=1} +\lstdefinestyle{lstStyleBase}{% + basicstyle=\small\ttfamily, + aboveskip=\medskipamount, + belowskip=\medskipamount, + lineskip=0pt, + boxpos=c, + showlines=false, + extendedchars=true, + upquote=true, + tabsize=2, + showtabs=false, + showspaces=false, + showstringspaces=false, + numbers=none, + linewidth=\linewidth, + xleftmargin=4pt, + xrightmargin=0pt, + resetmargins=false, + breaklines=true, + breakatwhitespace=false, + breakindent=0pt, + breakautoindent=true, + columns=flexible, + keepspaces=true, + gobble=2, + framesep=3pt, + rulesep=1pt, + framerule=1pt, + backgroundcolor=\color{gray!5}, + stringstyle=\color{green!40!black!100}, + keywordstyle=\bfseries\color{blue!50!black}, + commentstyle=\slshape\color{black!60}} -\DefineVerbatimEnvironment{shell}{Verbatim}% - {frame=single,framerule=0.3mm,rulecolor=\color{olive},% - fillcolor=\color{olive!5},framesep=1mm,fontsize=\small,gobble=1} +\lstdefinestyle{lstStyleShell}{% + style=lstStyleBase, + frame=l, + rulecolor=\color{purple}, + language=bash} -\newcommand{\myentry}[1]{\vskip5pt\par% - \noindent\llap{{\color{purple}\bfseries #1}}% - \marginpar{\strut}\hskip\parindent} +\lstdefinestyle{lstStyleLaTeX}{% + style=lstStyleBase, + frame=l, + rulecolor=\color{violet}, + language=[LaTeX]TeX} + +\lstnewenvironment{latex}{\lstset{style=lstStyleLaTeX}}{} +\lstnewenvironment{shell}{\lstset{style=lstStyleShell}}{} + +\setlist{nosep} -\MakeShortVerb{\|} +\DeclareDocumentCommand{\option}{m}{\textsf{#1}} +\DeclareDocumentCommand{\env}{m}{\texttt{#1}} +\DeclareDocumentCommand{\pkg}{s m}{% + \texttt{#2}\IfBooleanF#1{\thu@special@index{package}{#2}}} +\DeclareDocumentCommand{\file}{s m}{% + \texttt{#2}\IfBooleanF#1{\thu@special@index{file}{#2}}} +\newcommand{\myentry}[1]{% + \marginpar{\raggedleft\color{purple}\bfseries\strut #1}} +\newcommand{\note}[1]{{% + \color{magenta}{\bfseries 说明:}\emph{#1}}} -\newcommand*\pkg[1]{\texttt{#1}} -\newcommand*\option[1]{\textsf{#1}} -\newcommand*\file[1]{\textsl{#1}} \def\thuthesis{\textsc{Thu}\-\textsc{Thesis}} -\newcommand{\note}[1]{\par% - {\color{magenta}{\bfseries 说明:}\emph{#1}}} +\endinput +%% +%% End of file `dtx-style.sty'. |