mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-15 15:58:41 -04:00
improves the LaTeX export; unicode sum and prod symbols are exported to LaTeX
This commit is contained in:
parent
1c223e9af4
commit
0d39344f13
@ -109,6 +109,16 @@ public final class LaTeXFormatter {
|
||||
return "\\textgreater{}";
|
||||
case '&':
|
||||
return "\\&";
|
||||
case '∑':
|
||||
if (inMath)
|
||||
return "\\sum ";
|
||||
else
|
||||
return "$\\sum$";
|
||||
case '∏':
|
||||
if (inMath)
|
||||
return "\\prod ";
|
||||
else
|
||||
return "$\\prod$";
|
||||
default:
|
||||
return "" + aChar;
|
||||
}
|
||||
|
@ -31,4 +31,9 @@ public class LaTeXFormatterTest extends TestCase {
|
||||
assertEquals("a$\\neg{}$b", LaTeXFormatter.format(new Parser("a¬b").parse()));
|
||||
assertEquals("$a\\neg{}b$", LaTeXFormatter.format(new Parser("$a¬b$").parse()));
|
||||
}
|
||||
|
||||
public void testSumProd() throws ParseException {
|
||||
assertEquals("$\\sum ^a_{n=0}$", LaTeXFormatter.format(new Parser("∑_{n=0}^a").parse()));
|
||||
assertEquals("$\\prod ^a_{n=0}$", LaTeXFormatter.format(new Parser("∏_{n=0}^a").parse()));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user