Minsky
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 216 of file variable.cc.

References specialLatex.

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

217  {
218  string quotedName;
219  int next=0;
220  for (auto p=x.find_first_of(specialLatex); p!=string::npos;
221  p=x.find_first_of(specialLatex,p+1))
222  {
223  if (p==0||x[p-1]!='\\')
224  quotedName+=x.substr(next,p-next)+'\\'+x[p];
225  else
226  quotedName+=x.substr(next,p-next+1);
227  next=p+1;
228  }
229  return quotedName+x.substr(next);
230  }
Here is the caller graph for this function:

Variable Documentation

◆ specialLatex

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

Definition at line 214 of file variable.cc.

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