LaTeX interpreter is not working correctly with code including subscripts in Control System Toolbox legends
37 次查看(过去 30 天)
显示 更早的评论
When running the following code:
G1 = tf(1,[1,1,1]);
G2 = tf(1,[1,0.5,1]);
step(G1,G2);
h = legend('$G_1(s)$','$G_2(s)$');
h.Interpreter = "latex";
h.FontSize = 12;
We can observe that the subscripts are not displayed correctly in the legend. I would appreciate any solution for this bug. Thanks!
0 个评论
回答(1 个)
Steven Lord
2022-8-8
This is Not a Bug. In LaTeX, A_bc will only treat b as a subscript. In order to include multiple symbols in a subscript (or superscript) you need to group them with curly braces.
For instance, here is A_bc: while here is A_{bc}: .
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Legend 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!