GeneralCan I have more control over my subscripts?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
viktiglemma
Posts: 5
Joined: Tue Apr 01, 2008 3:54 pm

Can I have more control over my subscripts?

Post by viktiglemma »

Hi,

I'm currently using a lot of subscripts in my work; however I see that the naive way of making them doesn't always turn out that well:

Code: Select all

\begin{equation}
\left(
\begin{array}{c}
n'_1+1\\
\vdots\\
n'_{K-1}
\end{array}
\right)
\end{equation}
With this code the last subscript seems too large. Any ideas on how I can make this look better?

Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Re: Can I have more control over my subscripts?

Post by Juanjo »

If I correctly understand, the problem is the size of the K letter. You could replace K by {\scriptscriptstyle K}, in which case, the K letter looks too small compared with 1. So you could try {\scriptscriptstyle K-1} instead of K-1. But once again, you should change 1 by {\scriptscriptstyle 1} in the first array entry to get homogeneous sizes. In my opinion, it is better to keep things as they are now. Or change K by a letter looking better.

By the way, instead of, \left( \begin{array}{c}.... \end{array} \right), I would use
\left( \begin{array}{@{}c@{}}.... \end{array} \right) or even simpler \begin{pmatrix}... \end{pmatrix}. The pmatrix environment is defined in the amsmath package.
balf
Posts: 158
Joined: Sat Jan 12, 2008 1:11 am

Re: Can I have more control over my subscripts?

Post by balf »

The previous solution has the drawback of making the stroke width used for K thinner than that used for the rest of the index.
Another solution might be to use a small cap font, but this would require to define, say, a \mathsc command via a new math alphabet:
\DeclareMathAlphabet{\mathsc}{OT1}{cmr}{m}{sc}
(the encoding would be different if you want use the lm fonts, instead of the cm ones).

B.A.
viktiglemma
Posts: 5
Joined: Tue Apr 01, 2008 3:54 pm

Re: Can I have more control over my subscripts?

Post by viktiglemma »

Thanks for your replies, I think I'll be able to solve my problem now. Also thanks for the tip about pmatrix. I've been hoping to find something just like that for a while now.
curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Can I have more control over my subscripts?

Post by curiouslearn »

In response to the question about subscripts, balf suggested the following solution:

Code: Select all

\DeclareMathAlphabet{\mathsc}{OT1}{cmr}{m}{sc}
Is there a way to make the small caps letters rendered by this solution also italics. If yes, can someone please suggest how to do that?

Also, Juanjo I used the \scriptscriptstyle to make 1s in my subscripts smaller. I could not think of another way to do it.

Thanks.
balf
Posts: 158
Joined: Sat Jan 12, 2008 1:11 am

Re: Can I have more control over my subscripts?

Post by balf »

You can use the lm fonts for your whole document, which have a slanted smallcap shape and write
\DeclareMathAlphabet{\mathsc}{T1}{lmr}{m}{scsl}

Another solution might come from the slantsc package; see the details in the doc, but as far as I recall, the cmr font does have slanted small caps, which are not declared by default in the .fd file.

B.A.
curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Can I have more control over my subscripts?

Post by curiouslearn »

Thanks very much Balf. I appreciate your help. I will try out this solution. For the text and math I am actually using the charter font with

Code: Select all

\usepackage[charter]{mathdesign}

However, it seems charter does not have small caps either (I am not sure, but command \sc did not work with it). I will try out the lmr font. In case, you know of any other smallcaps that goes best with charter, please let me know.

Thanks.
balf
Posts: 158
Joined: Sat Jan 12, 2008 1:11 am

Re: Can I have more control over my subscripts?

Post by balf »

Unfortunately, I don't know any small caps font matching charter, except the commercial ones, of course. However, if you do not specifically need charter, but just want to change from the cm-lm-ec family, you might consider using Minion Pro, which has slanted, boldface ans slanted boldface small caps ; the Minion Pro package lets you use them with LaTeX (with some work, as they are in otf format; everything is well explained in the package doc). Also the Springer fonts (derived from Minion) can be used, with the sfonts package, from Walter Schmidt.

Regards,
B.A.
curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Can I have more control over my subscripts?

Post by curiouslearn »

Thanks Balf. Yes, MinionPro was on my list to try out. Though, I did not know that it had all those additional features. It looks nice and professional, but since it is a little work to use it, I will have to wait for a couple of weeks when I have the time to try it out.

I tried using the method you suggested yesterday. With that, unfortunately, when I have two letters in a subscript; such as

Code: Select all

x_{\mathsc{IR}}
, the second letter is a little smaller than the first one. I wonder why. Hence, I went with Juanjo suggestion and used

Code: Select all

x_{\scriptscriptstyle IR}
instead. That works pretty well for my case. Also, that way I can stick to the charter font.

Thanks again for your suggestions.
ptoche
Posts: 49
Joined: Thu Apr 12, 2007 10:41 am

Re: Can I have more control over my subscripts?

Post by ptoche »

Great tip.

My contribution is absolutely trivial:

In preamble, define:
\newcommand{\ms}{\scriptscriptstyle}

In text, type:
{\ms TEXT}

where "ms" stands for "math small"

it's just less tedious to type {\ms TEXT} instead of {\scriptscriptstyle TEXT}
Post Reply