
using latex formatting with questdlg
6 views (last 30 days)
Show older comments
Hi all,
I am trying to use make a quick table of previous inputs to display when using questdlg ask a question. I have used the 'tex' interpreter but am struggling to get the formatting just how I want it.
I am currently using this code
load ./settings/previousInputs.mat
opts.Interpreter = 'tex';
opts.Default = 'No';
inputQst = ['Use previous inputs settings? \newline\newline\it', ...
'OS:', compType, '\newline' ...
'Hardware:', hardwareMethod, '\newline', ...
'Transport:', transMethod, '\newline', ...
'Release:', release, '\newline'
];
prevInputs = questdlg(inputQst , ...
'Previous Input Settings', ...
'Yes', 'No', opts);
but the question box appears as;

and ideally I'd like it to be a bit neater and not have half a line put onto a new line?!
I have tried using \tab etc but nothing seems to work?
Any help would be greatly appreciated!
0 Comments
Answers (1)
TED MOSBY
on 2 Jul 2025
Hi George,
You can try "uiconfirm" as an alternative for the dialog box for a better text formatting.
Below is a code snippet for your use case:
compType = 'Windows 10';
hardwareMethod = 'GPU';
transMethod = 'vdjavdhajsmvefnafsdna ajsfhedvfnsadvas';
release = 'R2024b';
msg = sprintf([ ...
"Use previous input settings?\n\n" + ...
"OS: %s\n" + ...
"Hardware: %s\n" + ...
"Transport: %s\n" + ...
"Release: %s" ], ...
compType, hardwareMethod, transMethod, release);
fig = uifigure;
answer = uiconfirm(fig, msg,'Previous Input Settings', ...
'Options',{'Yes','No'}, ...
'DefaultOption',2, ...
'Interpreter','tex');
delete(fig);
This outputs a dialog box looking like this:

Note that uiconfirm always needs a parent uifigure (that’s why you see the extra window).
https://www.mathworks.com/help/matlab/ref/uiconfirm.html?s_tid=srchtitle_support_results_1_UICONFIRM
Hope this helps!
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!