Changeset 17630
- Timestamp:
- 06/23/20 16:11:21 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionLatexFormatter.cs
r17180 r17630 28 28 using HeuristicLab.Core; 29 29 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 30 31 using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>; 30 32 31 33 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 239 241 constIndex++; 240 242 } 243 244 if (varNode.DataType == typeof(DoubleVector)) strBuilder.Append("\\boldsymbol{"); 241 245 strBuilder.Append(EscapeLatexString(varNode.VariableName)); 246 if (varNode.DataType == typeof(DoubleVector)) strBuilder.Append("}"); // boldsymbol end 242 247 strBuilder.Append(LagToString(currentLag)); 243 248 } else if (node.Symbol is ProgramRootSymbol) { … … 280 285 constIndex++; 281 286 strBuilder.Append(@" \left( " + p + @"\cdot "); 287 } else if (node.Symbol is Sum) { 288 strBuilder.Append(@"\operatorname{sum}\left("); 289 } else if (node.Symbol is Mean) { 290 strBuilder.Append(@"\operatorname{mean}\left("); 291 } else if (node.Symbol is Length) { 292 strBuilder.Append(@"\operatorname{length}\left("); 293 } else if (node.Symbol is StandardDeviation) { 294 strBuilder.Append(@"\operatorname{stdev}\left("); 295 } else if (node.Symbol is Variance) { 296 strBuilder.Append(@"\operatorname{var}\left("); 282 297 } else { 283 298 throw new NotImplementedException("Export of " + node.Symbol + " is not implemented."); … … 511 526 } else if (node.Symbol is VariableCondition) { 512 527 strBuilder.Append(@"\right) "); 528 } else if (node.Symbol is Sum) { 529 strBuilder.Append(@"\right) "); 530 } else if (node.Symbol is Mean) { 531 strBuilder.Append(@"\right) "); 532 } else if (node.Symbol is Length) { 533 strBuilder.Append(@"\right) "); 534 } else if (node.Symbol is StandardDeviation) { 535 strBuilder.Append(@"\right) "); 536 } else if (node.Symbol is Variance) { 537 strBuilder.Append(@"\right) "); 513 538 } else { 514 539 throw new NotImplementedException("Export of " + node.Symbol + " is not implemented."); … … 532 557 533 558 private string EscapeLatexString(string s) { 534 return "\\ text{" +559 return "\\mathrm{" + 535 560 s 536 561 .Replace("\\", "\\\\")
Note: See TracChangeset
for help on using the changeset viewer.