Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5badc75

Browse files
committed
Moved macros here from lib.tex.
1 parent b5e1c18 commit 5badc75

1 file changed

Lines changed: 87 additions & 8 deletions

File tree

Doc/myformat.sty

Lines changed: 87 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
% Style parameters and macros used by some documents here
22

3-
% Style parameters
4-
\raggedbottom
5-
\sloppy
6-
\parindent = 0mm
7-
\parskip = 2mm
8-
9-
% Page style parameters for A4 (European standard paper size)
3+
% Page format parameters for A4 (European standard paper size)
104
%\textwidth = 160mm
115
%\textheight = 240mm
126
%\topmargin = -11mm
137

14-
% Page style parameters for U.S. standard paper size
8+
% Page format parameters for U.S. standard paper size
159
\textwidth = 160mm
1610
\textheight = 220mm
1711
\topmargin = -11mm
1812

1913
\oddsidemargin = 1.5mm
2014
\evensidemargin = 1.5mm
2115

16+
% Style parameters
17+
\raggedbottom
18+
\sloppy
19+
\parindent = 0mm
20+
\parskip = 2mm
21+
2222
% Frequently used system name
2323
\newcommand{\UNIX}{U{\sc nix}}
2424

2525
% Variable used by begin code command
2626
\newlength{\codewidth}
2727

28+
% Command to start a code block (follow this by \begin{verbatim})
2829
\newcommand{\bcode}{
2930
% Calculate the text width for the minipage:
3031
\setlength{\codewidth}{\linewidth}
@@ -36,9 +37,87 @@
3637
\begin{minipage}[t]{\codewidth}
3738
}
3839

40+
% Command to end a code block (precede this by \end{verbatim})
3941
\newcommand{\ecode}{
4042
\end{minipage}
4143
\vspace{3mm}
4244
\par
4345
\noindent
4446
}
47+
48+
% Underscores are not magic throughout the Python documentation
49+
\catcode`_=12
50+
51+
% Dummy \cbstart and \cbend so I can leave changebars in...
52+
\newcommand{\cbstart}{}
53+
\newcommand{\cbend}{}
54+
55+
% Define \itembreak: force the text after an item to start on a new line
56+
\newcommand{\itembreak}{
57+
\mbox{}
58+
\\*[0mm]
59+
}
60+
61+
% Command to generate two index entries (using subentries)
62+
\newcommand{\indexii}[2]{
63+
\index{#1!#2}
64+
\index{#2!#1}
65+
}
66+
67+
% And three entries (using only one level of subentries)
68+
\newcommand{\indexiii}[3]{
69+
\index{#1!#2 #3}
70+
\index{#2!#3, #1}
71+
\index{#3!#1 #2}
72+
}
73+
74+
% And four (again, using only one level of subentries)
75+
\newcommand{\indexiv}[4]{
76+
\index{#1!#2 #3 #4}
77+
\index{#2!#3 #4, #1}
78+
\index{#3!#4, #1 #2}
79+
\index{#4!#1 #2 #3}
80+
}
81+
82+
% Command to generate a reference to a function, statement, keyword, operator
83+
\newcommand{\stindex}[1]{\indexii{statement}{#1@{\tt#1}}}
84+
\newcommand{\kwindex}[1]{\indexii{keyword}{#1@{\tt#1}}}
85+
\newcommand{\opindex}[1]{\indexii{operator}{#1@{\tt#1}}}
86+
\newcommand{\bifuncindex}[1]{\index{#1@{\tt#1} (built-in function)}}
87+
88+
% Add an index entry for a module
89+
\newcommand{\modindex}[2]{\index{#1@{\tt#1} (#2module)}}
90+
\newcommand{\bimodindex}[1]{\modindex{#1}{built-in }}
91+
\newcommand{\stmodindex}[1]{\modindex{#1}{standard }}
92+
93+
% Additional string for an index entry
94+
\newcommand{\indexsubitem}{}
95+
\newcommand{\ttindex}[1]{\index{#1@{\tt#1} \indexsubitem}}
96+
97+
% Define \itemjoin: some negative vspace to join two items together
98+
\newcommand{\itemjoin}{
99+
\mbox{}
100+
\vspace{-\itemsep}
101+
\vspace{-\parsep}
102+
}
103+
104+
% Define \funcitem{func}{args}: define a function item
105+
\newcommand{\funcitem}[2]{
106+
\ttindex{#1}
107+
\item[{\tt #1(#2)}]
108+
\
109+
}
110+
111+
% Define \dataitem{name}: define a data item
112+
\newcommand{\dataitem}[1]{
113+
\ttindex{#1}
114+
\item[{\tt #1}]
115+
\
116+
}
117+
118+
% Define \excitem{name}: define an exception item
119+
\newcommand{\excitem}[1]{
120+
\ttindex{#1}
121+
\item[{\tt #1}]
122+
\itembreak
123+
}

0 commit comments

Comments
 (0)