8

When I add a sub- or superscript to a letter in a "Text" cell using the "Writing Assistant" palette this letter becomes Italic:

screenshot

Moreover the letter "v" in the subscript is wrongly formatted as being a variable. How to typeset it as Plain?

Alexey Popkov
  • 61,809
  • 7
  • 149
  • 368
  • 1
    SingleLetterItalics -> False? – rm -rf Feb 10 '13 at 07:12
  • @rm One way is to press Ctrl+Shift+E, find the inline cell and replace TraditionalForm style with "Text". Addition of SingleLetterItalics -> False itself does not work if the style is TraditionalForm. Is it possible to make "Text" the default style for inline cell when it is automatically created while editing a "Text" cell using a palette? – Alexey Popkov Feb 10 '13 at 07:56
  • 2
    @AlexeyPopkov The palette does not influence anything. You can get the same text cell simply pressing ALT+7. I think your question is: how to make cell style that types "Text" but does not auto-format in TraditionalForm when dealing with complex in-line math expressions. That probably deserves a separate post. – Vitaliy Kaurov Feb 10 '13 at 08:07
  • @Vitaliy I have created separate question as you suggest. – Alexey Popkov Feb 10 '13 at 09:45

5 Answers5

9

You can compute in a separate cell this expression:

Subscript[C, 3 v]

and then paste the output in your in-line text where you need it. Many things will work, including ideas from comments, - compare the difference in the outlook:

Row@{
  Style[Subscript[C, 3 v], 100], Spacer[30],
  Style[Subscript[C, 3 v], 100, "Text"], Spacer[30],
  Style[Subscript[C, 3 v], 100, SingleLetterItalics -> False], Spacer[30],
  Style[Subscript[C, 3 v], 100, FontFamily -> "Amienne"]}

enter image description here

To understand the difference click in any version and press CTRL+SHIFT+E. I guess you need to choose the version more suitable for your case.

While j-- idea is neat and preferable for simple cases, while dealing with complex in-line expressions with many indexes and other italicized forms - it is better compute desirable style at once for the whole expression.

To address programatically issue mentioned by Jens - the gab between characters in the subscript - one could use

Subscript[C, Row[{3 , v}]]
Vitaliy Kaurov
  • 73,078
  • 9
  • 204
  • 355
6

Stylistically, the Italic toggling, the Text or SingleLetterItalics solutions all still have one problem: the spacing between the 3 and the v is too large because it's treated as if it's a multiplication. What I'd consider correct output would be this:

correct

and not this:

bad

I'm using the version 8 default style, but the argument is the same in version 9.

And how do I get the correct output? Unfortunately, it requires several additional key presses:

  • Type C3v without Subscript in an inline cell
  • highlight the 3v and press Cmd-$-$ twice to shrink the text size appropriate for a subscript (I needed to re-highlight the 3v while shrinking it)
  • with the 3v still highlighted, press Ctrl-$\downarrow$ (on Mac; it's Alt on PC) four times to shift the baseline to subscript level.

I wish I had an easier answer, but if you want the "right" look this appears to be the shortest path. I tried doing the Subscript the normal way and just adjusting the v to the left afterwards, but then I can't get it to be in plain text anymore (it stays italic no matter what I do).

It may be best to define such textual subscripts as "macros" if you plan on re-using them.

Jens
  • 97,245
  • 7
  • 213
  • 499
5

You could, for example, type the sentence and the subscript part just as you did using the Writing Assistant pallette. Then, you can highlight the letter C and switch it to Plain using the command Italic (on Windows, Ctrl+I or using the Writing assistants pallette). The same principle works also for the subscript.

j--
  • 598
  • 3
  • 11
5

You could take the approach of defining a custom style to make the text look however you like, within the bounds of Mathematica's formatting capabilities. For example, in the private style sheet I paste:

Cell[StyleData["NoItalic"],
 StyleMenuListing->None,
 SingleLetterItalics->False,
 ShowStringCharacters->False,
 AutoSpacing->False,
 ZeroWidthTimes->True
]

Now in a new text cell enter my subscript and select it:

Mathematica graphics

Then I press Alt+0 and enter NoItalic, which yields:

   Mathematica graphics

As you can see this also addresses the spacing concern that Jens discussed. You can keep multiple styles for different purposes, each with potentially extensive customization.

Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371
  • 1
    Addendum: An Alt + (number) shortcut can be assigned to a style of you use it a lot, making this method very quick indeed. – Mr.Wizard Feb 10 '13 at 09:44
4

One satisfactory workaround is to represent as String all the text and use the option ShowStringCharacters -> False:

Style[Subscript["C", "3v"], "Text", ShowStringCharacters -> False]

screenshot

I think that such option should be included in the "Writing Assistant" palette. At this moment there is not too many assistance from it...

Alexey Popkov
  • 61,809
  • 7
  • 149
  • 368