| 1 |
% \iffalse meta comment |
| 2 |
% File: leftidx.dtx Copyright (C) 2000, 2001, 2003 Harald Harders |
| 3 |
% \fi |
| 4 |
% |
| 5 |
% \iffalse |
| 6 |
% |
| 7 |
%<*package> |
| 8 |
\def\fileversion{1.03} |
| 9 |
\def\filedate{2003/09/24} |
| 10 |
%</package> |
| 11 |
%<*driver> |
| 12 |
\documentclass{ltxdoc} |
| 13 |
\usepackage[latin1]{inputenc} |
| 14 |
\IfFileExists{leftidx.sty}{\usepackage{leftidx} |
| 15 |
\let\leftidxSTYfound\active}{\GenericWarning{leftidx.dtx}{Package |
| 16 |
file leftidx.sty not found (Documentation will be messed up!^^J^^A |
| 17 |
Generate leftidx.sty by (La)TeXing leftidx.ins, process |
| 18 |
leftidx.dtx again)^^J}\stop} |
| 19 |
\usepackage{longtable} |
| 20 |
\title{The \texttt{leftidx} package\thanks{This file has version |
| 21 |
\fileversion\ last revised \filedate.}} |
| 22 |
\author{Harald Harders\\\texttt{[email protected]}} |
| 23 |
\date{File Date \filedate, Printed \today} |
| 24 |
\newlength{\tempdima}% |
| 25 |
\makeatletter |
| 26 |
\renewenvironment{table}[1][]{% |
| 27 |
\@float{table}[#1]% |
| 28 |
\centering% |
| 29 |
\setlength{\tempdima}{\abovecaptionskip}% |
| 30 |
\setlength{\abovecaptionskip}{\belowcaptionskip}% |
| 31 |
\setlength{\belowcaptionskip}{\tempdima}% |
| 32 |
}{% |
| 33 |
\end@float |
| 34 |
} |
| 35 |
\makeatother |
| 36 |
\EnableCrossrefs |
| 37 |
\CodelineIndex |
| 38 |
\DoNotIndex{\def,\edef,\let,\newcommand,\newenvironment,\newcounter} |
| 39 |
\DoNotIndex{\setcounter,\space,\if,\else,\fi,\empty,\@empty,\ifx,\fi} |
| 40 |
\DoNotIndex{\ifnum,\fi,\expandafter} |
| 41 |
\CodelineNumbered |
| 42 |
\RecordChanges |
| 43 |
\CheckSum{14} |
| 44 |
\begin{document} |
| 45 |
\DocInput{leftidx.dtx} |
| 46 |
\end{document} |
| 47 |
%</driver> |
| 48 |
% \fi |
| 49 |
% |
| 50 |
% \changes{1.03}{2003/09/24}{Reimplementation with dtx format with |
| 51 |
% English documentation}% |
| 52 |
% |
| 53 |
% \maketitle |
| 54 |
% \begin{abstract} |
| 55 |
% \noindent |
| 56 |
% This package enables left subscripts and superscripts in math mode. |
| 57 |
% These subscripts and superscripts are automatically raised for better |
| 58 |
% fitting to the symbol they belong to. |
| 59 |
% \end{abstract} |
| 60 |
% |
| 61 |
% \tableofcontents |
| 62 |
% |
| 63 |
% \section*{Copyright} |
| 64 |
% Copyright 2000, 2001, 2003 Harald Harders. |
| 65 |
% |
| 66 |
% This program can be redistributed and/or modified under the terms |
| 67 |
% of the LaTeX Project Public License Distributed from CTAN |
| 68 |
% archives in directory macros/latex/base/lppl.txt; either |
| 69 |
% version 1 of the License, or any later version. |
| 70 |
% |
| 71 |
% \section{Introduction} |
| 72 |
% |
| 73 |
% In mathematical equations, it is sometimes necessary to use indices |
| 74 |
% (subscript or superscript) that are positioned at the left side of a |
| 75 |
% symbol. |
| 76 |
% In tensor mathematics, for instance, some notations use a transponed |
| 77 |
% sign at the left side of the symbol: |
| 78 |
% \begin{eqnarray*} |
| 79 |
% \leftidx{^\mathrm{t}}{\left(A_{ij}\right)}{} &=& |
| 80 |
% \left(A_{ji}\right) |
| 81 |
% \end{eqnarray*} |
| 82 |
% |
| 83 |
% For symbols with a normal character height, this can be reached by |
| 84 |
% simply put the indices without an own symbol: |
| 85 |
% |
| 86 |
% \noindent |
| 87 |
% \begin{minipage}[c]{0.79\linewidth} |
| 88 |
% \leavevmode\begin{verbatim} |
| 89 |
%${_1^2}a_3^4$ |
| 90 |
% \end{verbatim} |
| 91 |
% \end{minipage} |
| 92 |
% \begin{minipage}[c]{0.19\linewidth} |
| 93 |
% ${_1^2}a_3^4$ |
| 94 |
% \end{minipage} |
| 95 |
% |
| 96 |
% \noindent |
| 97 |
% Is the symbol larger, this leads to unsatisfactory results: |
| 98 |
% |
| 99 |
% \noindent |
| 100 |
% \begin{minipage}[c]{0.79\linewidth} |
| 101 |
% \leavevmode\begin{verbatim} |
| 102 |
%${_1^2}\left(\frac{1}{b}\right)_3^4$ |
| 103 |
% \end{verbatim} |
| 104 |
% \end{minipage} |
| 105 |
% \begin{minipage}[c]{0.19\linewidth} |
| 106 |
% ${_1^2}\left(\frac{1}{b}\right)_3^4$ |
| 107 |
% \end{minipage} |
| 108 |
% |
| 109 |
% \noindent |
| 110 |
% A better output can be reached by using the package |leftidx.sty|: |
| 111 |
% |
| 112 |
% \noindent |
| 113 |
% \begin{minipage}[c]{0.79\linewidth} |
| 114 |
% \leavevmode\begin{verbatim} |
| 115 |
%$\leftidx{_1^2}{\left(\frac{1}{b}\right)}{_3^4}$ |
| 116 |
% \end{verbatim} |
| 117 |
% \end{minipage} |
| 118 |
% \begin{minipage}[c]{0.19\linewidth} |
| 119 |
%$\leftidx{_1^2}{\left(\frac{1}{b}\right)}{_3^4}$ |
| 120 |
% \end{minipage} |
| 121 |
% |
| 122 |
% \section{Usage of the package} |
| 123 |
% |
| 124 |
% Two commands are provided by the package. |
| 125 |
% |
| 126 |
% \DescribeMacro{\leftidx}% |
| 127 |
% The \cs{leftidx} command has the syntax |
| 128 |
% \cs{leftidx}\marg{left indices}\marg{symbol}\marg{right indices}. |
| 129 |
% This command typesets the symbol \meta{symbol} with indices on the |
| 130 |
% left and on the right side. |
| 131 |
% Example: |
| 132 |
% |
| 133 |
% \noindent |
| 134 |
% \begin{minipage}[c]{0.79\linewidth} |
| 135 |
% \leavevmode\begin{verbatim} |
| 136 |
%$\leftidx{_1^2}{\left(\frac{1}{b}\right)}{_3^4}$ |
| 137 |
% \end{verbatim} |
| 138 |
% \end{minipage} |
| 139 |
% \begin{minipage}[c]{0.19\linewidth} |
| 140 |
% $\leftidx{_1^2}{\left(\frac{1}{b}\right)}{_3^4}$ |
| 141 |
% \end{minipage} |
| 142 |
% |
| 143 |
% \noindent |
| 144 |
% You may omit left or right indices by using empty arguments. |
| 145 |
% |
| 146 |
% The next example shows the same in the different mathematical |
| 147 |
% styles: |
| 148 |
% \def\asdf{\leftidx{_1^2}{\left(\frac1b\right)}{_3^4}}% |
| 149 |
% \begin{displaymath} |
| 150 |
% \displaystyle\asdf\quad\textstyle\asdf\quad |
| 151 |
% \scriptstyle\asdf\quad\scriptscriptstyle\asdf |
| 152 |
% \end{displaymath} |
| 153 |
% As you can see from the left indices, the horizontal spacing of the |
| 154 |
% left indices is not perfect. |
| 155 |
% You have to adjust them by yourself. |
| 156 |
% |
| 157 |
% \DescribeMacro{\ltrans}% |
| 158 |
% The \cs{ltrans}\marg{symbol} command typesets a small upright ``t'' |
| 159 |
% as transponed sign on the left side of \meta{symbol}. |
| 160 |
% Example: |
| 161 |
% |
| 162 |
% \noindent |
| 163 |
% \begin{minipage}[c]{0.79\linewidth} |
| 164 |
% \leavevmode\begin{verbatim} |
| 165 |
%$\ltrans{\underline{\underline{J}}}= |
| 166 |
%\underline{\underline{J}}^{-1}$ |
| 167 |
% \end{verbatim} |
| 168 |
% \end{minipage} |
| 169 |
% \begin{minipage}[c]{0.19\linewidth} |
| 170 |
% $\ltrans{\underline{\underline{J}}}=\underline{\underline{J}}^{-1}$ |
| 171 |
% \end{minipage} |
| 172 |
% |
| 173 |
% |
| 174 |
% \StopEventually{\PrintChanges \PrintIndex} |
| 175 |
% |
| 176 |
% \section{The implementation} |
| 177 |
% \iffalse |
| 178 |
%<*package> |
| 179 |
% \fi |
| 180 |
% Heading of the package: |
| 181 |
% \begin{macrocode} |
| 182 |
\NeedsTeXFormat{LaTeX2e}[1995/12/01] |
| 183 |
\ProvidesPackage{leftidx}[\filedate\space v\fileversion\space Left indices] |
| 184 |
% \end{macrocode} |
| 185 |
% \begin{macro}{\leftidx} |
| 186 |
% \changes{1.03}{2003/09/24}{Implementation simplyfied}% |
| 187 |
% Command for left indices. |
| 188 |
% The braces around the \cs{vphantom} are necessary to really raise |
| 189 |
% the left indices. |
| 190 |
% \begin{macrocode} |
| 191 |
\newcommand\leftidx[3]{% |
| 192 |
{\vphantom{#2}}#1#2#3% |
| 193 |
} |
| 194 |
% \end{macrocode} |
| 195 |
% \end{macro} |
| 196 |
% \begin{macro}{\ltrans} |
| 197 |
% Left positioned transponed sign. |
| 198 |
% \begin{macrocode} |
| 199 |
\newcommand{\ltrans}[1]{\leftidx{^\mathrm{t}}{\!#1}{}} |
| 200 |
% \end{macrocode} |
| 201 |
% \end{macro} |
| 202 |
% |
| 203 |
% \iffalse |
| 204 |
%</package> |
| 205 |
% \fi |
| 206 |
% \Finale |
| 207 |
|