\documentclass[green,a4paper,oneside,openany,noparindent,noparskip,article,nomatter]{bookest} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{subsupscripts} \usepackage{fancyvrb} \usepackage{stmaryrd} \usepackage{palatino} \usepackage{hyperref} \VerbatimFootnotes \newcommand{\choice}{\oplus} % Usual notation \newcommand{\Choice}{$\choice$} \newcommand{\Boxast}{$\boxast$} \newcommand{\Boxcircle}{$\boxcircle$} \newcommand{\Boxbslash}{$\boxbslash$} \newcommand{\Boxbox}{$\boxbox$} \newcommand{\Elll}{$\ell_L$} \newcommand{\Ellr}{$\ell_R$} \setbibname{References} \setleftmark{} \setrightmark{} %pdfLaTeX \hypersetup{ pdftitle={SubSupScripts}, pdfsubject={A LaTeX package to provide new commands for subscripts and superscripts.}, pdfauthor={Riccardo Bresciani}, pdfkeywords={SubSupScripts, LaTeX, Subscript, Superscript, TeX}, pdfstartview=FitV, %colorlinks } % Aliases \newcommand{\ie}{\emph{i.e.} } \author{Riccardo Bresciani} \title{SubSupScripts\hfill{\small\href{http://tex.nopkoguo.net/subsupscripts}{http://tex.nopkoguo.net/subsupscripts}}} \newcommand{\belowLine}{{\normalsize Version 1.0 --- \today}} \makeatletter \renewcommand{\maketitle}{\thispagestyle{plain}{\Huge\textbf{\colorB\@title}\Large\\\vspace{2ex} \@author{\colorA\hrule}\vspace{1ex}\belowLine\\\vspace{2ex}}} \makeatother \geometry{ hmargin=2.3cm, vmargin={3cm,3cm}, bindingoffset=0mm, columnsep=20pt } \begin{document} \maketitle \begin{abstract}{Brief description of the package:} This package provides some new more flexible commands to typeset subscripts and superscripts in mathematical mode. \end{abstract} \artsection{Usage} \artsubsection{Default lengths} 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. \begin{itemize} \item \Verb[commandchars=-\[\]]+\fourscripts{-Choice}{-Boxast}{-Boxbox}{-Boxcircle}{-Boxbslash}+ Output: $\fourscripts{\choice}{\boxast}{\boxbox}{\boxcircle}{\boxbslash}$ \item \Verb[commandchars=-\[\]]+\lrsubscripts{-Choice}{-Boxbox}{-Boxcircle}+ Output: $\lrsubscripts{\choice}{\boxbox}{\boxcircle}$ \item \Verb[commandchars=-\[\]]+\lrsuperscripts{-Choice}{-Boxbox}{-Boxcircle}+ Output: $\lrsuperscripts{\choice}{\boxbox}{\boxcircle}$ \item \Verb[commandchars=-\[\]]+\twolscripts{-Choice}{-Boxbox}{-Boxcircle}+ Output: $\twolscripts{\choice}{\boxbox}{\boxcircle}$ \item \Verb[commandchars=-\[\]]+\tworscripts{-Choice}{-Boxbox}{-Boxcircle}+ Output: $\tworscripts{\choice}{\boxbox}{\boxcircle}$ \item \Verb[commandchars=-\[\]]+\lsubscript{-Choice}{-Boxbox}+ Output: $\lsubscript{\choice}{\boxbox}$ \item \Verb[commandchars=-\[\]]+\lsuperscript{-Choice}{-Boxbox}+ Output: $\lsuperscript{\choice}{\boxbox}$ \item \Verb[commandchars=-\[\]]+\rsubscript{-Choice}{-Boxbox}+ Output: $\rsubscript{\choice}{\boxbox}$ \item \Verb[commandchars=-\[\]]+\rsuperscript{-Choice}{-Boxbox}+ Output: $\rsuperscript{\choice}{\boxbox}$ \end{itemize} \artsubsection{Larger skips} \largerSkips 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. \begin{itemize} \item \Verb[commandchars=-\[\]]+\fourscripts{-Choice}{-Boxast}{-Boxbox}{-Boxcircle}{-Boxbslash}+ Output: $\fourscripts{\choice}{\boxast}{\boxbox}{\boxcircle}{\boxbslash}$ \item \Verb[commandchars=-\[\]]+\lrsubscripts{-Choice}{-Boxbox}{-Boxcircle}+ Output: $\lrsubscripts{\choice}{\boxbox}{\boxcircle}$ \item \Verb[commandchars=-\[\]]+\lrsuperscripts{-Choice}{-Boxbox}{-Boxcircle}+ Output: $\lrsuperscripts{\choice}{\boxbox}{\boxcircle}$ \item \Verb[commandchars=-\[\]]+\twolscripts{-Choice}{-Boxbox}{-Boxcircle}+ Output: $\twolscripts{\choice}{\boxbox}{\boxcircle}$ \item \Verb[commandchars=-\[\]]+\tworscripts{-Choice}{-Boxbox}{-Boxcircle}+ Output: $\tworscripts{\choice}{\boxbox}{\boxcircle}$ \item \Verb[commandchars=-\[\]]+\lsubscript{-Choice}{-Boxbox}+ Output: $\lsubscript{\choice}{\boxbox}$ \item \Verb[commandchars=-\[\]]+\lsuperscript{-Choice}{-Boxbox}+ Output: $\lsuperscript{\choice}{\boxbox}$ \item \Verb[commandchars=-\[\]]+\rsubscript{-Choice}{-Boxbox}+ Output: $\rsubscript{\choice}{\boxbox}$ \item \Verb[commandchars=-\[\]]+\rsuperscript{-Choice}{-Boxbox}+ Output: $\rsuperscript{\choice}{\boxbox}$ \end{itemize}} \artsubsection{Changing the default lengths} The following commands can be used to change the default skips between subscripts and/or superscripts and \Choice: \begin{itemize} \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; \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; \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; \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. \end{itemize} \artsubsection{Custom lengths} 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): \begin{itemize} \item \Verb[commandchars=-\[\]]+\fourscriptsC{-Choice}{-Boxast}{-Boxbox}{-Boxcircle}{-Boxbslash}{-Elll}{-Ellr}+ Output: $\fourscriptsC{\choice}{\boxast}{\boxbox}{\boxcircle}{\boxbslash}{2ex}{2ex}$ \item \Verb[commandchars=-\[\]]+\lrsubscriptsC{-Choice}{-Boxbox}{-Boxcircle}{-Elll}{-Ellr}+ Output: $\lrsubscriptsC{\choice}{\boxbox}{\boxcircle}{2ex}{2ex}$ \item \Verb[commandchars=-\[\]]+\lrsuperscriptsC{-Choice}{-Boxbox}{-Boxcircle}{-Elll}{-Ellr}+ Output: $\lrsuperscriptsC{\choice}{\boxbox}{\boxcircle}{2ex}{2ex}$ \item \Verb[commandchars=-\(\)]+\twolscripts[-Elll]{-Choice}{-Boxbox}{-Boxcircle}+ Output: $\twolscripts[2ex]{\choice}{\boxbox}{\boxcircle}$ \item \Verb[commandchars=-\(\)]+\tworscripts[-Ellr]{-Choice}{-Boxbox}{-Boxcircle}+ Output: $\tworscripts[2ex]{\choice}{\boxbox}{\boxcircle}$ \item \Verb[commandchars=-\(\)]+\lsubscript[-Elll]{-Choice}{-Boxbox}+ Output: $\lsubscript[2ex]{\choice}{\boxbox}$ \item \Verb[commandchars=-\(\)]+\lsuperscript[-Elll]{-Choice}{-Boxbox}+ Output: $\lsuperscript[2ex]{\choice}{\boxbox}$ \item \Verb[commandchars=-\(\)]+\rsubscript[-Ellr]{-Choice}{-Boxbox}+ Output: $\rsubscript[2ex]{\choice}{\boxbox}$ \item \Verb[commandchars=-\(\)]+\rsuperscript[-Ellr]{-Choice}{-Boxbox}+ Output: $\rsuperscript[2ex]{\choice}{\boxbox}$ \end{itemize} \artsection{What does the package actually contains?} 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. \artsubsection{Lengths definitions}\label{lengths} This lenghts are used to define the default skips on the left and on the right side of $\choice$. \begin{itemize} \item\Verb+\singleleftscriptskip+: default -0.27ex, larger\footnote{This is obtained after invoking the \verb+\largerSkips+ command.} -0.16ex; \item\Verb+\singlerightscriptskip+: default -0.18ex, larger -0.07ex; \item\Verb+\dblleftscriptskip+: default -0.75ex, larger 0ex; \item\Verb+\dblrightscriptskip+: default -0.645ex, larger 0ex. \end{itemize} \artsubsection{Base commands} The base commands are only three, all the rest is built on top of them: \begin{itemize} \item\Verb+\newcommand{\fourscriptsC}[7]+ \hspace{4ex}\Verb+{{\null}^{#2}_{#3}\hspace{#6}#1\hspace{#7}{\null}^{#4}_{#5}}+ \item\Verb+\newcommand{\twolscripts}[4]+ \hspace{4ex}\Verb+[\singleleftscriptskip]{{\null}^{#3}_{#4}\hspace{#1}#2}+ \item\Verb+\newcommand{\tworscripts}[4]+ \hspace{4ex}\Verb+[\singlerightscriptskip]{#2\hspace{#1}{\null}^{#3}_{#4}}+ \end{itemize} \artsection{Contacts} 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. \ppar If you have comments or want to report any bug, please send a mail to \textsl{\href{mailto:subsupscripts@tex.nopkoguo.net}{subsupscripts@tex.nopkoguo.net}}. \end{document}