Skip to content

Commit 1aa0793

Browse files
committed
Fixed error in case of latex-format axes title (issue #409)
1 parent bfd1a0a commit 1aa0793

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

export_fig.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@
415415
% 08/07/25: (3.51) Fixed: figure with non-default colormap exported with default colormap in some cases (issue #389)
416416
% 07/09/25: (3.52) Fixed: sgtitle was cropped in transparent PDF/EPS output (thanks @JohanWesto)
417417
% 12/09/25: (3.53) Fixed error in case of escaped tex/latex chars in EPS/PDF Title (issue #407)
418+
% 16/10/25: (3.54) Fixed error in case of latex-format axes title (issue #409)
418419
%}
419420

420421
if nargout
@@ -452,7 +453,7 @@
452453
[fig, options] = parse_args(nargout, fig, argNames, varargin{:});
453454

454455
% Check for newer version and exportgraphics/copygraphics compatibility
455-
currentVersion = 3.53;
456+
currentVersion = 3.54;
456457
if options.version % export_fig's version requested - return it and bail out
457458
imageData = currentVersion;
458459
return

print2eps.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ function print2eps(name, fig, export_options, varargin)
118118
% 02/05/24: Fixed contour labels with non-default FontName incorrectly exported as Courier (issue #388)
119119
% 11/05/25: Override Matlab's default Title & Creator meta-data (issue #402)
120120
% 12/09/25: Fixed error in case of escaped tex/latex chars in Title (issue #407)
121+
% 16/10/25: Fixed error in case of latex-format axes title (issue #409)
121122
%}
122123

123124
options = {'-loose'};
@@ -603,6 +604,7 @@ function print2eps(name, fig, export_options, varargin)
603604
if isempty(title_str) && ~isempty(hAxes)
604605
try title_str = hAxes(1).Title.String; catch, end
605606
title_str = strrep(title_str,'\','\\'); %issue #407
607+
title_str = strrep(title_str,'$','\$'); %issue #409
606608
end
607609
fstrm = regexprep(fstrm, '(%%Title:)[^\n]*\n', ['$1 ' title_str '\n']);
608610
end

0 commit comments

Comments
 (0)