-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathttools.sty
60 lines (55 loc) · 1.36 KB
/
ttools.sty
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
%!TEX TS-program = xelatex
% vim: set fenc=utf-8
% -*- coding: UTF-8; -*-
%!TEX encoding = UTF-8 Unicode
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% FileName: ttools.sty
%% Author: Timozer
%% E-mail: [email protected]
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{ttools}[2018/03/16 Some Useful Tools]
\RequirePackage{etoolbox}
\RequirePackage{xcolor}
\NewDocumentCommand{\tilcode}{m}{\colorbox{lightgray!50}{\ttfamily\small #1}}
\NewDocumentCommand{\cmd}{m}{\texttt{\small $\backslash$#1}}
\NewDocumentCommand{\email}{m}{{\small \texttt{#1}}}
\NewDocumentCommand{\tthanks}{}{
\begin{center}
{\LARGE 谢谢}
\end{center}
}
\NewDocumentEnvironment{ttab}{m m}{%
\begin{table}[htbp]
\centering
\caption{#1}
\label{#2}
}{%
\end{table}
}
\NewDocumentEnvironment{tfig}{m m}{%
\begin{figure}[htbp]
\centering
}{%
\caption{#1}
\label{#2}
\end{figure}
}
% for poems
\NewDocumentEnvironment{tpoem}{m m}{%
\vskip.8ex
\begin{center}
\begin{minipage}{.65\textwidth}
\small \sffamily
}{%
\rightline{------~#1《~#2~》}
\end{minipage}
\end{center}
\vskip.7ex
}
\AtBeginDocument{%
\let\oldref\ref%
\renewcommand{\ref}[1]{\hskip0.25em\oldref{#1}\hskip0.25em}
}
\endinput