diff --git a/LaTeX/dist/LaTeX.jar b/LaTeX/dist/LaTeX.jar index 5a73425..228ee44 100644 Binary files a/LaTeX/dist/LaTeX.jar and b/LaTeX/dist/LaTeX.jar differ diff --git a/LaTeX/src/latex/Latex.java b/LaTeX/src/latex/Latex.java index 3a3b4d8..2c95075 100644 --- a/LaTeX/src/latex/Latex.java +++ b/LaTeX/src/latex/Latex.java @@ -28,7 +28,8 @@ */ public class Latex { - static String EQUATIONS_PATH = getDefaultPath() + "equations.xml"; + static final char SEPARATOR = System.getProperty("user.dir").contains("/") ? '/' : '\\'; + static String EQUATIONS_PATH = System.getProperty("user.dir") + Latex.SEPARATOR + "equations.xml"; public static TeXIcon textToTeXIcon(String math, int size) { @@ -43,13 +44,6 @@ public static TeXIcon textToTeXIcon(String math){ return textToTeXIcon(math, 40); } - private static String getDefaultPath() { - String defaultPath = System.getProperty("user.dir"); - String pathSeparator = defaultPath.contains("/") ? "/" : "\\"; - defaultPath += pathSeparator; - return defaultPath; - } - public static void writeEquations(ArrayList classes, ArrayList categories, ArrayList equations) throws FileNotFoundException, XMLStreamException, IOException { // OPEN Files.write(Paths.get(EQUATIONS_PATH), Arrays.asList(""), Charset.forName("UTF-8")); diff --git a/LaTeX/src/latex/Main.java b/LaTeX/src/latex/Main.java index d6984a5..94c4eee 100644 --- a/LaTeX/src/latex/Main.java +++ b/LaTeX/src/latex/Main.java @@ -10,9 +10,15 @@ public class Main { public static void main(String[] args) { if(args.length > 0){ - String newPath = args[0]; - newPath = newPath.substring(0, newPath.length()-7) + "equations.xml"; - Latex.EQUATIONS_PATH = newPath; + String str = args[0]; + if(str.lastIndexOf(".") < 0){ + if(str.charAt(str.length() - 1) != Latex.SEPARATOR){ + str += Latex.SEPARATOR; + } + str += "equations.xml"; + } + System.out.println(str); + Latex.EQUATIONS_PATH = str; } System.out.println("- " + Latex.EQUATIONS_PATH); MainWindow window = new MainWindow(); diff --git a/LaTeX/store/LaTeX.jar b/LaTeX/store/LaTeX.jar index f5ea5d2..94d9de2 100644 Binary files a/LaTeX/store/LaTeX.jar and b/LaTeX/store/LaTeX.jar differ diff --git a/LaTeX/store/MeX.exe b/LaTeX/store/MeX.exe deleted file mode 100644 index a6231be..0000000 Binary files a/LaTeX/store/MeX.exe and /dev/null differ diff --git a/LaTeX/store/equations.xml b/LaTeX/store/equations.xml deleted file mode 100644 index 708fda8..0000000 --- a/LaTeX/store/equations.xml +++ /dev/null @@ -1 +0,0 @@ -1.A, 1.D, 2.D, 3.D, 4.D, 0.NO, 1.AH, 1.EMlinear, quadratic, logarithmicy1.D, 3.D, 1.EM, 1.AH, haax+blineary2.D, 3.D, 1.AH, ...ax^2+bx+cquadratic\pm21.D, 1.A, 1.AH, x^2=4quadratic \ No newline at end of file