mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-08 18:30:42 +00:00
make LaTeX code usable in normal environment
This commit is contained in:
parent
9767002ad1
commit
73376c0667
@ -31,6 +31,8 @@ public class ShareDialog extends Dialog implements LocaleChangeObserver {
|
||||
private static final String CLOSE_ICON_ID = "closeIcon";
|
||||
|
||||
private static final String RIGHT_ARROW_WHITE = "\\\\rightwhitearrow";
|
||||
private static final String MATH_OPEN = "\\[";
|
||||
private static final String MATH_CLOSE = "\\]";
|
||||
|
||||
private final TextField urlField;
|
||||
private final TextArea packageAreaTree;
|
||||
@ -67,7 +69,7 @@ public class ShareDialog extends Dialog implements LocaleChangeObserver {
|
||||
latexAreaTree = new TextArea();
|
||||
packageAreaUnification = new TextArea();
|
||||
latexAreaUnification = new TextArea();
|
||||
initializeFields(url, latexCodeTree, latexCodeUnification);
|
||||
initializeFields(url, latexCodeTree, MATH_OPEN + latexCodeUnification + MATH_CLOSE);
|
||||
|
||||
UI.getCurrent().getPage().executeJs("window.autoSelect($0)", FIELD_CLASS);
|
||||
|
||||
|
@ -58,8 +58,8 @@ public final class LatexCreatorConstants {
|
||||
|
||||
protected static final String LATEX_NEW_LINE = "\\\\";
|
||||
protected static final String CIRC = "\\circ";
|
||||
protected static final String COLOR_RED = "\\color{#f00}";
|
||||
protected static final String COLOR_HIGHLIGHT = "\\color{#006AF5}";
|
||||
protected static final String COLOR_RED = "\\color{Red}";
|
||||
protected static final String COLOR_HIGHLIGHTED = "\\color{RoyalBlue}";
|
||||
protected static final String EMPTY_SET = "\\emptyset";
|
||||
protected static final String LAMBDA = "\\lambda";
|
||||
protected static final String LATEX_SPACE = "\\ ";
|
||||
|
@ -291,7 +291,7 @@ public class LatexCreatorConstraints implements StepVisitor {
|
||||
sb.append(COLOR_RED);
|
||||
} else if (markLastTwoConstraints && (i < 2)) {
|
||||
sb.append(CURLY_LEFT);
|
||||
sb.append(COLOR_HIGHLIGHT);
|
||||
sb.append(COLOR_HIGHLIGHTED);
|
||||
}
|
||||
sb.append(new LatexCreatorType(unificationConstraints.get(i).getFirstType()).getLatex());
|
||||
sb.append(EQUALS);
|
||||
@ -310,7 +310,7 @@ public class LatexCreatorConstraints implements StepVisitor {
|
||||
if (original.contains(originalType)) {
|
||||
StringBuilder highlightedChange2 = new StringBuilder();
|
||||
highlightedChange2.append(CURLY_LEFT);
|
||||
highlightedChange2.append(COLOR_HIGHLIGHT);
|
||||
highlightedChange2.append(COLOR_HIGHLIGHTED);
|
||||
highlightedChange2.append(new LatexCreatorType(s.getType()).getLatex());
|
||||
highlightedChange2.append(CURLY_RIGHT);
|
||||
latex.append(original.replace(originalType, highlightedChange2.toString()));
|
||||
|
@ -85,5 +85,6 @@ share.neededPackagesTree=\
|
||||
\\usepackage{bussproofs}\n\
|
||||
\\usepackage{amsmath}
|
||||
share.neededPackagesUnification=\
|
||||
\\usepackage{xcolor}\n\
|
||||
\\usepackage{amsmath}
|
||||
\\usepackage[dvipsnames]{xcolor}\n\
|
||||
\\usepackage{amsmath}\n\
|
||||
\\usepackage{stix}
|
||||
|
Loading…
Reference in New Issue
Block a user