Repository navigation
Expand file tree
/
Copy pathsolrexbook.sty
More file actions
executable file
·164 lines (157 loc) · 4.54 KB
/
Copy pathsolrexbook.sty
File metadata and controls
executable file
·164 lines (157 loc) · 4.54 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
\def\filedate{2007/08/30}
\def\fileversion{0.01}
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{solrexbook}[\filedate\space\fileversion\space]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Options
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Loading packages
%
%
\usepackage{ifpdf}
\ifpdf
\usepackage[pdftex]{graphicx}
\graphicspath{{images/}}
\else
\RequirePackage[dvipdfm, CJKbookmarks, bookmarks=true, bookmarksnumbered=true%
unicode,%
colorlinks,%
linkcolor=blue,%
hyperindex,%
plainpages=false,%
pdfstartview=FitH]{hyperref}
\AtBeginDvi{\special{pdf:tounicode UTF8-UCS2}}
\usepackage[dvipdfm]{graphicx}
\graphicspath{{images/}}
\DeclareGraphicsExtensions{.eps}
\fi
%
%
\RequirePackage{CJKutf8,CJKnumb,CJKulem}
\RequirePackage{color,verbatim,cite}
\RequirePackage{texnames,makeidx,indentfirst}
\RequirePackage{amsmath,amssymb,amsfonts,bm,manfnt}
\RequirePackage{fancyhdr,titlesec,datetime}
\RequirePackage{wasysym,fancyvrb,longtable,multirow,bigstrut}
\usepackage[section]{placeins}
\usepackage[left=3.2cm,right=2.54cm,top=3.3cm,bottom=2.6cm,twoside]{geometry}
\usepackage[caption=false,font=footnotesize]{subfig}
%\usepackage{fixltx2e}
%\usepackage{stfloats}
%
% we use CJK as default environment
\AtBeginDocument{\begin{CJK*}{UTF8}{song}\CJKtilde\CJKindent\CJKcaption{utf8}}
\AtEndDocument{\clearpage\end{CJK*}}
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Modifing Styles
%
%
\setlength{\parskip}{0.75ex plus .2ex minus .5ex}
\renewcommand{\baselinestretch}{1.2}
%
% we use superscript numerical citation with brackets
\def\@cite#1{\textsuperscript{[#1]}}
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Redefine some commands and environments
%
%
\newenvironment{lined}[1]%
{\begin{center}\begin{minipage}{#1}\hrule\medskip}
{\vspace{-1ex}\hrule \end{minipage}\end{center}}
%
% Marginal notes
\newcommand{\MarginalNotes}[1]{%
\hskip 1sp \marginpar{\small\sffamily\raggedright #1}}
%
\DefineVerbatimEnvironment%
{Codefrag}{Verbatim}
{fontfamily=tt,fontsize=\footnotesize,frame=lines, framerule=0.4mm, numbers=left, numbersep=3pt, tabsize=4}%
%
\DefineVerbatimEnvironment%
{Command}{Verbatim}
{fontfamily=tt,fontsize=\footnotesize, xleftmargin=2em, frame=none, numbers=none}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Dangerous and doubly dangerous bends
%
%
\newlength{\dbend@width}
\newlength{\ddbend@width}
\newlength{\dbend@voffset}
\def\setdbend@width{%
\settowidth{\dbend@width}{\dbend}%
\setlength{\ddbend@width}{\dbend@width}%
\multiply\dbend@width by 2%
\multiply\ddbend@width by 3%
\advance\ddbend@width by 1pt%
\settoheight{\dbend@voffset}{\dbend}%
\multiply\dbend@voffset by 22%
\divide\dbend@voffset by 15%
\advance\dbend@voffset by -\baselineskip}
%
% This parts is hacked from TeXbook
%
\def\d@nger{\begingroup\clubpenalty=10000\def\par{\endgraf\endgroup}
\setdbend@width\noindent\hangindent\dbend@width\hangafter=-2
\lower-\dbend@voffset\hbox to0pt{\hskip-\hangindent\dbend\hfill}}
%
\def\dd@nger{\begingroup\clubpenalty=10000\def\par{\endgraf\endgroup}
\setdbend@width\noindent\hangindent\ddbend@width\hangafter=-2
\lower-\dbend@voffset\hbox to0pt{\hskip-\hangindent\dbend\kern1pt\dbend\hfill}}
%
\def\danger{\d@nger}
\def\ddanger{\dd@nger}
\def\enddanger{\endgraf\endgroup}
%
%
\newenvironment{kaitext}{\CJKfamily{kai}}{\CJKfamily{song}}
\newcommand{\code}[1]{\textbf{\textcolor[rgb]{0.2, 0.2, 0.2}{\tt{#1}}}}
\newcommand{\BOXED}[2]
{
\noindent\begin{center}\fbox{
\begin{minipage}[c]{#1}{#2}\end{minipage}
}\end{center}
}
\newcommand{\FIG}[3]
{
\noindent\begin{figure}[htbp]
\centering
\includegraphics[width=#3,keepaspectratio]{#2}
\caption{\label{#2}#1}
\end{figure}
}
\makeatletter
\newcommand\figcaption{\def\@captype{figure}\caption}
\newcommand\codecaption{\def\@captype{figure}\caption}
\newcommand\tabcaption{\def\@captype{table}\caption}
\makeatother
\newcommand{\FIGFIX}[3]
{
\noindent\begin{minipage}{\textwidth}
\centering
\includegraphics[width=#3,keepaspectratio]{#2}
\figcaption{\label{#2}#1}
\end{minipage}
}
\renewcommand{\textfraction}{0.15}
\renewcommand{\topfraction}{0.85}
\renewcommand{\bottomfraction}{0.65}
\renewcommand{\floatpagefraction}{0.60}
% \newcounter{code}\setcounter{code}{1}
% \makeatletter
% \newcommand{\codecaption}[1] {\@makecaption{\codename~\arabic{chapter}-\arabic{code}}{#1} \addtocounter{code}{1}}
% \makeatother
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
\endinput
%%
%% End of file `solrexbook.sty'.