注:所用matlab为R2021a。
警告对话框字体太小,想调大字体怎么办?
(字体很小)
这是最初的代码:
errordlg('Please set L/S data adress first!','Missing adress')
添加属性及设置字体大小:
%前者为设置模态框,标记tex后即可添加各种修饰符
opts = struct('WindowStyle','modal','Interpreter','tex');
%\fontsize{15},调整字体大小修饰符
errordlg('\fontsize{15} Please set L/S data adress first!','Missing adress',opts)
效果:
其他修饰符
以下为修饰符总表:
修饰符 | 说明 | 示例 |
---|---|---|
^{ } | 上标 | 'text^{superscript}' |
_{ } | 下标 | 'text_{subscript}' |
\bf | 粗体 | '\bf text' |
\it | 斜体 | '\it text' |
\sl | 伪斜体(通常与斜体相同) | '\sl text' |
\rm | 常规字体 | '\rm text' |
\fontname{ | 字体名称 - 将 替换为字体系列的名称。您可以将此说明符与其他修饰符结合使用。 | '\fontname{Courier} text' |
\fontsize{ | 字体大小 - 将 替换为以磅为单位的数值标量值。 | '\fontsize{15} text' |
\color{ | 字体颜色 - 将 替换为以下颜色之一:red 、green 、yellow 、magenta 、blue 、black 、white 、gray 、darkGreen 、orange 或 lightBlue 。 | '\color{magenta} text' |
\color[rgb]{specifier} | 自定义字体颜色 - 将 替换为三元素 RGB 三元组。 | '\color[rgb]{0,0.5,0.5} text' |