From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- macros/latex/contrib/subsupscripts/README | 5 + .../latex/contrib/subsupscripts/SubSupScripts.pdf | Bin 0 -> 109791 bytes .../latex/contrib/subsupscripts/SubSupScripts.tex | 215 +++++++++++++++++++++ .../latex/contrib/subsupscripts/subsupscripts.sty | 30 +++ 4 files changed, 250 insertions(+) create mode 100644 macros/latex/contrib/subsupscripts/README create mode 100644 macros/latex/contrib/subsupscripts/SubSupScripts.pdf create mode 100644 macros/latex/contrib/subsupscripts/SubSupScripts.tex create mode 100644 macros/latex/contrib/subsupscripts/subsupscripts.sty (limited to 'macros/latex/contrib/subsupscripts') diff --git a/macros/latex/contrib/subsupscripts/README b/macros/latex/contrib/subsupscripts/README new file mode 100644 index 0000000000..68642a504d --- /dev/null +++ b/macros/latex/contrib/subsupscripts/README @@ -0,0 +1,5 @@ +The package SubSupScripts provides some new more flexible commands to typeset +subscripts and superscripts in mathematical mode. + +Author: Riccardo Bresciani +License type: lppl \ No newline at end of file diff --git a/macros/latex/contrib/subsupscripts/SubSupScripts.pdf b/macros/latex/contrib/subsupscripts/SubSupScripts.pdf new file mode 100644 index 0000000000..f2c3acbfab Binary files /dev/null and b/macros/latex/contrib/subsupscripts/SubSupScripts.pdf differ diff --git a/macros/latex/contrib/subsupscripts/SubSupScripts.tex b/macros/latex/contrib/subsupscripts/SubSupScripts.tex new file mode 100644 index 0000000000..3d3e9c35d9 --- /dev/null +++ b/macros/latex/contrib/subsupscripts/SubSupScripts.tex @@ -0,0 +1,215 @@ +\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} diff --git a/macros/latex/contrib/subsupscripts/subsupscripts.sty b/macros/latex/contrib/subsupscripts/subsupscripts.sty new file mode 100644 index 0000000000..2fdea5cdf1 --- /dev/null +++ b/macros/latex/contrib/subsupscripts/subsupscripts.sty @@ -0,0 +1,30 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{subsupscripts}[2009/10/27 v1.0] + +% Default skips +\newcommand{\singleleftscriptskip}{-0.27ex} +\newcommand{\singlerightscriptskip}{-0.18ex} +\newcommand{\dblleftscriptskip}{-0.75ex} +\newcommand{\dblrightscriptskip}{-0.645ex} + +% Customize skips +\newcommand{\setSingleLSkip}[1]{\renewcommand{\singleleftscriptskip}{#1}} +\newcommand{\setSingleRSkip}[1]{\renewcommand{\singlerightscriptskip}{#1}} +\newcommand{\setDblLSkip}[1]{\renewcommand{\dblleftscriptskip}{#1}} +\newcommand{\setDblRSkip}[1]{\renewcommand{\dblrightscriptskip}{#1}} + +\newcommand{\largerSkips}{\setSingleLSkip{-0.16ex}\setSingleRSkip{-0.07ex}\setDblLSkip{0ex}\setDblRSkip{0ex}} + +% Scripts commands +\newcommand{\fourscriptsC}[7]{{\null}^{#2}_{#3}\hspace{#6}#1\hspace{#7}{\null}^{#4}_{#5}} +\newcommand{\lrsubscriptsC}[5]{\fourscriptsC{#1}{}{#2}{}{#3}{#4}{#5}} +\newcommand{\lrsuperscriptsC}[5]{\fourscriptsC{#1}{#2}{}{#3}{}{#4}{#5}} +\newcommand{\fourscripts}[5]{\fourscriptsC{#1}{#2}{#3}{#4}{#5}{\dblleftscriptskip}{\dblrightscriptskip}} +\newcommand{\lrsubscripts}[3]{\fourscripts{#1}{}{#2}{}{#3}} +\newcommand{\lrsuperscripts}[3]{\fourscripts{#1}{#2}{}{#3}{}} +\newcommand{\twolscripts}[4][\singleleftscriptskip]{{\null}^{#3}_{#4}\hspace{#1}#2} +\newcommand{\tworscripts}[4][\singlerightscriptskip]{#2\hspace{#1}{\null}^{#3}_{#4}} +\newcommand{\lsubscript}[3][\singleleftscriptskip]{\twolscripts[#1]{#2}{}{#3}} +\newcommand{\lsuperscript}[3][\singleleftscriptskip]{\twolscripts[#1]{#2}{#3}{}} +\newcommand{\rsubscript}[3][\singlerightscriptskip]{\tworscripts[#1]{#2}{}{#3}} +\newcommand{\rsuperscript}[3][\singlerightscriptskip]{\tworscripts[#1]{#2}{#3}{}} \ No newline at end of file -- cgit v1.2.3