1

I'm looking for a way to reduce the default size of plus and minus signs that appear as indices.

Here is a dirty tex sample:

One has the following commutation relations:
\[  \left\{ \, \begin{aligned}
    \partial_k \, \partial_p &= \partial_{p-1} \, \partial_k  
        & \mathrm{if} & \quad k < p \\
    \partial_k \, \partial_p &= \partial_p \, \partial_{k+1}  
        & \mathrm{if} & \quad k \geq p
\end{aligned} \right. \]

which renders as:

enter image description here

My problem is that + and - signs take way more space than the p and k indices. I would be greatly relieved if I could get something as good looking as this previous code monospace font.

Does anyone know how I could achieve this?

A full MWE:

\documentclass{article}
\begin{document}
\[ \partial_k \partial_p = \partial_{p-1}\partial_k
    \quad \mathrm{if} \quad k < p \]
\[ \partial_k \partial_p = \partial_p\partial_{k+1}
    \quad \mathrm{if} \quad k \geq p \]
\end{document}
Mico
  • 506,678
shevket
  • 147
  • 9

1 Answers1

1

The following, LuaLaTeX-based solution may be of interest to you. The solution consists of (a) a Lua function, called smaller_plus_minus, which scans all input lines for occurrences of - and + located inside a subscript or superscript group and (if found) replaces these occurrences with smaller versions of the symbols in question and (b) LaTeX macros to activate and deactivate the Lua function. Multiple instances of - or + per subscript or superscript group are permitted.

The main working assumption made here is that the subscript and superscript material is always delimited by a matching pair of curly braces ({ and }), e.g., a_{p-q} and b^{u+v}. The Lua function will not operate on instances of a_- or b^+. I trust this isn't much of a constraint.

The Lua function is currently set to operate on all input, including material that may be inside verbatim-like environments. That's presumably undesirable. If your document contains verbatim-like material, I suggest you run \DeactivateSmallerPlusMinus before the start of the material in question -- and run \ActivateSmallerPlusMinus after the end of the verbatim-like material.

enter image description here

Honestly, I don't think it's a great idea to reduce the sizes of + and - in subscript and superscript material.

% !TeX program = lualatex
\documentclass{article}
\usepackage{mathtools} % for "dcases" env.

%% Lua-side code
\usepackage{luacode}
%% Lua-side code
\usepackage{luacode}
\begin{luacode}
local function sub_to_tiny ( u , v )
  return u .. v:gsub ( "[%+%-]" , "\\mathrel{\\vcenter{\\hbox{\\tiny$%0$}}}" ) 
end
function smaller_plus_minus ( s )
  return s:gsub ( "([_%^])%s-(%b{})" , sub_to_tiny ) 
end
\end{luacode}

%% LaTeX-side code
\newcommand\ActivateSmallerPlusMinus{\directlua{luatexbase.add_to_callback 
    ( "process_input_buffer", smaller_plus_minus, "smaller_plus_minus" )}}
\newcommand\DeactivateSmallerPlusMinus{\directlua{luatexbase.remove_from_callback 
    ( "process_input_buffer", "smaller_plus_minus" )}}
\AtBeginDocument{\ActivateSmallerPlusMinus} % activate lua function by default

\begin{document}
$\displaystyle\begin{dcases}
    \partial_k\partial_p = \partial_{p-1}\partial_k & \text{if $k < p$} \\
    \partial_k\partial_p = \partial_p\partial_{k+1} & \text{if $k \geq p$}
\end{dcases}$

\medskip
$\partial_{p-q}$, $\partial_{k+\ell}$, $a_{--}$, $b^{++}$
vs.\par
\DeactivateSmallerPlusMinus % remove lua function from callback
$\partial_{p-q}$, $\partial_{k+\ell}$, $a_{--}$, $b^{++}$
\end{document} 
Mico
  • 506,678