diff --git a/README.md b/README.md index 1ec5c2f..dc0b670 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Obsidian Markdown Formatting Assistant -> This Plugin provides easy to use snippets for Markdown and HTML and a color picker which shows the history of last used colors. Furthermore, it is possible to save any color you want. +> This Plugin provides easy to use snippets for Markdown, HTML and Latex and a color picker which shows the history of last used colors. Furthermore, it is possible to save any color you want. > Version 0.1.1 > If you find a Bug or have a feature request: https://github.com/Reocin/obsidian-markdown-formatting-assistant-plugin/issues @@ -11,8 +11,26 @@ The Side Panel can be opened by the Ribbon Icon on the left side. If you changed the side of the panel in the settings, just hit this butten/icon again and it will reload on the right side. +### Markdown Section + ![](assets/Panel_Overview.png) +### HTML Section + +![](assets/Panel_Overview_Html.png) + +### Latex Section + +> Latex Functions only work if they are in a latex equation section like $...$ or $$...$$. + +![](assets/Panel_Overview_Latex.png) + +### Greek Letters Section + +> Greek Letters only work if they are in a latex equation section like $...$ or $$...$$. + +![](assets/Panel_Overview_Greek_Letters.png) + ## Command Language With the command language the speed of the workflow can be specifically improved. By typing the trigger char (by default `\`) the commands will be activated and a suggestion window opens. It shows maximal 5 suggestions, which can be improved by adding more letters. The selected suggestion can be changed with the arrow keys and be activated with the enter key. @@ -64,13 +82,15 @@ To delete a saved or last used color just click it with the right mouse button. ## Changelog +- Version 0.3.0 + - added a Latex and Greek Letters section - Version 0.2.2 - added /mermaid snipplet to generate mermaid code block - allows drawing diagrams ![](assets/Mermaid.png) - Version 0.2.1 ⁻ Some Bug Fixes - - No input preview mode - - Highlighting of the html buttons when hover - - Replace selection when insert colors. + - No input preview mode + - Highlighting of the html buttons when hover + - Replace selection when insert colors. - Saved Colors can be added and edited in the settings. - New HTML Tags `
` and `` - Vesion 0.2.0 diff --git a/assets/Panel_Overview_Greek_Letters.png b/assets/Panel_Overview_Greek_Letters.png new file mode 100644 index 0000000..86ed2d2 Binary files /dev/null and b/assets/Panel_Overview_Greek_Letters.png differ diff --git a/assets/Panel_Overview_Html.png b/assets/Panel_Overview_Html.png new file mode 100644 index 0000000..f967cf8 Binary files /dev/null and b/assets/Panel_Overview_Html.png differ diff --git a/assets/Panel_Overview_Latex.png b/assets/Panel_Overview_Latex.png new file mode 100644 index 0000000..86ec946 Binary files /dev/null and b/assets/Panel_Overview_Latex.png differ diff --git a/assets/icons/Alpha.svg b/assets/icons/Alpha.svg new file mode 100644 index 0000000..6f6933d --- /dev/null +++ b/assets/icons/Alpha.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Beta.svg b/assets/icons/Beta.svg new file mode 100644 index 0000000..b37d0d9 --- /dev/null +++ b/assets/icons/Beta.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Chi.svg b/assets/icons/Chi.svg new file mode 100644 index 0000000..3ea616d --- /dev/null +++ b/assets/icons/Chi.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Delta.svg b/assets/icons/Delta.svg new file mode 100644 index 0000000..2852130 --- /dev/null +++ b/assets/icons/Delta.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Epsilon.svg b/assets/icons/Epsilon.svg new file mode 100644 index 0000000..6f91490 --- /dev/null +++ b/assets/icons/Epsilon.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Eta.svg b/assets/icons/Eta.svg new file mode 100644 index 0000000..33aa508 --- /dev/null +++ b/assets/icons/Eta.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Gamma.svg b/assets/icons/Gamma.svg new file mode 100644 index 0000000..a4e13f5 --- /dev/null +++ b/assets/icons/Gamma.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Iota.svg b/assets/icons/Iota.svg new file mode 100644 index 0000000..26b96b3 --- /dev/null +++ b/assets/icons/Iota.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Kappa.svg b/assets/icons/Kappa.svg new file mode 100644 index 0000000..6ae3efc --- /dev/null +++ b/assets/icons/Kappa.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Lambda.svg b/assets/icons/Lambda.svg new file mode 100644 index 0000000..f041faf --- /dev/null +++ b/assets/icons/Lambda.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/LatexEquation.svg b/assets/icons/LatexEquation.svg new file mode 100644 index 0000000..fb3f7de --- /dev/null +++ b/assets/icons/LatexEquation.svg @@ -0,0 +1,70 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/assets/icons/LatexInlineEquation.svg b/assets/icons/LatexInlineEquation.svg new file mode 100644 index 0000000..0f0e777 --- /dev/null +++ b/assets/icons/LatexInlineEquation.svg @@ -0,0 +1,70 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/assets/icons/My.svg b/assets/icons/My.svg new file mode 100644 index 0000000..ddd5751 --- /dev/null +++ b/assets/icons/My.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Ny.svg b/assets/icons/Ny.svg new file mode 100644 index 0000000..7df8780 --- /dev/null +++ b/assets/icons/Ny.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Omega.svg b/assets/icons/Omega.svg new file mode 100644 index 0000000..e57e609 --- /dev/null +++ b/assets/icons/Omega.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Omikron.svg b/assets/icons/Omikron.svg new file mode 100644 index 0000000..e9c853e --- /dev/null +++ b/assets/icons/Omikron.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Phi.svg b/assets/icons/Phi.svg new file mode 100644 index 0000000..4993127 --- /dev/null +++ b/assets/icons/Phi.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Pi.svg b/assets/icons/Pi.svg new file mode 100644 index 0000000..974d0f7 --- /dev/null +++ b/assets/icons/Pi.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Psi.svg b/assets/icons/Psi.svg new file mode 100644 index 0000000..6353dc4 --- /dev/null +++ b/assets/icons/Psi.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Rho.svg b/assets/icons/Rho.svg new file mode 100644 index 0000000..ee8c26e --- /dev/null +++ b/assets/icons/Rho.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Sigma.svg b/assets/icons/Sigma.svg new file mode 100644 index 0000000..f84d05f --- /dev/null +++ b/assets/icons/Sigma.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Tau.svg b/assets/icons/Tau.svg new file mode 100644 index 0000000..b4306c1 --- /dev/null +++ b/assets/icons/Tau.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Theta.svg b/assets/icons/Theta.svg new file mode 100644 index 0000000..0854e93 --- /dev/null +++ b/assets/icons/Theta.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Xi.svg b/assets/icons/Xi.svg new file mode 100644 index 0000000..b635a9b --- /dev/null +++ b/assets/icons/Xi.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Ypsilon.svg b/assets/icons/Ypsilon.svg new file mode 100644 index 0000000..b0c3a61 --- /dev/null +++ b/assets/icons/Ypsilon.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/Zeta.svg b/assets/icons/Zeta.svg new file mode 100644 index 0000000..83886d9 --- /dev/null +++ b/assets/icons/Zeta.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/alpha.svg b/assets/icons/alpha.svg new file mode 100644 index 0000000..1afc29c --- /dev/null +++ b/assets/icons/alpha.svg @@ -0,0 +1,70 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/assets/icons/beta.svg b/assets/icons/beta.svg new file mode 100644 index 0000000..3cc9480 --- /dev/null +++ b/assets/icons/beta.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/chi.svg b/assets/icons/chi.svg new file mode 100644 index 0000000..0ebb4e8 --- /dev/null +++ b/assets/icons/chi.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/delta.svg b/assets/icons/delta.svg new file mode 100644 index 0000000..22ed6ec --- /dev/null +++ b/assets/icons/delta.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/epsilon.svg b/assets/icons/epsilon.svg new file mode 100644 index 0000000..ce754a4 --- /dev/null +++ b/assets/icons/epsilon.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/epsilonV2.svg b/assets/icons/epsilonV2.svg new file mode 100644 index 0000000..8c22249 --- /dev/null +++ b/assets/icons/epsilonV2.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/eta.svg b/assets/icons/eta.svg new file mode 100644 index 0000000..1acdf87 --- /dev/null +++ b/assets/icons/eta.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/gamma.svg b/assets/icons/gamma.svg new file mode 100644 index 0000000..339df7a --- /dev/null +++ b/assets/icons/gamma.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/iota.svg b/assets/icons/iota.svg new file mode 100644 index 0000000..b79dbe8 --- /dev/null +++ b/assets/icons/iota.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/kappa.svg b/assets/icons/kappa.svg new file mode 100644 index 0000000..4a2eddf --- /dev/null +++ b/assets/icons/kappa.svg @@ -0,0 +1,66 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/kappaV2.svg b/assets/icons/kappaV2.svg new file mode 100644 index 0000000..226c565 --- /dev/null +++ b/assets/icons/kappaV2.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/lambda.svg b/assets/icons/lambda.svg new file mode 100644 index 0000000..0530563 --- /dev/null +++ b/assets/icons/lambda.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/my.svg b/assets/icons/my.svg new file mode 100644 index 0000000..f9dcbaa --- /dev/null +++ b/assets/icons/my.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/ny.svg b/assets/icons/ny.svg new file mode 100644 index 0000000..d233e45 --- /dev/null +++ b/assets/icons/ny.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/omega.svg b/assets/icons/omega.svg new file mode 100644 index 0000000..ce0df8d --- /dev/null +++ b/assets/icons/omega.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/omikron.svg b/assets/icons/omikron.svg new file mode 100644 index 0000000..ceecb90 --- /dev/null +++ b/assets/icons/omikron.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/phi.svg b/assets/icons/phi.svg new file mode 100644 index 0000000..05d2013 --- /dev/null +++ b/assets/icons/phi.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/pi.svg b/assets/icons/pi.svg new file mode 100644 index 0000000..f1ae11e --- /dev/null +++ b/assets/icons/pi.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/psi.svg b/assets/icons/psi.svg new file mode 100644 index 0000000..5b33ec1 --- /dev/null +++ b/assets/icons/psi.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/rho.svg b/assets/icons/rho.svg new file mode 100644 index 0000000..ce050e3 --- /dev/null +++ b/assets/icons/rho.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/rhoV2.svg b/assets/icons/rhoV2.svg new file mode 100644 index 0000000..9cc2076 --- /dev/null +++ b/assets/icons/rhoV2.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/sigma.svg b/assets/icons/sigma.svg new file mode 100644 index 0000000..ee11fae --- /dev/null +++ b/assets/icons/sigma.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/tau.svg b/assets/icons/tau.svg new file mode 100644 index 0000000..65cac3f --- /dev/null +++ b/assets/icons/tau.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/theta.svg b/assets/icons/theta.svg new file mode 100644 index 0000000..42f0876 --- /dev/null +++ b/assets/icons/theta.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/thetaV2.svg b/assets/icons/thetaV2.svg new file mode 100644 index 0000000..2588418 --- /dev/null +++ b/assets/icons/thetaV2.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/xi.svg b/assets/icons/xi.svg new file mode 100644 index 0000000..21e981d --- /dev/null +++ b/assets/icons/xi.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/ypsilon.svg b/assets/icons/ypsilon.svg new file mode 100644 index 0000000..2a6493d --- /dev/null +++ b/assets/icons/ypsilon.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/assets/icons/zeta.svg b/assets/icons/zeta.svg new file mode 100644 index 0000000..548188d --- /dev/null +++ b/assets/icons/zeta.svg @@ -0,0 +1,65 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/build/manifest.json b/build/manifest.json index 29509cd..71ef7f7 100644 --- a/build/manifest.json +++ b/build/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-markdown-formatting-assistant-plugin", "name": "Markdown Formatting Assistant", - "version": "0.2.2", + "version": "0.3.0", "minAppVersion": "0.10.9", "description": "This Plugin provides a simple Editor for Markdown, HTML and Colors and in addition a command line interface. The command line interface facilitate a faster workflow.", "author": "Reocin", diff --git a/build/versions.json b/build/versions.json index 468900a..22875b5 100644 --- a/build/versions.json +++ b/build/versions.json @@ -4,5 +4,6 @@ "0.1.2": "0.10.9", "0.2.0": "0.10.9", "0.2.1": "0.10.9", - "0.2.2": "0.10.9" + "0.2.2": "0.10.9", + "0.3.0": "0.10.9" } diff --git a/manifest.json b/manifest.json index 29509cd..71ef7f7 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-markdown-formatting-assistant-plugin", "name": "Markdown Formatting Assistant", - "version": "0.2.2", + "version": "0.3.0", "minAppVersion": "0.10.9", "description": "This Plugin provides a simple Editor for Markdown, HTML and Colors and in addition a command line interface. The command line interface facilitate a faster workflow.", "author": "Reocin", diff --git a/package.json b/package.json index 99d6ed3..cc20931 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-markdown-formatting-assistant-plugin", - "version": "0.2.2", + "version": "0.3.0", "description": "This plugin improves the writing of MarkDown files", "homepage": "https://github.com/Reocin/obsidian-markdown-formatting-assistant-plugin", "main": "main.js", diff --git a/rollup.config.js b/rollup.config.js index 07df797..d0d43b9 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -7,6 +7,7 @@ const exportFolder = '.obsidian/plugins/obsidian-markdown-formatting-assistant-plugin'; export default { input: 'src/main.ts', + output: { dir: exportFolder, sourcemap: 'inline', @@ -15,6 +16,8 @@ export default { }, external: ['obsidian'], plugins: [ + typescript(), + nodeResolve({ browser: true }), copy({ targets: [ { src: 'styles.css', dest: exportFolder }, @@ -22,8 +25,6 @@ export default { { src: 'versions.json', dest: exportFolder }, ], }), - typescript(), - nodeResolve({ browser: true }), commonjs({ include: 'node_modules/ramda/**', }), diff --git a/rollup.production.config.js b/rollup.production.config.js index 8634c9e..eef5522 100644 --- a/rollup.production.config.js +++ b/rollup.production.config.js @@ -16,7 +16,6 @@ export default { plugins: [ typescript(), nodeResolve({ browser: true }), - commonjs(), copy({ targets: [ { src: 'styles.css', dest: exportFolder }, @@ -24,5 +23,8 @@ export default { { src: 'versions.json', dest: exportFolder }, ], }), + commonjs({ + include: 'node_modules/ramda/**', + }), ], }; diff --git a/src/CommandListView.ts b/src/CommandListView.ts index 3177a83..61625fb 100644 --- a/src/CommandListView.ts +++ b/src/CommandListView.ts @@ -1,4 +1,4 @@ -import { mdiSeatLegroomExtra } from '@mdi/js'; +import * as R from 'ramda'; import { App } from 'obsidian'; import { svgToElement } from './icons'; import { formatSettings, formatterSetting, iconFormatter } from './formatter'; @@ -7,6 +7,17 @@ import { htmlFormatterSettings, htmlFormatterSetting, } from './htmlFormatter'; +import { + greekFormatter, + greekLowerCaseFormatterSettings, + greekUpperCaseFormatterSettings, + greekFormatterSetting, +} from './greekFormatter'; +import { + latexFormatter, + latexFormatterSettings, + latexFormatterSetting, +} from './latexFormatter'; export class CommandListView { private static commandListView: CommandListView; @@ -87,7 +98,8 @@ export class CommandListView { let startIndex = line.indexOf(triggerKey); while (startIndex >= 0) { - const endIndex = line.indexOf(' ', startIndex); + const endIndex = line.split('$').join(' ').indexOf(' ', startIndex); + if (curser.ch >= startIndex && (endIndex < 0 || curser.ch <= endIndex)) { if (this.commandListView) this.commandListView.close(); this.commandListView = new CommandListView( @@ -147,6 +159,30 @@ export class CommandListView { } }); + Object.values(greekLowerCaseFormatterSettings).map((args) => { + if (!this.codeString || args.des.indexOf(this.codeString) >= 0) { + // @ts-ignore + const row = this.getWidgetViewGreekTableRow(args); + if (row) this.rows.push(row); + } + }); + + Object.values(greekUpperCaseFormatterSettings).map((args) => { + if (!this.codeString || args.des.indexOf(this.codeString) >= 0) { + // @ts-ignore + const row = this.getWidgetViewGreekTableRow(args); + if (row) this.rows.push(row); + } + }); + + Object.values(latexFormatterSettings).map((args) => { + if (!this.codeString || args.des.indexOf(this.codeString) >= 0) { + // @ts-ignore + const row = this.getWidgetViewLatexTableRow(args); + if (row) this.rows.push(row); + } + }); + if (this.rows.length > 0) this.setRowSelected(this.rows[0].id); this.rows.slice(0, 5).forEach((row) => { @@ -259,4 +295,81 @@ export class CommandListView { return row; }; + + private getWidgetViewGreekTableRow = ( + item: greekFormatterSetting, + ): HTMLElement => { + const row = document.createElement('tr'); + row.id = item.des; + + row.onClickEvent(() => { + this.cm.getCursor(); + this.cm.replaceRange( + '', + { line: this.cm.getCursor().line, ch: this.startIndex }, + { + line: this.cm.getCursor().line, + ch: this.endIndex >= 0 ? this.endIndex : this.cm.getCursor().ch, + }, + ); + + greekFormatter(this.cm, item); + this.close(); + }); + + const cell1 = row.createEl('td'); + const iconDiv = cell1.createDiv(); + iconDiv.classList.add('command-list-view-icon'); + iconDiv.appendChild(svgToElement(item.icon)); + + const cell2 = row.createEl('td'); + cell2.classList.add('command-list-view-text'); + cell2.style.color = '#25e712'; + cell2.setText(item.des); + + return row; + }; + + private getWidgetViewLatexTableRow = ( + item: latexFormatterSetting, + ): HTMLElement => { + const row = document.createElement('tr'); + row.id = item.des; + + row.onClickEvent(() => { + this.cm.getCursor(); + this.cm.replaceRange( + '', + { line: this.cm.getCursor().line, ch: this.startIndex }, + { + line: this.cm.getCursor().line, + ch: this.endIndex >= 0 ? this.endIndex : this.cm.getCursor().ch, + }, + ); + + latexFormatter(this.cm, item); + this.close(); + }); + + const cell1 = row.createEl('td'); + const iconDiv = cell1.createDiv(); + iconDiv.classList.add('command-list-view-icon'); + if (item.type === 'icon') { + let svg = svgToElement(item.text); + svg.style.display = 'inline-block'; + svg.style.verticalAlign = 'middle'; + iconDiv.appendChild(svg); + } else if (item.type === 'text') { + let div = document.createElement('div'); + div.innerHTML = item.text; + iconDiv.appendChild(div); + } + + const cell2 = row.createEl('td'); + cell2.classList.add('command-list-view-text'); + cell2.style.color = '#25e712'; + cell2.setText(item.des); + + return row; + }; } diff --git a/src/SidePanelControlView.ts b/src/SidePanelControlView.ts index 5be7cb6..ed6c9b6 100644 --- a/src/SidePanelControlView.ts +++ b/src/SidePanelControlView.ts @@ -5,8 +5,25 @@ import { htmlFormatterSettings, htmlFormatterSetting, } from './htmlFormatter'; +import { + greekFormatter, + greekLowerCaseFormatterSettings, + greekUpperCaseFormatterSettings, + greekFormatterSetting, +} from './greekFormatter'; +import { + latexFormatter, + latexFormatterSettings, + latexFormatterSetting, +} from './latexFormatter'; import { colorFormatter } from './colorFormatter'; -import { ItemView, Notice, TFile, WorkspaceLeaf } from 'obsidian'; +import { + ButtonComponent, + ItemView, + Notice, + TFile, + WorkspaceLeaf, +} from 'obsidian'; import * as R from 'ramda'; import MarkdownAutocompletePlugin from './main'; import { checkIfMarkdownSource } from './generalFunctions'; @@ -100,7 +117,7 @@ export class SidePanelControlView extends ItemView { info.style.textAlign = 'center'; info.style.marginTop = '10px'; info.style.marginBottom = '10px'; - const link = info.createEl('a'); + let link = info.createEl('a'); link.appendText('Do you miss a Tag? report it!'); link.style.textAlign = 'center'; @@ -108,6 +125,83 @@ export class SidePanelControlView extends ItemView { link.href = 'https://github.com/Reocin/obsidian-markdown-formatting-assistant-plugin/issues'; + // -------------- + // Latex Section + // -------------- + header = mainDiv.createEl('h4'); + header.appendText('Latex'); + header.style.textAlign = 'center'; + header.style.marginTop = '20px'; + header.style.marginBottom = '5px'; + + hr = mainDiv.createEl('hr'); + hr.style.marginTop = '0px'; + hr.style.marginBottom = '10px'; + + this.addLatexButtons(mainDiv); + + info = mainDiv.createEl('p'); + info.style.textAlign = 'center'; + info.style.marginTop = '10px'; + info.style.marginBottom = '10px'; + link = info.createEl('a'); + link.appendText('Introduction into latex mathematics'); + link.style.textAlign = 'center'; + link.style.fontSize = '10px'; + link.href = 'https://en.wikibooks.org/wiki/LaTeX/Mathematics'; + + info = mainDiv.createEl('p'); + info.style.textAlign = 'center'; + info.style.marginTop = '10px'; + info.style.marginBottom = '10px'; + link = info.createEl('a'); + link.appendText('Do you miss a latex function? report it!'); + link.style.textAlign = 'center'; + + link.style.fontSize = '10px'; + link.href = + 'https://github.com/Reocin/obsidian-markdown-formatting-assistant-plugin/issues'; + + // -------------- + // Greek Section + // -------------- + header = mainDiv.createEl('h4'); + header.appendText('Greek Letters'); + header.style.textAlign = 'center'; + header.style.marginTop = '20px'; + header.style.marginBottom = '5px'; + + hr = mainDiv.createEl('hr'); + hr.style.marginTop = '0px'; + hr.style.marginBottom = '10px'; + + header = mainDiv.createEl('h5'); + header.appendText('Lower Case'); + header.style.textAlign = 'center'; + header.style.marginTop = '0px'; + header.style.marginBottom = '5px'; + + this.addGreekLowerCaseLetters(mainDiv); + + header = mainDiv.createEl('h5'); + header.appendText('Upper Case'); + header.style.textAlign = 'center'; + header.style.marginTop = '10px'; + header.style.marginBottom = '5px'; + + this.addGreekUpperCaseLetters(mainDiv); + + info = mainDiv.createEl('p'); + info.style.textAlign = 'center'; + info.style.marginTop = '10px'; + info.style.marginBottom = '10px'; + link = info.createEl('a'); + link.appendText('Overview of greek letters'); + link.style.textAlign = 'center'; + + link.style.fontSize = '10px'; + link.href = 'https://en.wikipedia.org/wiki/Greek_alphabet'; + // -------------- // Colors // -------------- @@ -161,6 +255,115 @@ export class SidePanelControlView extends ItemView { ); } + private addLatexButtons(mainDiv: HTMLElement) { + const addClickEvent = (btn: HTMLElement, type: string) => { + btn.onClickEvent(() => { + // @ts-ignore + const formatterSetting = latexFormatterSettings[type]; + + const leaf = this.app.workspace.activeLeaf; + let editor = null; + if (checkIfMarkdownSource(leaf)) { + // @ts-ignore + editor = leaf.view.sourceMode.cmEditor; + latexFormatter(editor, formatterSetting); + } + }); + }; + + const numberOfCols = 5; + let row: HTMLElement = null; + + R.keys(latexFormatterSettings).forEach((key, index) => { + // @ts-ignore + const item = latexFormatterSettings[key]; + if (index === 0 || item.newLine) { + row = mainDiv.createDiv({ cls: 'nav-buttons-container' }); + } + + let button = row.createDiv({ cls: 'nav-action-text-button' }); + button.style.textJustify = 'center'; + button.style.textAlign = 'center'; + + addClickEvent(button, key); + + if (item.type === 'icon') { + let svg = svgToElement(item.text); + svg.style.display = 'inline-block'; + svg.style.verticalAlign = 'middle'; + button.appendChild(svg); + } else if (item.type === 'text') { + let div = document.createElement('div'); + div.innerHTML = item.text; + button.appendChild(div); + } + }); + } + + private addGreekLowerCaseLetters(mainDiv: HTMLElement) { + const addClickEvent = (btn: HTMLElement, type: string) => { + btn.onClickEvent(() => { + // @ts-ignore + const formatterSetting = greekLowerCaseFormatterSettings[type]; + + const leaf = this.app.workspace.activeLeaf; + let editor = null; + if (checkIfMarkdownSource(leaf)) { + // @ts-ignore + editor = leaf.view.sourceMode.cmEditor; + greekFormatter(editor, formatterSetting); + } + }); + }; + + const numberOfCols = 5; + let row: HTMLElement = null; + + R.keys(greekLowerCaseFormatterSettings).forEach((key, index) => { + // @ts-ignore + const item = greekLowerCaseFormatterSettings[key]; + if (index % numberOfCols === 0) { + row = mainDiv.createDiv({ cls: 'nav-buttons-container' }); + } + + let button = row.createDiv({ cls: 'nav-action-button' }); + addClickEvent(button, key); + button.appendChild(svgToElement(item.icon)); + }); + } + + private addGreekUpperCaseLetters(mainDiv: HTMLElement) { + const addClickEvent = (btn: HTMLElement, type: string) => { + btn.onClickEvent(() => { + // @ts-ignore + const formatterSetting = greekUpperCaseFormatterSettings[type]; + + const leaf = this.app.workspace.activeLeaf; + let editor = null; + if (checkIfMarkdownSource(leaf)) { + // @ts-ignore + editor = leaf.view.sourceMode.cmEditor; + greekFormatter(editor, formatterSetting); + } + }); + }; + + const numberOfCols = 5; + let row: HTMLElement = null; + + R.keys(greekUpperCaseFormatterSettings).forEach((key, index) => { + // @ts-ignore + const item = greekUpperCaseFormatterSettings[key]; + if (index % numberOfCols === 0) { + row = mainDiv.createDiv({ cls: 'nav-buttons-container' }); + } + + let button = row.createDiv({ cls: 'nav-action-button' }); + addClickEvent(button, key); + button.appendChild(svgToElement(item.icon)); + }); + } + private addTextEditButtons(mainDiv: HTMLElement) { const addClickEvent = (btn: HTMLElement, type: string) => { btn.onClickEvent(() => { @@ -198,6 +401,10 @@ export class SidePanelControlView extends ItemView { addClickEvent(button, 'strikethrough'); button.appendChild(svgToElement('strikethrough')); + button = row.createDiv({ cls: 'nav-action-button' }); + addClickEvent(button, 'underline'); + button.appendChild(svgToElement('underline')); + row = mainDiv.createDiv({ cls: 'nav-buttons-container' }); button = row.createDiv({ cls: 'nav-action-button' }); addClickEvent(button, 'codeInline'); @@ -207,13 +414,14 @@ export class SidePanelControlView extends ItemView { addClickEvent(button, 'codeBlock'); button.appendChild(svgToElement('codeBlock')); - button = row.createDiv({ cls: 'nav-action-button' }); - addClickEvent(button, 'link'); - button.appendChild(svgToElement('link')); button = row.createDiv({ cls: 'nav-action-button' }); addClickEvent(button, 'mermaidBlock'); button.appendChild(svgToElement('mermaidBlock')); + button = row.createDiv({ cls: 'nav-action-button' }); + addClickEvent(button, 'link'); + button.appendChild(svgToElement('link')); + button = row.createDiv({ cls: 'nav-action-button' }); addClickEvent(button, 'internalLink'); button.appendChild(svgToElement('fileLink')); diff --git a/src/formatter.ts b/src/formatter.ts index e428932..6b60a99 100644 --- a/src/formatter.ts +++ b/src/formatter.ts @@ -81,6 +81,15 @@ export const formatSettings = { newLine: false, enclose: false, }, + underline: { + des: 'underline', + icon: 'underline', + symbol: '', + shift: 3, + selectionInput: 3, + newLine: false, + enclose: false, + }, strikethrough: { des: 'strikethrough', icon: 'strikethrough', @@ -227,6 +236,7 @@ export function iconFormatter( 'link', 'internal_link', 'image', + 'underline', ].contains(item.des) ) { if (isSelection) { @@ -244,7 +254,10 @@ export function iconFormatter( editor.replaceRange(item.symbol, curserStart); editor.setCursor(curserStart.line, curserStart.ch + item.shift); } - } else if (['code_block'].contains(item.des)||['mermaid_block'].contains(item.des)) { + } else if ( + ['code_block'].contains(item.des) || + ['mermaid_block'].contains(item.des) + ) { if (isSelection) { const re = new RegExp('^(```).*(```)$', 'gs'); const match = selection.trim().match(re); diff --git a/src/greekFormatter.ts b/src/greekFormatter.ts new file mode 100644 index 0000000..e9ef959 --- /dev/null +++ b/src/greekFormatter.ts @@ -0,0 +1,314 @@ +import { checkIfSelection } from './generalFunctions'; + +export interface greekFormatterSetting { + des: string; + text: string; + icon: string; + symbol: string; + shift: number; +} + +export const greekLowerCaseFormatterSettings = { + alpha: { + des: 'alpha', + icon: 'alpha', + symbol: '\\alpha', + shift: 6, + }, + beta: { + des: 'beta', + icon: 'beta', + symbol: '\\beta', + shift: 5, + }, + gamma: { + des: 'gamma', + icon: 'gamma', + symbol: '\\gamma', + shift: 6, + }, + delta: { + des: 'delta', + icon: 'delta', + symbol: '\\delta', + shift: 6, + }, + epsilon: { + des: 'epsilon', + icon: 'epsilon', + symbol: '\\epsilon', + shift: 8, + }, + zeta: { + des: 'zeta', + icon: 'zeta', + symbol: '\\zeta', + shift: 5, + }, + eta: { + des: 'eta', + icon: 'eta', + symbol: '\\eta', + shift: 4, + }, + theta: { + des: 'theta', + icon: 'theta', + symbol: '\\theta', + shift: 6, + }, + iota: { + des: 'iota', + icon: 'iota', + symbol: '\\iota', + shift: 5, + }, + kappa: { + des: 'kappa', + icon: 'kappa', + symbol: '\\kappa', + shift: 6, + }, + lambda: { + des: 'lambda', + icon: 'lambda', + symbol: '\\lambda', + shift: 7, + }, + mu: { + des: 'mu', + icon: 'my', + symbol: '\\mu', + shift: 3, + }, + nu: { + des: 'nu', + icon: 'ny', + symbol: '\\nu', + shift: 3, + }, + xi: { + des: 'xi', + icon: 'xi', + symbol: '\\xi', + shift: 3, + }, + pi: { + des: 'pi', + icon: 'pi', + symbol: '\\pi', + shift: 3, + }, + rho: { + des: 'rho', + icon: 'rho', + symbol: '\\rho', + shift: 4, + }, + sigma: { + des: 'sigma', + icon: 'sigma', + symbol: '\\sigma', + shift: 6, + }, + tau: { + des: 'tau', + icon: 'tau', + symbol: '\\tau', + shift: 4, + }, + upsilon: { + des: 'upsilon', + icon: 'ypsilon', + symbol: '\\upsilon', + shift: 8, + }, + phi: { + des: 'phi', + icon: 'phi', + symbol: '\\phi', + shift: 4, + }, + chi: { + des: 'chi', + icon: 'chi', + symbol: '\\chi', + shift: 4, + }, + psi: { + des: 'psi', + icon: 'psi', + symbol: '\\psi', + shift: 4, + }, + omega: { + des: 'omega', + icon: 'omega', + symbol: '\\omega', + shift: 6, + }, +}; + +export const greekUpperCaseFormatterSettings = { + // Alpha: { + // des: 'Alpha', + // icon: 'Alpha', + // symbol: '\\Alpha', + // shift: 6, + // }, + // Beta: { + // des: 'Beta', + // icon: 'Beta', + // symbol: '\\Beta', + // shift: 5, + // }, + Gamma: { + des: 'Gamma', + icon: 'Gamma', + symbol: '\\Gamma', + shift: 6, + }, + Delta: { + des: 'Delta', + icon: 'Delta', + symbol: '\\Delta', + shift: 6, + }, + // Epsilon: { + // des: 'Epsilon', + // icon: 'Epsilon', + // symbol: '\\Epsilon', + // shift: 8, + // }, + // Zeta: { + // des: 'Zeta', + // icon: 'Zeta', + // symbol: '\\Zeta', + // shift: 5, + // }, + // Eta: { + // des: 'Eta', + // icon: 'Eta', + // symbol: '\\Eta', + // shift: 4, + // }, + Theta: { + des: 'Theta', + icon: 'Theta', + symbol: '\\Theta', + shift: 6, + }, + // Iota: { + // des: 'Iota', + // icon: 'Iota', + // symbol: '\\Iota', + // shift: 5, + // }, + // Kappa: { + // des: 'Kappa', + // icon: 'Kappa', + // symbol: '\\Kappa', + // shift: 6, + // }, + Lambda: { + des: 'Lambda', + icon: 'Lambda', + symbol: '\\Lambda', + shift: 7, + }, + // Mu: { + // des: 'Mu', + // icon: 'My', + // symbol: '\\Mu', + // shift: 3, + // }, + // Nu: { + // des: 'Nu', + // icon: 'Ny', + // symbol: '\\Nu', + // shift: 3, + // }, + Xi: { + des: 'Xi', + icon: 'Xi', + symbol: '\\Xi', + shift: 3, + }, + // Omikron: { + // des: 'Omikron', + // icon: 'Omikron', + // symbol: '\\Omikron', + // shift: 8, + // }, + Pi: { + des: 'Pi', + icon: 'Pi', + symbol: '\\Pi', + shift: 3, + }, + // Rho: { + // des: 'Rho', + // icon: 'Rho', + // symbol: '\\Rho', + // shift: 4, + // }, + Sigma: { + des: 'Sigma', + icon: 'Sigma', + symbol: '\\Sigma', + shift: 6, + }, + // Tau: { + // des: 'Tau', + // icon: 'Tau', + // symbol: '\\Tau', + // shift: 4, + // }, + Upsilon: { + des: 'Upsilon', + icon: 'Ypsilon', + symbol: '\\Upsilon', + shift: 8, + }, + Phi: { + des: 'Phi', + icon: 'Phi', + symbol: '\\Phi', + shift: 4, + }, + // Chi: { + // des: 'Chi', + // icon: 'Chi', + // symbol: '\\Chi', + // shift: 4, + // }, + Psi: { + des: 'Psi', + icon: 'Psi', + symbol: '\\Psi', + shift: 4, + }, + Omega: { + des: 'Omega', + icon: 'Omega', + symbol: '\\Omega', + shift: 6, + }, +}; + +export function greekFormatter( + editor: CodeMirror.Editor, + item: greekFormatterSetting, +) { + if (editor) { + const isSelection = checkIfSelection(editor); + const selection = editor.getSelection(); + const curserStart = editor.getCursor('from'); + const curserEnd = editor.getCursor('to'); + const line = editor.getLine(curserStart.line); + + editor.focus(); + editor.replaceRange(item.symbol, curserStart); + editor.setCursor(curserStart.line, curserStart.ch + item.shift); + } +} diff --git a/src/htmlFormatter.ts b/src/htmlFormatter.ts index 519829c..018ac9e 100644 --- a/src/htmlFormatter.ts +++ b/src/htmlFormatter.ts @@ -42,8 +42,8 @@ export const htmlFormatterSettings = { p: { des: '

', symbol: '

', - shift: 5, - selectionInput: 5, + shift: 3, + selectionInput: 3, }, font: { des: '', @@ -106,6 +106,12 @@ export const htmlFormatterSettings = { shift: 9, selectionInput: 9, }, + u: { + des: '', + symbol: '', + shift: 3, + selectionInput: 3, + }, }; export function htmlFormatter( diff --git a/src/iconPaths.ts b/src/iconPaths.ts new file mode 100644 index 0000000..1fec4f8 --- /dev/null +++ b/src/iconPaths.ts @@ -0,0 +1,106 @@ +export const greek = { + alpha: + 'M 14.401734,12.57328 13.755395,9.1800053 Q 13.094368,5.7132827 10.479636,5.6985932 8.5112431,5.6839037 7.6151835,7.3144385 6.4840918,9.3269003 6.4840918,12.015079 q 0,3.231691 1.1017126,4.774088 1.1164022,1.571777 2.8938316,1.571777 1.968394,0 3.026038,-3.128864 z m 1.513018,-4.4949874 1.454261,-4.3040242 h 2.409078 l -3.011348,8.9165276 0.58758,3.217001 q 0.132206,0.719786 0.646339,1.322056 0.602269,0.705096 1.072333,0.705096 h 1.292676 v 2.291562 h -1.615845 q -1.380813,0 -2.614731,-1.233918 -0.60227,-0.616959 -0.851991,-1.909635 -0.646338,1.571776 -2.056531,2.908521 -0.646338,0.616959 -2.746937,0.60227 -3.4373431,-0.02938 -5.1266359,-2.232805 -1.7186718,-2.291562 -1.7186718,-6.345865 0,-4.362782 1.8655668,-6.3458648 2.0712198,-2.2181148 4.9797409,-2.2621833 4.568436,-0.073448 5.435116,4.6712617 z', + Alpha: `M 12,5.0899277 8.5418087,14.467431 H 15.470813 Z M 10.561191,2.5783215 h 2.89024 L 20.632858,21.421678 H 17.98242 L 16.265945,16.587782 H 7.7719191 L 6.0554443,21.421678 H 3.3671424 Z`, + Beta: + 'm 7.8859735,12.420825 v 6.871367 h 4.0700605 q 2.047592,0 3.027421,-0.841648 0.992391,-0.85421 0.992391,-2.600316 0,-1.758668 -0.992391,-2.587755 -0.979829,-0.841648 -3.027421,-0.841648 z m 0,-7.7130155 v 5.6528615 h 3.7560125 q 1.859163,0 2.763621,-0.6909053 0.91702,-0.7034672 0.91702,-2.1355255 0,-1.4194963 -0.91702,-2.1229635 Q 13.501149,4.7078095 11.641986,4.7078095 Z M 5.3484667,2.6225317 h 6.4819483 q 2.901802,0 4.472041,1.2059437 1.570239,1.2059438 1.570239,3.4294027 0,1.7209823 -0.803962,2.7384974 -0.803963,1.0175155 -2.36164,1.2687535 1.871725,0.401981 2.901802,1.683296 1.042639,1.268754 1.042639,3.178165 0,2.512383 -1.70842,3.881631 -1.708421,1.369249 -4.861461,1.369249 H 5.3484667 Z', + beta: + 'm 9.2302992,16.654701 v 4.585227 H 7.5166283 V 6.9840389 q 0,-4.2239673 3.9460747,-4.2239673 4.001653,0 4.020179,3.5662882 0.02779,2.5380856 -1.59325,3.4643942 2.584401,0.833678 2.593664,3.306922 0.01853,4.399966 -4.464808,4.390703 -1.963774,-0.0093 -2.7881888,-0.833678 z m 0,-2.223141 q 1.0282028,1.611777 2.8530308,1.602514 2.667769,0 2.667769,-2.908609 0,-2.61219 -4.298072,-2.408402 V 9.142338 q 3.3625,0.055578 3.3625,-2.9641876 0,-2.0378789 -2.167562,-2.0286159 -2.4176658,0 -2.4176658,2.8900829 z', + chi: + 'M 13.641778,18.976096 11.900675,14.500644 8.3133019,21.044386 H 5.7776018 L 10.849002,11.789665 8.7222858,6.2859105 Q 8.1497084,4.8135685 6.3501792,4.8135685 H 5.7776018 V 2.9672983 l 0.8179678,0.02337 q 3.0147955,0.081797 3.7743374,2.0332342 l 1.729417,4.4754523 3.587373,-6.5437422 h 2.5357 l -5.0714,9.2547209 2.126716,5.503755 q 0.572578,1.472342 2.372107,1.472342 h 0.572577 v 1.84627 l -0.817967,-0.02337 q -3.014796,-0.0818 -3.762652,-2.033235 z', + Chi: + 'm 3.4596471,0.83472184 h 3.2456333 l 5.5489856,8.30104376 5.5789,-8.30104376 h 3.245633 l -7.179281,10.72405116 7.6579,11.606504 h -3.245633 l -6.281871,-9.49759 -6.3267416,9.49759 H 2.4425822 L 10.414576,11.244679 Z', + delta: + 'M 16.356173,5.6275098 Q 15.17758,4.8186714 12.415974,4.8186714 q -2.923373,0 -2.923373,1.3519156 0,1.0630447 3.050476,1.6176768 2.403406,0.4275289 3.755322,1.7216703 1.640786,1.5599029 1.640786,4.7605919 0,3.062031 -1.583012,4.864585 Q 14.77316,20.94922 12,20.94922 q -2.7616053,0 -4.3561725,-1.814109 -1.5830123,-1.802554 -1.5830123,-4.980133 0,-2.357187 1.5830123,-4.2637343 Q 8.2562338,9.1517343 9.1228463,8.7357602 7.3202922,7.8229283 7.3202922,6.1936966 q 0,-3.1429149 5.0956818,-3.1429149 2.553619,0 3.940199,0.8088384 z m -5.63876,3.6859921 q -0.7857282,0.3350902 -1.4212441,1.1785931 -0.9937158,1.305696 -0.9937158,3.662883 0,2.345631 0.9821609,3.662882 0.993716,1.328806 2.715386,1.328806 1.698561,0 2.692277,-1.340361 0.993715,-1.340361 0.993715,-3.535779 0,-2.299412 -1.05149,-3.408676 Q 13.513683,9.6717018 12.057774,9.5445986 11.318265,9.4752696 10.717413,9.3135019 Z', + Delta: + 'M 12,5.4972069 7.1303291,18.870986 H 16.881548 Z M 3.8759636,20.866364 10.645994,3.1336349 h 2.719889 l 6.758153,17.7327291 z', + epsilon: + 'M 9.6932475,11.339868 Q 8.0317921,10.983842 7.1417267,10.019604 6.2516613,9.0702014 6.2516613,7.6906 q 0,-2.0916537 1.6911243,-3.2635732 1.6762898,-1.157085 4.5838364,-1.157085 1.127417,0 2.388343,0.178013 1.260926,0.1780131 2.714699,0.5340393 V 6.4593428 Q 16.190725,6.0291445 15.003971,5.836297 13.802383,5.6434495 12.749139,5.6434495 q -1.765297,0 -2.7888718,0.6823835 -1.0384097,0.6823835 -1.0384097,1.6317866 0,1.0384097 1.0087408,1.7059587 0.9939067,0.6527147 2.7146997,0.6527147 h 2.299335 v 2.254832 h -2.195494 q -2.032316,0 -3.1003947,0.756556 -1.1570851,0.830728 -1.1570851,2.136157 0,1.335098 1.2460916,2.165826 1.2609262,0.830727 3.5009242,0.830727 1.379601,0 2.640527,-0.267019 1.260926,-0.281854 2.31417,-0.830728 v 2.536687 q -1.335098,0.415363 -2.581189,0.623045 -1.260926,0.207682 -2.44768,0.207682 -3.5305931,0 -5.4442338,-1.349932 -1.9136406,-1.349933 -1.9136406,-3.916288 0,-1.602118 1.0235752,-2.685031 1.0235752,-1.082913 2.8630437,-1.438939 z', + Epsilon: + 'M 6.2256278,3.0383187 H 17.558283 V 5.079157 H 8.650624 v 5.30618 h 8.535506 v 2.040838 H 8.650624 v 6.494668 h 9.123748 v 2.040838 H 6.2256278 Z', + epsilonV2: + 'M 18.514318,6.2709902 Q 17.960863,6.076533 17.407408,5.9269504 15.926541,5.5380359 14.340966,5.5380359 q -2.73736,0 -4.263102,1.480867 Q 8.6568302,8.3950621 8.3875817,10.923007 H 18.514318 v 2.153988 H 8.3875817 q 0.2692485,2.527945 1.6902823,3.904104 1.525742,1.480867 4.263102,1.480867 1.914656,0 3.066442,-0.388915 l 1.10691,-0.373956 v 2.498028 l -1.181702,0.269249 q -1.555658,0.329081 -3.156191,0.329081 -4.008811,0 -6.3422987,-2.333487 -2.3484455,-2.333488 -2.3484455,-6.461965 0,-4.1284778 2.3484455,-6.4619651 2.3334877,-2.3334874 6.3422987,-2.3334874 1.510784,0 3.156191,0.3290816 0.598331,0.119666 1.181702,0.299165 z', + eta: + 'M 17.268669,8.4557243 V 20.835414 H 15.201643 V 8.5231273 q 0,-1.7861803 -0.696498,-2.6736535 -0.696498,-0.8874732 -2.089494,-0.8874732 -1.673842,0 -2.6399523,1.0672146 -0.96611,1.0672147 -0.96611,2.9095641 V 16.049799 H 6.7313286 V 3.4679001 H 8.8095887 V 5.422588 Q 9.551022,4.2879703 10.550834,3.7262784 q 1.011045,-0.5616919 2.325404,-0.5616919 2.168131,0 3.280281,1.3368267 1.11215,1.3480606 1.11215,3.9543111 z', + Eta: + 'M 5.1765843,3.0480151 H 7.5989568 V 10.387084 H 16.401043 V 3.0480151 h 2.422373 V 20.951986 H 16.401043 V 12.425715 H 7.5989568 v 8.526271 H 5.1765843 Z', + gamma: + 'M 9.3393684,5.1089069 12.167372,13.096573 16.207376,3.0773617 h 2.25086 L 13.229316,16.005377 V 20.92264 H 11.105428 V 16.005377 L 7.7118237,6.3555369 Q 7.2039374,4.9011352 6.1073647,4.9011352 H 5.541764 V 3.0773617 h 0.8080009 q 2.2739456,0 2.9896035,2.0315452 z', + Gamma: + 'M 6.4626058,20.89917 V 3.1008309 H 17.537393 V 5.1274335 H 8.8706865 V 20.89917 Z', + iota: + 'M 11.406705,3.4808912 V 14.510095 q 0,2.205841 0.517232,2.905625 0.547657,0.730209 2.190628,0.730209 h 1.35393 v 2.373181 h -1.68861 q -2.738285,0 -3.9857258,-1.460419 -1.247441,-1.490844 -1.247441,-4.715935 L 8.5315055,3.4808912 Z', + Iota: 'M 2.8576269,0.82926106 H 5.2855426 V 18.774202 H 2.8576269 Z', + kappa: + 'm 1.7263958,1.4153005 h 2.9457887 v 7.20943 l 7.4885045,-7.20943 h 3.47293 L 8.7962885,7.958052 16.703405,18.779949 H 13.214971 L 6.7962531,9.8185501 4.6721845,11.818586 v 6.961363 H 1.7263958 Z', + kappaV2: + 'M 10.230844,14.202115 Q 8.7976033,18.158456 5.8116853,20.009725 3.7066132,21.338459 3.6618244,19.173668 3.6468948,18.158456 4.5575998,16.904371 5.9908404,14.933665 8.0212646,13.082396 9.3798573,10.051689 8.7378849,7.5285883 8.3497156,5.975911 6.2297138,5.975911 q -0.8509866,0 -2.2095793,1.6123957 V 4.2440785 Q 5.2443609,3.3333736 7.1254892,3.5871766 10.798168,4.0649235 11.290845,7.648025 q 0.283662,2.0901426 -0.343381,3.762257 l 2.821693,-1.612396 q 1.43324,-3.9563413 4.419158,-5.8076105 2.105072,-1.3287335 2.149861,0.836057 0.01493,1.0152122 -0.895775,2.2692977 -1.433241,1.9707059 -3.463665,3.8219748 -1.358593,3.030707 -0.71662,5.553808 0.388169,1.552677 2.508171,1.552677 0.850986,0 2.209579,-1.612396 v 3.344228 q -1.224226,0.910705 -3.105355,0.656902 -3.672679,-0.477747 -4.165355,-4.060848 -0.283662,-2.090143 0.34338,-3.762257 z', + Kappa: + 'M 5.0808843,3.2824989 H 7.4398065 V 10.651211 L 15.263954,3.2824989 h 3.036237 L 9.6469168,11.41027 18.919116,20.717503 H 15.812812 L 7.4398065,12.321141 v 8.396362 H 5.0808843 Z', + lambda: + 'M 12.314527,5.2264366 18.122042,20.739355 H 15.931587 L 12.404392,11.438344 8.0684131,20.739355 H 5.8779576 L 11.393412,8.675 10.562163,6.4508451 Q 10.034207,5.0354738 8.8322643,5.0354738 H 7.7538862 V 3.2606432 l 1.3142733,0.022466 q 2.5386815,0.033699 3.2463675,1.9433272 z', + Lambda: + 'M 6.3859009,20.89793 H 3.8470408 L 10.641173,3.1020703 h 2.729573 L 20.152959,20.89793 H 17.649858 L 12,5.474057 Z', + my: + 'M 5.6951998,21.033569 V 2.9664295 h 2.1502934 v 8.1337185 q 0,1.694525 0.8063601,2.559317 0.80636,0.864792 2.3840207,0.864792 1.729584,0 2.594376,-0.981656 0.876478,-0.981656 0.876478,-2.944967 V 2.9664295 h 2.150294 V 13.040087 q 0,0.701182 0.198668,1.040087 0.210355,0.327219 0.642751,0.327219 0.105177,0 0.292159,-0.05843 0.186982,-0.07012 0.514201,-0.210355 v 1.729584 q -0.479142,0.268787 -0.911538,0.397337 -0.420709,0.12855 -0.829732,0.12855 -0.80636,0 -1.285502,-0.455769 -0.479141,-0.455769 -0.654437,-1.390679 -0.584319,0.923224 -1.437424,1.390679 -0.84142,0.455769 -1.986684,0.455769 -1.192011,0 -2.0334301,-0.455769 -0.8297328,-0.455769 -1.3205607,-1.367306 v 6.462567 z', + My: + 'm 3.7687495,3.0034731 h 3.627535 L 11.987948,15.24791 16.603715,3.0034731 H 20.23125 V 20.996529 H 17.857083 V 5.1968663 L 13.217213,17.537716 H 10.770736 L 6.1308653,5.1968663 V 20.996529 H 3.7687495 Z', + ny: + 'M 9.7754676,20.591297 4.52864,3.4087037 H 7.566277 L 12,17.829809 Q 13.840992,15.92745 15.375152,13.288695 16.541114,11.309628 16.60248,9.591369 16.633163,8.7782641 16.264965,7.244104 15.8354,5.4184534 14.20919,3.4087037 h 2.853538 v 0 q 1.058571,1.3654025 1.764284,3.267761 0.644348,1.7489426 0.644348,2.9455875 0,3.0069538 -2.086458,5.6917338 -2.715464,3.497885 -4.602481,5.277511 z', + Ny: + 'm 5.3103501,3.161375 h 3.220504 l 7.8381389,14.78827 V 3.161375 H 18.68965 V 20.838627 H 15.469146 L 7.6310074,6.0503566 V 20.838627 H 5.3103501 Z', + omega: + 'm 8.2760531,19.014332 q -5.066931,0 -5.066931,-7.252426 0,-2.8692265 1.8924682,-6.7762576 h 2.4174755 q -1.7459545,3.9070311 -1.7459545,6.8373046 -0.012209,5.286701 2.7105028,5.286701 2.5273609,0 2.4785229,-6.568696 h 2.07561 q -0.04884,6.605325 2.478523,6.568696 2.710503,-0.02442 2.710503,-5.286701 0,-2.9302735 -1.745955,-6.8373046 h 2.417476 q 1.892468,3.9070311 1.892468,6.7762576 0.02442,7.264636 -5.066931,7.252426 -3.308767,-0.01221 -3.723889,-3.650632 -0.500588,3.650632 -3.7238889,3.650632 z', + Omega: + 'm 20.200889,18.722517 v 2.072048 h -6.984433 v -2.072048 q 2.060408,-1.129151 3.212839,-3.061511 1.152432,-1.93236 1.152432,-4.283786 0,-2.7937731 -1.536576,-4.4816779 -1.536575,-1.6879048 -4.050971,-1.6879048 -2.5143964,0 -4.0626126,1.6995455 Q 6.394992,8.5950876 6.394992,11.37722 q 0,2.351426 1.1524316,4.283786 1.1640723,1.93236 3.2361214,3.061511 v 2.072048 H 3.7991108 v -2.072048 h 3.7133906 q -1.8392342,-1.618061 -2.689007,-3.352529 -0.838132,-1.734467 -0.838132,-3.87636 0,-3.7017502 2.2350188,-5.9949726 Q 8.4437593,3.205433 11.99418,3.205433 q 3.527139,0 5.773798,2.2932224 2.235019,2.2815816 2.235019,5.8785646 0,2.258301 -0.826491,3.981128 -0.826492,1.722827 -2.700648,3.364169 z', + omikron: + 'm 12,5.6961742 q -2.1596437,0 -3.4145719,1.6926938 Q 7.3305,9.0669695 7.3305,11.999999 q 0,2.93303 1.240336,4.625724 1.2549281,1.678101 3.429164,1.678101 2.145052,0 3.39998,-1.692694 1.254928,-1.692693 1.254928,-4.611131 0,-2.9038451 -1.254928,-4.5965388 Q 14.145052,5.6961742 12,5.6961742 Z M 12,3.419793 q 3.502125,0 5.501255,2.2763812 1.999129,2.2763813 1.999129,6.3038248 0,4.012852 -1.999129,6.303825 -1.99913,2.276381 -5.501255,2.276381 -3.5167172,0 -5.5158469,-2.276381 -1.9845374,-2.290973 -1.9845374,-6.303825 0,-4.0274435 1.9845374,-6.3038248 Q 8.4832828,3.419793 12,3.419793 Z', + Omikron: + 'm 12.011717,4.8465967 q -2.5778024,0 -4.1010495,1.9216348 -1.5115297,1.9216347 -1.5115297,5.2376265 0,3.304274 1.5115297,5.225909 1.5232471,1.921635 4.1010495,1.921635 2.577803,0 4.077615,-1.921635 1.51153,-1.921635 1.51153,-5.225909 0,-3.3159918 -1.51153,-5.2376265 Q 14.58952,4.8465967 12.011717,4.8465967 Z m 0,-1.9216347 q 3.679228,0 5.882077,2.4723471 2.20285,2.4606299 2.20285,6.6085489 0,4.136201 -2.20285,6.608549 -2.202849,2.460629 -5.882077,2.460629 -3.6909445,0 -5.9055114,-2.460629 -2.2028496,-2.46063 -2.2028496,-6.608549 0,-4.147919 2.2028496,-6.6085489 Q 8.3207725,2.924962 12.011717,2.924962 Z', + phi: + 'm 13.801441,4.860948 q -0.748449,0 -0.748449,1.6696169 V 14.42958 q 1.082372,0 2.187774,-1.197518 0.990255,-1.070858 0.978741,-3.6386136 Q 16.207992,7.1984117 15.229251,5.9087766 14.423229,4.860948 13.801441,4.860948 Z m 0,-1.8077921 q 1.658102,0 3.074398,1.5199271 1.531442,1.6235586 1.5775,5.0203654 0.04606,3.1204566 -1.5775,4.9743066 -1.531442,1.750219 -3.822847,1.750219 v 4.628869 H 10.94582 v -4.617354 q -2.2914051,0 -3.8343614,-1.761734 Q 5.5454731,12.771478 5.5454731,9.604963 5.5339585,6.3117875 7.1114586,4.630656 8.308977,3.3755647 10.197371,3.0531559 V 4.9300356 Q 9.4374077,5.1948714 8.7695609,6.0930102 7.7677908,7.4171891 7.7793054,9.604963 7.79082,11.930912 8.7695609,13.255091 9.6446705,14.441095 10.94582,14.441095 V 6.5305649 q 0,-3.477409 2.855621,-3.477409 z', + Phi: + 'M 10.832526,6.8944823 Q 8.3117132,7.1268153 6.9757984,8.3117136 5.6398837,9.4966119 5.6398837,11.785092 q 0,2.28848 1.3359147,3.473378 1.3359148,1.173282 3.8567276,1.405615 z m 2.35818,9.7696027 q 2.520813,-0.232333 3.845111,-1.405615 1.324298,-1.184898 1.324298,-3.473378 0,-2.2884801 -1.324298,-3.4733784 -1.324298,-1.1848983 -3.845111,-1.4172313 z m -2.35818,1.939981 Q 7.1500482,18.336883 5.1519844,16.606002 3.1655372,14.863504 3.1655372,11.785092 q 0,-3.0784123 1.9864472,-4.8209098 Q 7.1500482,5.210068 10.832526,4.9428851 V 3.3281707 h 2.35818 v 1.6147144 q 3.682478,0.2671829 5.657309,2.0096804 1.986447,1.7308809 1.986447,4.8325265 0,3.078412 -1.986447,4.82091 -1.974831,1.730881 -5.657309,1.998064 v 2.067763 h -2.35818 z', + pi: + 'M 3.7189921,3.2906647 H 19.845165 V 6.0560104 H 17.726069 V 16.395998 q 0,1.082092 0.360697,1.563022 0.375726,0.4659 1.202324,0.4659 0.225436,0 0.556075,-0.03006 0.330639,-0.04509 0.435843,-0.06012 v 1.998864 q -0.526017,0.195378 -1.082092,0.285552 -0.556075,0.09017 -1.11215,0.09017 -1.803486,0 -2.494823,-0.976888 -0.691336,-0.991918 -0.691336,-3.637031 V 6.0560104 H 8.6936084 V 20.123203 H 5.8681466 V 6.0560104 H 3.7189921 Z', + Pi: + 'M 18.608513,3.3299575 V 20.670044 H 16.262432 V 5.3043813 H 7.7375675 V 20.670044 h -2.34608 V 3.3299575 Z', + psi: + 'M 10.935468,16.327933 Q 8.2479614,15.897466 7.0030989,14.768946 5.479015,13.384473 5.479015,10.557355 V 3.0067407 h 2.1639665 v 7.4691753 q 0,2.129063 0.9889095,3.013265 0.8609329,0.767859 2.303577,0.930738 V 3.0067407 h 2.129064 V 14.408285 q 1.524084,-0.162879 2.303577,-0.930738 0.98891,-0.977276 0.98891,-3.013266 V 3.0067407 h 2.163966 v 7.5389803 q 0,2.931826 -1.524084,4.211591 -1.372839,1.151788 -3.932369,1.558986 v 4.67696 h -2.129064 z', + Psi: + 'm 10.801897,20.855284 q 0.01186,-1.589562 0,-3.677345 -2.5385542,0 -4.768686,-2.491105 Q 3.8505289,12.266904 3.7912169,7.9964391 V 3.1447164 h 2.5266918 v 4.8517227 q 0,3.3451979 1.5421124,5.2906319 1.3048643,1.660736 2.9418759,1.82681 V 3.1447164 h 2.396205 V 15.113881 q 1.637012,-0.166074 2.941876,-1.82681 1.542113,-1.945434 1.542113,-5.2906319 V 3.1447164 h 2.526691 v 4.8517227 q -0.05931,4.2704649 -2.241994,6.6903949 -2.230131,2.491105 -4.768686,2.491105 -0.01186,0.854093 0,3.677345 z', + rho: + 'M 7.2721353,5.5638933 Q 7.9738378,4.3905546 9.7108392,3.3552558 10.389535,2.9526396 12.483139,2.9526396 q 2.346678,0 3.807599,1.8635379 1.472425,1.8635378 1.472425,4.9004144 0,3.0368761 -1.472425,4.9004141 -1.460921,1.863538 -3.807599,1.863538 -1.414908,0 -2.438704,-0.552159 Q 9.0321433,15.364722 8.3649507,14.21439 v 6.832972 H 6.2368365 V 9.8316251 q 0,-2.657267 1.0352988,-4.2677318 z m 8.2938937,4.1526986 q 0,-2.335174 -0.966279,-3.6580558 -0.954775,-1.3343852 -2.63426,-1.3343852 -1.679485,0 -2.6457637,1.3343852 -0.9547756,1.3228818 -0.9547756,3.6580558 0,2.3351741 0.9547756,3.6695591 0.9662787,1.322882 2.6457637,1.322882 1.679485,0 2.63426,-1.322882 0.966279,-1.334385 0.966279,-3.6695591 z', + rhoV2: + 'M 6.343175,9.8672262 Q 6.3658039,7.5590777 7.3614758,5.669564 8.0516575,4.5154897 9.76014,3.4971889 10.427693,3.101183 12.486923,3.101183 q 2.308149,0 3.745084,1.8329415 1.44825,1.8329415 1.44825,4.8199572 0,2.9870153 -1.44825,4.8199573 -1.436935,1.832941 -3.745084,1.832941 -1.391677,0 -2.398664,-0.543093 -0.9956718,-0.554409 -1.6519101,-1.685854 0.056572,4.797328 3.3151351,4.797328 h 5.657227 v 1.923457 h -5.476196 q -5.6798556,0 -5.6119689,-8.259551 z m 8.225608,3.4961658 q 0.950414,-1.312476 0.950414,-3.6093103 0,-2.2968341 -0.950414,-3.5979962 -0.9391,-1.3124766 -2.59101,-1.3124766 -1.65191,0 -2.6023244,1.3124766 -0.9390997,1.3011621 -0.9390997,3.5979962 0,2.2968343 0.9390997,3.6093103 0.9504144,1.301163 2.6023244,1.301163 1.65191,0 2.59101,-1.301163 z', + Rho: + 'm 8.7160019,5.1915682 v 6.5797248 h 2.9790551 q 1.653728,0 2.556827,-0.856185 0.9031,-0.856186 0.9031,-2.4395418 0,-1.5716276 -0.9031,-2.4278128 -0.903099,-0.8561852 -2.556827,-0.8561852 z m -2.36917,-1.9469417 h 5.3482251 q 2.94387,0 4.445126,1.3370564 1.512985,1.3253277 1.512985,3.8938833 0,2.5920128 -1.512985,3.9173408 -1.501256,1.325327 -4.445126,1.325327 H 8.7160019 v 7.037139 h -2.36917 z', + sigma: + 'm 11.272533,5.5802928 q -2.2798958,0 -3.5098398,1.6499248 -1.2899411,1.7249214 -1.2899411,4.5747914 0,3.014863 1.2749418,4.754783 1.2899412,1.724922 3.5248391,1.724922 2.2049,0 3.494841,-1.739921 1.289941,-1.739921 1.289941,-4.739784 0,-2.7448748 -1.289941,-4.5747914 -1.184946,-1.6499248 -3.494841,-1.6499248 z m 0,-2.2048994 9.164582,0.014999 v 2.7598741 h -3.089859 q 1.634926,2.3398934 1.634926,5.6547422 0,4.124812 -2.054907,6.464705 -2.054906,2.354893 -5.654742,2.354893 -3.614835,0 -5.654742,-2.354893 -2.0549063,-2.339893 -2.0549063,-6.464705 0,-4.1398112 2.0549063,-6.4797045 1.7099221,-1.9499111 5.654742,-1.9499111 z', + Sigma: + 'm 9.086566,18.74536 h 8.541392 v 1.989091 H 6.3720414 V 18.74536 L 11.976599,11.444225 6.3720414,5.2546408 V 3.2655495 H 17.417348 V 5.2546408 H 9.086566 l 5.604557,6.1427822 z', + tau: + 'm 13.906962,17.409391 q 0.547017,0.729356 2.188069,0.729356 h 1.352348 v 2.370408 h -1.686636 q -2.735086,0 -3.98107,-1.458712 Q 10.53369,17.56134 10.53369,14.340017 V 6.2867085 H 4.1518225 V 3.4908429 H 19.848177 v 2.7958656 h -6.457842 v 8.2204525 q 0,2.203264 0.516627,2.90223 z', + Tau: + 'M 4.5314337,3.1713617 H 19.468567 V 5.1819022 H 13.200411 V 20.828638 H 10.799589 V 5.1819022 H 4.5314337 Z', + theta: + 'M 15.579689,12.72607 H 8.4090535 Q 8.5779067,16.091879 9.3546318,17.521503 10.322724,19.277577 12,19.277577 q 1.688532,0 2.622854,-1.767331 0.821752,-1.55345 0.956835,-4.784176 z M 15.545918,10.8124 Q 15.230726,7.6154443 14.622854,6.4897558 13.654762,4.711168 12,4.711168 q -1.722304,0 -2.6341113,1.756074 Q 8.645448,7.8856095 8.4315672,10.8124 Z M 12,3.0226353 q 2.701652,0 4.243845,2.3864596 1.542193,2.3752027 1.542193,6.5852771 0,4.198818 -1.542193,6.585278 Q 14.701652,20.977367 12,20.977367 q -2.7129095,0 -4.2438459,-2.397717 -1.5421932,-2.38646 -1.5421932,-6.585278 0,-4.2100744 1.5421932,-6.5852771 Q 9.2870905,3.0226353 12,3.0226353 Z', + thetaV2: + 'm 15.469438,10.838572 q 0.06605,-2.7081621 -0.539431,-4.0952695 -0.825659,-1.8714941 -2.36689,-1.8714941 -0.913729,0 -1.618292,0.781624 -0.616492,0.7265801 -0.616492,1.7173711 0,1.6843447 1.332064,2.8622855 0.81465,0.715571 3.809041,0.605483 z m 0.03303,1.871494 q -3.390707,0.09908 -4.832858,-0.715571 -2.3228548,-1.321055 -2.3228548,-4.5686476 0,-1.7614062 1.144914,-2.9723729 1.1449138,-1.2329844 3.0714518,-1.2329844 2.300837,0 3.787024,2.3338632 1.409125,2.2017578 1.310046,6.4401417 -0.09908,4.260401 -1.508205,6.440141 -1.508204,2.344872 -4.150313,2.344872 -2.6090829,0 -4.1503133,-2.344872 -1.6403096,-2.476977 -1.5082041,-7.607073 l 2.1467138,0.01101 q -0.36329,4.205357 0.9247383,6.572247 0.9357473,1.706362 2.5870653,1.706362 1.585266,0 2.565048,-1.717371 1.045835,-1.827459 0.935747,-4.689744 z', + Theta: + 'm 7.9367942,10.451838 h 8.1264118 v 1.956784 H 7.9367942 Z M 12.01151,4.9728405 q -2.532309,0 -4.0171633,1.8877217 -1.4963647,1.8877216 -1.4963647,5.1451928 0,3.24596 1.4848542,5.133682 1.4963648,1.887721 4.0286738,1.887721 2.53231,0 4.017164,-1.887721 1.473344,-1.887722 1.473344,-5.133682 0,-3.2574712 -1.473344,-5.1451928 Q 14.54382,4.9728405 12.01151,4.9728405 Z m 0,-1.8877216 q 3.614297,0 5.77827,2.428715 2.163974,2.4172046 2.163974,6.4919211 0,4.063205 -2.163974,6.48041 -2.163973,2.428715 -5.77827,2.428715 -3.6258063,0 -5.7897799,-2.417204 -2.1754841,-2.417205 -2.1754841,-6.491921 0,-4.0747165 2.1754841,-6.5034316 Q 8.3857037,3.0851189 12.01151,3.0851189 Z', + xi: + 'm 13.455676,15.869969 q 1.171642,0.0089 1.872851,0.674582 0.745591,0.70121 0.745591,1.766338 0,1.020749 -0.65683,1.730835 -0.710086,0.772218 -2.156886,0.772218 0,-0.665705 0,-1.340287 0.612449,0.04438 0.985244,-0.346167 0.284035,-0.310662 0.284035,-0.639077 0,-0.470432 -0.284035,-0.860979 -0.275158,-0.372795 -0.78997,-0.372795 -5.5297944,0 -5.5297944,-3.878845 0,-2.662822 2.9557324,-3.4439165 -2.4853005,-0.3195386 -2.4853005,-2.6273179 0,-1.7485866 1.9527365,-2.4764247 H 8.5028264 V 3.1860592 h 7.0032226 v 1.6420737 q -5.5830508,0 -5.5830508,2.5829376 0,1.6953301 4.6865668,1.7752148 v 1.5089327 q -5.0593619,-0.195274 -5.0416097,2.680574 0.00888,2.405416 3.8877207,2.494177 z', + Xi: + 'm 7.8096655,10.414628 h 8.3806695 v 2.003817 H 7.8096655 Z M 6.5720139,3.2008867 H 17.427987 V 5.2047036 H 6.5720139 Z m 0,15.5944103 H 17.427987 v 2.003817 H 6.5720139 Z', + ypsilon: + 'M 8.0381133,3.5543118 V 14.212449 q 0,1.984619 0.735044,2.925475 0.8085484,1.014361 2.3815427,1.014361 2.205132,0 3.748724,-3.057783 0.867352,-1.734704 1.087865,-4.483768 Q 16.108896,9.1112442 15.66787,7.2295316 15.256245,5.480127 13.697952,3.5543118 h 2.734363 v 0 q 1.029062,1.3230791 1.690602,3.1312873 0.617436,1.6906011 0.617436,3.9545369 0,3.719322 -1.881712,6.468387 -2.293337,3.3518 -6.027361,3.337099 -2.631457,0 -4.1162458,-1.764105 Q 5.274348,16.946813 5.274348,14.05074 L 5.2596471,3.5543118 Z', + Ypsilon: + 'm 4.4662565,3.0660208 h 2.5970173 l 4.9546782,7.3482432 4.918775,-7.3482432 h 2.597017 l -6.31901,9.3588372 v 8.509121 h -2.429468 v -8.509121 z', + zeta: + 'm 13.354145,15.871523 q 1.172112,0.0089 1.873604,0.674853 0.74589,0.701491 0.74589,1.767048 0,1.021158 -0.657094,1.731529 -0.710371,0.772529 -2.157752,0.772529 0,-0.665973 0,-1.340826 0.612695,0.0444 0.98564,-0.346306 0.284148,-0.310787 0.284148,-0.639334 0,-0.470621 -0.284148,-0.861325 -0.275269,-0.372944 -0.790288,-0.372944 -5.3810606,0 -5.3899402,-4.999237 0,-4.3687818 5.0702732,-7.432257 H 8.3105107 V 3.1825199 H 16.035796 V 4.825253 q -6.4288581,3.2321883 -6.4288581,7.432257 0,3.614013 3.7472071,3.614013 z', + Zeta: + 'M 5.1680194,3.3042234 H 18.83198 V 5.0981279 L 7.8355786,18.715494 H 19.099901 v 1.980284 H 4.9000986 V 18.901873 L 15.8965,5.2845076 H 5.1680194 Z', +}; + +export const latex = {}; diff --git a/src/icons.ts b/src/icons.ts index a0dba91..5d7368c 100644 --- a/src/icons.ts +++ b/src/icons.ts @@ -1,5 +1,7 @@ +import * as R from 'ramda'; import { addIcon } from 'obsidian'; import * as mdiIcons from '@mdi/js'; +import * as iconPaths from './iconPaths'; function pathToSvg(icon: string) { return ` @@ -7,7 +9,22 @@ function pathToSvg(icon: string) { `; } + +function importIconPaths() { + let res = {}; + // @ts-ignore + R.forEachObjIndexed((value, key, obj) => { + res = R.merge(res, R.map(pathToSvg, value)); + }, iconPaths); + return res; +} + export const icons: Record = { + ...importIconPaths(), + + division: pathToSvg(mdiIcons.mdiDivision), + multiplication: pathToSvg(mdiIcons.mdiCircleSmall), + h1: pathToSvg(mdiIcons.mdiFormatHeader1), h2: pathToSvg(mdiIcons.mdiFormatHeader2), h3: pathToSvg(mdiIcons.mdiFormatHeader3), @@ -28,6 +45,7 @@ export const icons: Record = { numberList: pathToSvg(mdiIcons.mdiFormatListNumbered), checkList: pathToSvg(mdiIcons.mdiFormatListBulletedSquare), viewIcon: pathToSvg(mdiIcons.mdiLanguageMarkdown), + underline: pathToSvg(mdiIcons.mdiFormatUnderline), }; export const addIcons = (): void => { @@ -42,6 +60,15 @@ export const addIcons = (): void => { * @param svgText svg image as a string */ export const svgToElement = (key: string | number): HTMLElement => { - const parser = new DOMParser(); - return parser.parseFromString(icons[key], 'text/xml').documentElement; + if (key.toString().contains('.svg')) { + const img = document.createElement('img'); + img.src = key.toString(); + img.style.width = '24px'; + img.style.height = '24px'; + + return img; + } else { + const parser = new DOMParser(); + return parser.parseFromString(icons[key], 'text/xml').documentElement; + } }; diff --git a/src/latexFormatter.ts b/src/latexFormatter.ts new file mode 100644 index 0000000..ffbea8c --- /dev/null +++ b/src/latexFormatter.ts @@ -0,0 +1,258 @@ +import { checkIfSelection } from './generalFunctions'; + +export interface latexFormatterSetting { + des: string; + text: string; + symbol: string; + shift: number; + selectionInput: number; + type: string; + newLine: boolean; +} + +export const latexFormatterSettings = { + inlineEquation: { + des: 'inline equation', + text: '$$x$$', + symbol: '$$', + shift: 1, + selectionInput: 1, + type: 'text', + newLine: false, + }, + equation: { + des: 'equation', + text: '$x$', + symbol: '$$$$', + shift: 2, + selectionInput: 2, + type: 'text', + newLine: false, + }, + division: { + des: 'frac', + text: 'division', + symbol: '\\frac{}{}', + shift: 6, + selectionInput: 6, + type: 'icon', + newLine: true, + }, + multiplication: { + des: 'times', + text: 'multiplication', + symbol: '\\times', + shift: 6, + selectionInput: 6, + type: 'icon', + newLine: false, + }, + sup: { + des: 'superscript', + text: 'xy', + symbol: '^{}', + shift: 2, + selectionInput: 2, + type: 'text', + newLine: false, + }, + div: { + des: 'division', + text: 'x-1', + symbol: '^{-1}', + shift: 5, + selectionInput: 5, + type: 'text', + newLine: false, + }, + sub: { + des: 'subscript', + text: 'xy', + symbol: '_{}', + shift: 2, + selectionInput: 2, + type: 'text', + newLine: false, + }, + pi: { + des: 'pi', + text: 'pi', + symbol: '\\pi', + shift: 3, + selectionInput: 3, + type: 'icon', + newLine: false, + }, + e: { + des: 'e', + text: 'ex', + symbol: 'e^{}', + shift: 3, + selectionInput: 3, + type: 'text', + newLine: true, + }, + exp: { + des: 'exp', + text: 'exp', + symbol: '\\exp()', + shift: 5, + selectionInput: 5, + type: 'text', + newLine: false, + }, + log: { + des: 'log', + text: 'log', + symbol: '\\log()', + shift: 5, + selectionInput: 5, + type: 'text', + newLine: false, + }, + sin: { + des: 'sin', + text: 'sin', + symbol: '\\sin()', + shift: 5, + selectionInput: 5, + type: 'text', + newLine: true, + }, + cos: { + des: 'cos', + text: 'cos', + symbol: '\\cos()', + shift: 5, + selectionInput: 5, + type: 'text', + newLine: false, + }, + tan: { + des: 'tan', + text: 'tan', + symbol: '\\tan()', + shift: 5, + selectionInput: 5, + type: 'text', + newLine: false, + }, + cot: { + des: 'cot', + text: 'cot', + symbol: '\\cot()', + shift: 5, + selectionInput: 5, + type: 'text', + newLine: false, + }, + sin2: { + des: 'cos^2', + text: 'sin2', + symbol: '\\sin^2()', + shift: 7, + selectionInput: 7, + type: 'text', + newLine: true, + }, + cos2: { + des: 'cos^2', + text: 'cos2', + symbol: '\\cos^2()', + shift: 7, + selectionInput: 7, + type: 'text', + newLine: false, + }, + tan2: { + des: 'tan^2', + text: 'tan2', + symbol: '\\tan^2()', + shift: 7, + selectionInput: 7, + type: 'text', + newLine: false, + }, + cot2: { + des: 'cot^2', + text: 'cot2', + symbol: '\\cot^2()', + shift: 7, + selectionInput: 7, + type: 'text', + newLine: false, + }, + roundBrackets: { + des: 'round brackets', + text: '(x)', + symbol: '\\left(\\right)', + shift: 6, + selectionInput: 6, + type: 'text', + newLine: true, + }, + squareBrackets: { + des: 'square brackets', + text: '[x]', + symbol: '\\left[\\right]', + shift: 6, + selectionInput: 6, + type: 'text', + newLine: false, + }, + curlyBrackets: { + des: 'curly brackets', + text: '{x}', + symbol: '\\left\\{\\right\\}', + shift: 7, + selectionInput: 7, + type: 'text', + newLine: false, + }, + pipeBrackets: { + des: 'pipe brackets', + text: '|x|', + symbol: '\\left|\\right|', + shift: 6, + selectionInput: 6, + type: 'text', + newLine: false, + }, + doublePipeBrackets: { + des: 'double pipe brackets', + text: '||x||', + symbol: '\\left\\|\\right\\|', + shift: 7, + selectionInput: 7, + type: 'text', + newLine: false, + }, +}; + +export function latexFormatter( + editor: CodeMirror.Editor, + item: latexFormatterSetting, +) { + if (editor) { + const isSelection = checkIfSelection(editor); + const selection = editor.getSelection(); + const curserStart = editor.getCursor('from'); + const curserEnd = editor.getCursor('to'); + const line = editor.getLine(curserStart.line); + + editor.focus(); + if (isSelection) { + let replacment = selection.trim(); + + editor.replaceSelection( + item.symbol.substring(0, item.selectionInput) + + replacment + + item.symbol.substring(item.selectionInput), + ); + editor.setCursor(curserStart.line, curserStart.ch + item.shift); + } else { + editor.replaceRange(item.symbol, curserStart); + editor.setCursor(curserStart.line, curserStart.ch + item.shift); + } + } +} diff --git a/versions.json b/versions.json index 468900a..22875b5 100644 --- a/versions.json +++ b/versions.json @@ -4,5 +4,6 @@ "0.1.2": "0.10.9", "0.2.0": "0.10.9", "0.2.1": "0.10.9", - "0.2.2": "0.10.9" + "0.2.2": "0.10.9", + "0.3.0": "0.10.9" }