Debian Codegraph @

texmf-dist/doc/latex/subsupscripts/SubSupScripts.tex

raw
1 \documentclass[green,a4paper,oneside,openany,noparindent,noparskip,article,nomatter]{bookest}
2
3 \usepackage[T1]{fontenc}
4 \usepackage{amsmath}
5 \usepackage{amsfonts}
6 \usepackage{subsupscripts}
7 \usepackage{fancyvrb}
8 \usepackage{stmaryrd}
9 \usepackage{palatino}
10 \usepackage{hyperref}
11
12 \VerbatimFootnotes
13
14 \newcommand{\choice}{\oplus} % Usual notation
15 \newcommand{\Choice}{$\choice$}
16 \newcommand{\Boxast}{$\boxast$}
17 \newcommand{\Boxcircle}{$\boxcircle$}
18 \newcommand{\Boxbslash}{$\boxbslash$}
19 \newcommand{\Boxbox}{$\boxbox$}
20 \newcommand{\Elll}{$\ell_L$}
21 \newcommand{\Ellr}{$\ell_R$}
22
23 \setbibname{References}
24
25 \setleftmark{}
26 \setrightmark{}
27
28 %pdfLaTeX
29 \hypersetup{
30 pdftitle={SubSupScripts},
31 pdfsubject={A LaTeX package to provide new commands for subscripts and superscripts.},
32 pdfauthor={Riccardo Bresciani},
33 pdfkeywords={SubSupScripts, LaTeX, Subscript, Superscript, TeX},
34 pdfstartview=FitV,
35 %colorlinks
36 }
37
38
39 % Aliases
40 \newcommand{\ie}{\emph{i.e.} }
41
42 \author{Riccardo Bresciani}
43 \title{SubSupScripts\hfill{\small\href{http://tex.nopkoguo.net/subsupscripts}{http://tex.nopkoguo.net/subsupscripts}}}
44 \newcommand{\belowLine}{{\normalsize Version 1.0 --- \today}}
45
46 \makeatletter
47 \renewcommand{\maketitle}{\thispagestyle{plain}{\Huge\textbf{\colorB\@title}\Large\\\vspace{2ex}
48 \@author{\colorA\hrule}\vspace{1ex}\belowLine\\\vspace{2ex}}}
49 \makeatother
50
51 \geometry{
52 hmargin=2.3cm,
53 vmargin={3cm,3cm},
54 bindingoffset=0mm,
55 columnsep=20pt
56 }
57
58 \begin{document}
59
60 \maketitle
61
62 \begin{abstract}{Brief description of the package:}
63 This package provides some new more flexible commands to typeset subscripts and superscripts in mathematical mode.
64 \end{abstract}
65
66
67 \artsection{Usage}
68 \artsubsection{Default lengths}
69 The following commands use the default lengths, as defined in \ref{lengths}. They are quite tight and are useful in case of an operator such as \Choice.
70 \begin{itemize}
71 \item \Verb[commandchars=-\[\]]+\fourscripts{-Choice}{-Boxast}{-Boxbox}{-Boxcircle}{-Boxbslash}+
72
73 Output: $\fourscripts{\choice}{\boxast}{\boxbox}{\boxcircle}{\boxbslash}$
74 \item \Verb[commandchars=-\[\]]+\lrsubscripts{-Choice}{-Boxbox}{-Boxcircle}+
75
76 Output: $\lrsubscripts{\choice}{\boxbox}{\boxcircle}$
77 \item \Verb[commandchars=-\[\]]+\lrsuperscripts{-Choice}{-Boxbox}{-Boxcircle}+
78
79 Output: $\lrsuperscripts{\choice}{\boxbox}{\boxcircle}$
80 \item \Verb[commandchars=-\[\]]+\twolscripts{-Choice}{-Boxbox}{-Boxcircle}+
81
82 Output: $\twolscripts{\choice}{\boxbox}{\boxcircle}$
83 \item \Verb[commandchars=-\[\]]+\tworscripts{-Choice}{-Boxbox}{-Boxcircle}+
84
85 Output: $\tworscripts{\choice}{\boxbox}{\boxcircle}$
86 \item \Verb[commandchars=-\[\]]+\lsubscript{-Choice}{-Boxbox}+
87
88 Output: $\lsubscript{\choice}{\boxbox}$
89 \item \Verb[commandchars=-\[\]]+\lsuperscript{-Choice}{-Boxbox}+
90
91 Output: $\lsuperscript{\choice}{\boxbox}$
92 \item \Verb[commandchars=-\[\]]+\rsubscript{-Choice}{-Boxbox}+
93
94 Output: $\rsubscript{\choice}{\boxbox}$
95 \item \Verb[commandchars=-\[\]]+\rsuperscript{-Choice}{-Boxbox}+
96
97 Output: $\rsuperscript{\choice}{\boxbox}$
98 \end{itemize}
99
100 \artsubsection{Larger skips}
101
102 \largerSkips
103
104 The following commands use larger lengths, as defined in \ref{lengths}: this is achieved by running the command \Verb+\largerSkips+. This is needed when we want to apply subscripts or superscripts to something larger than \Choice, such as {\renewcommand{\choice}{expression} \Choice.
105
106
107 \begin{itemize}
108 \item \Verb[commandchars=-\[\]]+\fourscripts{-Choice}{-Boxast}{-Boxbox}{-Boxcircle}{-Boxbslash}+
109
110 Output: $\fourscripts{\choice}{\boxast}{\boxbox}{\boxcircle}{\boxbslash}$
111 \item \Verb[commandchars=-\[\]]+\lrsubscripts{-Choice}{-Boxbox}{-Boxcircle}+
112
113 Output: $\lrsubscripts{\choice}{\boxbox}{\boxcircle}$
114 \item \Verb[commandchars=-\[\]]+\lrsuperscripts{-Choice}{-Boxbox}{-Boxcircle}+
115
116 Output: $\lrsuperscripts{\choice}{\boxbox}{\boxcircle}$
117 \item \Verb[commandchars=-\[\]]+\twolscripts{-Choice}{-Boxbox}{-Boxcircle}+
118
119 Output: $\twolscripts{\choice}{\boxbox}{\boxcircle}$
120 \item \Verb[commandchars=-\[\]]+\tworscripts{-Choice}{-Boxbox}{-Boxcircle}+
121
122 Output: $\tworscripts{\choice}{\boxbox}{\boxcircle}$
123 \item \Verb[commandchars=-\[\]]+\lsubscript{-Choice}{-Boxbox}+
124
125 Output: $\lsubscript{\choice}{\boxbox}$
126 \item \Verb[commandchars=-\[\]]+\lsuperscript{-Choice}{-Boxbox}+
127
128 Output: $\lsuperscript{\choice}{\boxbox}$
129 \item \Verb[commandchars=-\[\]]+\rsubscript{-Choice}{-Boxbox}+
130
131 Output: $\rsubscript{\choice}{\boxbox}$
132 \item \Verb[commandchars=-\[\]]+\rsuperscript{-Choice}{-Boxbox}+
133
134 Output: $\rsuperscript{\choice}{\boxbox}$
135 \end{itemize}}
136
137 \artsubsection{Changing the default lengths}
138 The following commands can be used to change the default skips between subscripts and/or superscripts and \Choice:
139 \begin{itemize}
140 \item\Verb[commandchars=-\[\]]+\setSingleLSkip{-Elll}+ changes the value of \Verb+\singleleftscriptskip+ to \Elll: this affects the skip in all the commands putting a subscript and/or a superscript on the left side of \Choice;
141 \item\Verb[commandchars=-\[\]]+\setSingleRSkip{-Ellr}+ changes the value of \Verb+\singlerightscriptskip+ to \Ellr: this affects the skip in all the commands putting a subscript and/or a superscript on the right side of \Choice;
142 \item\Verb[commandchars=-\[\]]+\setDblLSkip{-Elll}+ changes the value of \Verb+\dblleftscriptskip+ to \Elll: this affects the left skip in all the commands putting a subscript and/or a superscript on both sides of \Choice;
143 \item\Verb[commandchars=-\[\]]+\setDblRSkip{-Ellr}+ changes the value of \Verb+\dblrightscriptskip+ to \Ellr: this affects the right skip in all the commands putting a subscript and/or a superscript on both sides of \Choice.
144 \end{itemize}
145
146 \artsubsection{Custom lengths}
147 If you want to define the left and right skip on the sides of \Choice\ each time you write a command, you have the following options ($\ell_I$ is 2ex in these examples):
148
149 \begin{itemize}
150 \item \Verb[commandchars=-\[\]]+\fourscriptsC{-Choice}{-Boxast}{-Boxbox}{-Boxcircle}{-Boxbslash}{-Elll}{-Ellr}+
151
152 Output: $\fourscriptsC{\choice}{\boxast}{\boxbox}{\boxcircle}{\boxbslash}{2ex}{2ex}$
153 \item \Verb[commandchars=-\[\]]+\lrsubscriptsC{-Choice}{-Boxbox}{-Boxcircle}{-Elll}{-Ellr}+
154
155 Output: $\lrsubscriptsC{\choice}{\boxbox}{\boxcircle}{2ex}{2ex}$
156 \item \Verb[commandchars=-\[\]]+\lrsuperscriptsC{-Choice}{-Boxbox}{-Boxcircle}{-Elll}{-Ellr}+
157
158 Output: $\lrsuperscriptsC{\choice}{\boxbox}{\boxcircle}{2ex}{2ex}$
159 \item \Verb[commandchars=-\(\)]+\twolscripts[-Elll]{-Choice}{-Boxbox}{-Boxcircle}+
160
161 Output: $\twolscripts[2ex]{\choice}{\boxbox}{\boxcircle}$
162 \item \Verb[commandchars=-\(\)]+\tworscripts[-Ellr]{-Choice}{-Boxbox}{-Boxcircle}+
163
164 Output: $\tworscripts[2ex]{\choice}{\boxbox}{\boxcircle}$
165 \item \Verb[commandchars=-\(\)]+\lsubscript[-Elll]{-Choice}{-Boxbox}+
166
167 Output: $\lsubscript[2ex]{\choice}{\boxbox}$
168 \item \Verb[commandchars=-\(\)]+\lsuperscript[-Elll]{-Choice}{-Boxbox}+
169
170 Output: $\lsuperscript[2ex]{\choice}{\boxbox}$
171 \item \Verb[commandchars=-\(\)]+\rsubscript[-Ellr]{-Choice}{-Boxbox}+
172
173 Output: $\rsubscript[2ex]{\choice}{\boxbox}$
174 \item \Verb[commandchars=-\(\)]+\rsuperscript[-Ellr]{-Choice}{-Boxbox}+
175
176 Output: $\rsuperscript[2ex]{\choice}{\boxbox}$
177 \end{itemize}
178
179
180 \artsection{What does the package actually contains?}
181 You don't really need to read the following stuff to use the package, but have a look at it if you want to have an idea of how the package works without looking at the code.
182
183 \artsubsection{Lengths definitions}\label{lengths}
184 This lenghts are used to define the default skips on the left and on the right side of $\choice$.
185 \begin{itemize}
186 \item\Verb+\singleleftscriptskip+: default -0.27ex, larger\footnote{This is obtained after invoking the \verb+\largerSkips+ command.} -0.16ex;
187 \item\Verb+\singlerightscriptskip+: default -0.18ex, larger -0.07ex;
188 \item\Verb+\dblleftscriptskip+: default -0.75ex, larger 0ex;
189 \item\Verb+\dblrightscriptskip+: default -0.645ex, larger 0ex.
190 \end{itemize}
191
192 \artsubsection{Base commands}
193 The base commands are only three, all the rest is built on top of them:
194
195 \begin{itemize}
196 \item\Verb+\newcommand{\fourscriptsC}[7]+
197
198 \hspace{4ex}\Verb+{{\null}^{#2}_{#3}\hspace{#6}#1\hspace{#7}{\null}^{#4}_{#5}}+
199
200 \item\Verb+\newcommand{\twolscripts}[4]+
201
202 \hspace{4ex}\Verb+[\singleleftscriptskip]{{\null}^{#3}_{#4}\hspace{#1}#2}+
203
204 \item\Verb+\newcommand{\tworscripts}[4]+
205
206 \hspace{4ex}\Verb+[\singlerightscriptskip]{#2\hspace{#1}{\null}^{#3}_{#4}}+
207 \end{itemize}
208
209 \artsection{Contacts}
210 As you can see this package boils down to just a few new command definitions, but it can help save some time --- I wrote it because I was not really satisfied of what I had found searching the web.
211
212 \ppar
213 If you have comments or want to report any bug, please send a mail to \textsl{\href{mailto:[email protected]}{[email protected]}}.
214
215 \end{document}