Text and latex interpreter in xlabel

  • Context: LaTeX 
  • Thread starter Thread starter member 428835
  • Start date Start date
  • Tags Tags
    Latex Text
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 4K views
member 428835
Hi PF!

I'm going insane here. How can I have the following in xlabel: ##Q \text{ (mm\sup 3/s)}##?
 
Physics news on Phys.org
Answer is here:
Code:
xlabel(['$Q$', ' (mm \textsuperscript{3}/s)'],'Interpreter','latex')
 
Nice, thanks for sharing.

Smetimes these kinds of display issues with text drive one insane. I once had to render some funky labels in Java and discovered that display text could in fact be a string of html tags to resize, colorize, fontify (a made up word to mean change the font to a more desireable one) the text. It really made my day too.
 
Reply
  • Like
Likes   Reactions: member 428835
joshmccraney said:
Answer is here:
Or,
[CODE lang="matlab" title="Till R2020b"]xlabel('$Q~\left( \mathrm{mm}^3/\mathrm{s} \right)$', 'Interpreter', 'latex')[/CODE]
Or, using the new Name=Value syntax introduced in R2021a,
[CODE lang="matlab" title="R2021a and later"]xlabel('$Q~\left( \mathrm{mm}^3/\mathrm{s} \right)$', Interpreter='latex')[/CODE]
 
Reply
  • Like
Likes   Reactions: member 428835 and jedishrfu