0
$\begingroup$

I am trying to render a text on a graphics.

legend = Graphics[{
{White, 
 Style[Text["laser pol.", Offset[{120, 50}]], FontSize -> 42, 
  SingleLetterItalics -> False]},
{White, 
 Style[Text["\!\(\*SuperscriptBox[\(H\), \(*\)]\)(N=3)", 
   Offset[{285, 440}]], FontSize -> 42, 
  SingleLetterItalics -> False]},
{White, 
 Style[Text[
   "\!\(\*SubsuperscriptBox[\(H\), \(2\), \(+\)]\)(v=5-6)", 
   Offset[{285, 525}]], FontSize -> 42, 
  SingleLetterItalics -> False]}}];

I expected the H (in H2 and H+) to be straight but they render in italic. Am I using the directive in a wrong way?

example

$\endgroup$
5
  • $\begingroup$ If I evaluate your code, I get an empty picture. You also have expressions placed into strings, which cannot possibly render the way you describe. Make sure that you show an example which, when copied, pasted into a notebook and evaluated, will demonstrate the problem you are having. $\endgroup$
    – Szabolcs
    Commented Apr 4, 2017 at 17:58
  • $\begingroup$ I forgot that I display the legend on white onto my image. I am editing to change that back to black, that should display the issue. $\endgroup$
    – A postdoc
    Commented Apr 4, 2017 at 18:00
  • $\begingroup$ Have you tried evaluating the code you posted here? Do you see any italics in the output? If yes, post a screenshot and indicate your version of Mathematica. I cannot make a connection between the code you posted and the text you wrote. $\endgroup$
    – Szabolcs
    Commented Apr 4, 2017 at 18:04
  • $\begingroup$ Post edited with the exact code I use and an image. $\endgroup$
    – A postdoc
    Commented Apr 4, 2017 at 18:06
  • 1
    $\begingroup$ If you do not make your code self-contained, we cannot help you. Once again, post code that reproduces your problem. If I evaluate what you posted, not only does it not show anything because it's white, if I correct that to black, most of the text is cut off and outside of the image borders. We do not have your laserarrow, image5, etc. $\endgroup$
    – Szabolcs
    Commented Apr 4, 2017 at 18:11

1 Answer 1

3
$\begingroup$

Put the Style inside of the Text.

Text[Style[..., SingleLetterItalics -> False], ...]
$\endgroup$
1
  • $\begingroup$ That works as it should. Thanks. $\endgroup$
    – A postdoc
    Commented Apr 4, 2017 at 18:21

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