Minsky: 3.17.0
anonymous_namespace{variable.cc} Namespace Reference

Functions

string quoteLaTeX (const std::string &x)
 

Variables

const char specialLatex [] ="#$%&"
 

Function Documentation

◆ quoteLaTeX()

string anonymous_namespace{variable.cc}::quoteLaTeX ( const std::string &  x)

Definition at line 201 of file variable.cc.

References specialLatex.

Referenced by minsky::VariableBase::name().

202  {
203  string quotedName;
204  int next=0;
205  for (auto p=x.find_first_of(specialLatex); p!=string::npos;
206  p=x.find_first_of(specialLatex,p+1))
207  {
208  if (p==0||x[p-1]!='\\')
209  quotedName+=x.substr(next,p-next)+'\\'+x[p];
210  else
211  quotedName+=x.substr(next,p-next+1);
212  next=p+1;
213  }
214  return quotedName+x.substr(next);
215  }
Here is the caller graph for this function:

Variable Documentation

◆ specialLatex

const char anonymous_namespace{variable.cc}::specialLatex[] ="#$%&"

Definition at line 199 of file variable.cc.

Referenced by minsky::VariableBase::name(), and quoteLaTeX().