Showing
1 changed file
with
9 additions
and
3 deletions
| @@ -37,12 +37,18 @@ public class LatexFormulaExcelExporterUtil { | @@ -37,12 +37,18 @@ public class LatexFormulaExcelExporterUtil { | ||
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | latex.append(formatScientificNotation(comp.getBase())); | 39 | latex.append(formatScientificNotation(comp.getBase())); |
| 40 | - if (comp.getSup() != null) { | 40 | + if (comp.getSup() != null && comp.getSup().compareTo(BigDecimal.ZERO) > 0) { |
| 41 | latex.append("^{+").append(formatScientificNotation(comp.getSup())).append("}"); | 41 | latex.append("^{+").append(formatScientificNotation(comp.getSup())).append("}"); |
| 42 | } | 42 | } |
| 43 | + if (comp.getSup() != null && comp.getSup().compareTo(BigDecimal.ZERO) < 0) { | ||
| 44 | + latex.append("^{").append(formatScientificNotation(comp.getSup())).append("}"); | ||
| 45 | + } | ||
| 43 | 46 | ||
| 44 | - if (comp.getSub() != null) { | ||
| 45 | - latex.append("_{-").append(formatScientificNotation(comp.getSub())).append("}"); | 47 | + if (comp.getSub() != null && comp.getSub().compareTo(BigDecimal.ZERO) > 0) { |
| 48 | + latex.append("_{+").append(formatScientificNotation(comp.getSub())).append("}"); | ||
| 49 | + } | ||
| 50 | + if (comp.getSub() != null && comp.getSub().compareTo(BigDecimal.ZERO) < 0) { | ||
| 51 | + latex.append("_{").append(formatScientificNotation(comp.getSub())).append("}"); | ||
| 46 | } | 52 | } |
| 47 | 53 | ||
| 48 | if (i < componentList.size() - 1) { | 54 | if (i < componentList.size() - 1) { |