Clear Filters
Clear Filters

Is it possible to adjust text subscript-depth?

7 views (last 30 days)
noahop
noahop on 11 Apr 2018
Answered: Florian Glaser on 26 Apr 2021
As is seen in the example below, the subscript depth (the distance of lowering) is way too large.
I desire the subscripted symbol to be lowered/raised about 60% compared to baseline. The default behaviour seems to be 100%. Is it possible to adjust this?
Example code:
annotationHandle = annotation('textbox');
annotationHandle.FontSize = 22;
annotationHandle.FontWeight = 'bold';
annotationHandle.String = 'I_{ext} [µA/cm²]';
The unicode superscripted two ( ² ) in the example above is a perfect example of how it should look.
As a side note, I can say that I tried using unicode subscripted letters for 'e', 'x' and 't'. Unfortunately, there seems to be a bug (?) in Matlab, which converts the unicode subscripted letter 'ₑ' (U+2091) into a superscripted '1' if copied into the Matlab editor, or a missing char box ' ' if input using char(2091). I have tried both the Latex and Tex interpreters.
I am using R2017a and R2017b.

Answers (1)

Florian Glaser
Florian Glaser on 26 Apr 2021
I have the exact same problem. Regular and tex-interpreted subscripts look HORRIBLE in Matlab. The latex interpreter fixes this, but then you cannot use upright greek symbols anymore, sigh. The only proper solutions seems to be customizing the used latex preamble to load user-defined packages and thereby get the full power of latex.
Mathworks, it's time to fix this.

Categories

Find more on Characters and Strings in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!