Problem with using siunitx (latex) in xlabel, ylabel,

9 ビュー (過去 30 日間)
Dominik Deml
Dominik Deml 2023 年 5 月 1 日
コメント済み: Star Strider 2023 年 5 月 1 日
I want to use SI-Units in xlabel and ylabel. It should be interpreted as latex-text.
What I have tried so far:
xlabel('Zeit ($\unit{\second}$)', 'Interpreter', 'latex');
and
xlabel(['Zeit ', '$(\unit{\second})$'], 'Interpreter', 'latex');
Both ways don't work. I get the error:
String scalar or character vector must have valid interpreter syntax:

回答 (1 件)

VBBV
VBBV 2023 年 5 月 1 日
編集済み: VBBV 2023 年 5 月 1 日
add another preceding \ as below
xlabel('Zeit $(SI[\\s]$)', 'Interpreter', 'latex');
  4 件のコメント
Dominik Deml
Dominik Deml 2023 年 5 月 1 日
So there is no way of doing this?
Star Strider
Star Strider 2023 年 5 月 1 日
You will need to be creative!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLaTeX についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by