2

I have a file with a lot of subscripts everywhere and I would like to make them more compact.

I can define \ms with \newcommand{\ms}{\scriptscriptstyle}

How can I redefine

_{}

so that it it applies a \ms (without having to type it every time, i.e., so that

_{} := _{\ms }

EDIT with usecase:

The reason I am looking for this is that what I am writing contains a lot of subscripting of the form

x_{i+k,t}

it has to be reported, but I feel most times to be cumbersome and unappealing to the eyes. A lot of the times it can be skipped while reading, so I just wanted to make it standout less.

  • See the answer by David Carlisle on how to change the font-size (which is what you want to do), in case you really want to redefine the meaning of the subscript, see answers e.g. here tex.stackexchange.com/questions/9333/… – Bort Aug 20 '15 at 10:24
  • Welcome to TeX.SX! It's not clear why you would want it. Can you be more precise? – egreg Aug 20 '15 at 10:34
  • Edited to explain usecase – Three Diag Aug 20 '15 at 10:54
4
% arara: pdflatex

\documentclass{article}
\catcode`_=\active
\newcommand_[1]{\ensuremath{\sb{\scriptscriptstyle #1}}}

\begin{document}
$A_x$
\end{document}
  • This answer the question. Coupled with David's answer allows for some finetuning of subscripts. Thanks! – Three Diag Aug 20 '15 at 10:54
  • What's \ensuremath for? – egreg Aug 20 '15 at 10:56
  • @egreg If you want to use it in text as well. That was not so clear from the question. Does not hurt in any case. – LaRiFaRi Aug 20 '15 at 11:41
8
\RequirePackage{fix-cm}
\documentclass{article}

\DeclareMathSizes{10}{10}{3}{3}

\begin{document}

aa $V_1 V_2 $

\end{document}

3pt is rather small, just used to exaggerate the effect, the standard sizes are 7 and 5 so you could use {10}{10}{5}{5} (in which case you would not need the fix-cm package which is just used to allow the font to be scaled to arbitrary sizes)

The standard sizes (display, text, script and scriptscript) set by latex are:

 \DeclareMathSizes{5}{5}{5}{5}
 \DeclareMathSizes{6}{6}{5}{5}
 \DeclareMathSizes{7}{7}{5}{5}
 \DeclareMathSizes{8}{8}{6}{5}
 \DeclareMathSizes{9}{9}{6}{5}
 \DeclareMathSizes{\@xpt}{\@xpt}{7}{5}
 \DeclareMathSizes{\@xipt}{\@xipt}{8}{6}
 \DeclareMathSizes{\@xiipt}{\@xiipt}{8}{6}
 \DeclareMathSizes{\@xivpt}{\@xivpt}{\@xpt}{7}
 \DeclareMathSizes{\@xviipt}{\@xviipt}{\@xiipt}{\@xpt}
 \DeclareMathSizes{\@xxpt}{\@xxpt}{\@xivpt}{\@xiipt}
 \DeclareMathSizes{\@xxvpt}{\@xxvpt}{\@xxpt}{\@xviipt}
  • This is nice, but it alters my superscript as well. I am in fact using yours and @LaRiFaRi answer to achieve the desired result(I make subscripting smaller by default, and tune how small I want it by tweaking the /scriptscriptstyle size). This is probably not best in general, but suits the notation required by my current work. Thanks ! – Three Diag Aug 20 '15 at 10:32
  • 1
    What do the {\@xpt} do? – Three Diag Aug 20 '15 at 10:46
  • 1
    @ThreeDiag \@xpt is 10pt, such abbreviations are used all over the latex sources (and save a few bytes that needed saving back then) – David Carlisle Aug 20 '15 at 11:19
3

I think it's a very bad idea. This said, here's how:

\documentclass{article}

\begingroup\lccode`~=`_
\lowercase{\endgroup\def~}#1{_{\scriptscriptstyle#1}}

\AtBeginDocument{\mathcode`_="8000 \catcode`_=12 }

\begin{document}

New: $A_1^2$

Original: $A_{\scriptstyle1}^2$

\end{document}

enter image description here

  • Yeah, you are right that this is a bad idea in general. For the small report I need to write (where I don't expect to have other math environment requiring a different treatment) it should be alright. – Three Diag Aug 20 '15 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.