From 2e2315611cc674db0c15b6e7116f7ca45bc340d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?=
 <stephane.adjemian@univ-lemans.fr>
Date: Mon, 9 Sep 2013 11:25:12 +0200
Subject: [PATCH] Fixed bug (conversion of variable names in tex).

(cherry picked from commit 80218a1b65b9af0ccd6b598fe562819ea48bd0ec)
---
 matlab/utilities/general/name2tex.m | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/matlab/utilities/general/name2tex.m b/matlab/utilities/general/name2tex.m
index 213ad7bbb..a8369e68e 100644
--- a/matlab/utilities/general/name2tex.m
+++ b/matlab/utilities/general/name2tex.m
@@ -25,15 +25,8 @@ end
 
 if iscell(name)
     nn = length(name);
-    id = findstr(cell2mat(transpose(name)),'_');
 else
     nn = 1;
-    id = findstr(name,'_');
-end
-
-if isempty(id)
-    tex = name;
-    return
 end
 
 if iscell(name)
@@ -51,6 +44,9 @@ for i=1:nn
             id = findstr(name,'_');
             len = length(tex);
         end
+        if isempty(id)
+            continue
+        end
         n = length(id);
         if id(1)==1
             if iscell(name)
-- 
GitLab