• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

joeyuping/quick_latex_obsidian

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

joeyuping/quick_latex_obsidian

开源软件地址(OpenSource Url):

https://github.com/joeyuping/quick_latex_obsidian

开源编程语言(OpenSource Language):

TypeScript 98.4%

开源软件介绍(OpenSource Introduction):

Quick Latex for Obsidian

【Custom shorthands enhanced!! see below】

Description:

This simple plugin adds various shortcuts to speedup latex math typing.

Functionalities:

Note: All functionalities below can be toggled within the plugin settings page.

1. Auto close $ symbol + Move cursor between $$ symbols

  • Typing $ will automatically close with $ and shift the cursor in between the $$ symbols.
  • Tip: If you use the $ symbol often as currency symbol, you may toggle off the "auto close math symbol" function in the plugin setting.

auto Move into Math

2. Autoclose {}, [], () brackets

  • Typing "{", "[" and "(" will automatically close with "}","]" or ")".
  • Note: This function activates only when the cursor is followed by "$", space, tab, or nothing (end of line).

3. Auto append "\limits" after "\sum"

  • Typing "\sum" will automatically append "\limits" to shorten the syntax for proper display of the limits for summation symbol.

4. Auto enlarge brackets that contains \sum, \int or \frac

  • Place cursor right after a () or [] bracketed expression that contains either \sum, \int or \frac and press the space key, the outermost brackets will be appended with \left and \right in order to display larger brackets to enclose these big expressions. E.g. (\sum\limits_{i=1}^n x+1) => \left(\sum\limits_{i=1}^n x+1 \right)

auto Enlarge Bracket

5. Auto enclose expression after superscipt and subscript with {}

  • Typing expressions after superscript "^" and subscript "_" symbol follow by a "space" key will automatically surround the expressions with "{}".
  • NOTE: if you are use to typing subscript indexing without enclosing it with {}, there is high tendency that the autoEncloseSubscript function may miss fire when you press space after a subscript symbol not intended to be bracketed. In this case, its recommended to turn off this function.

auto Enclose Superscript

6. Enclose selected expression with math symbol

  • Select an expression and press "$" key will automatically enclose the expression with the math symbols.

7. Auto Fraction - Type "/" instead of \frac{}{}.

  • Type $e/2$ followed by a "space" key will automatically replace the expression with $\frac{e}{2}$.

auto Fraction

  • Tip 1: Enclose your fraction expression within round brackets () will help the system identify the boundaries of your fraction.

auto Fraction 1

  • Tip 2: Put a space infront of fraction to denote the start of the fraction. Especially useful for series of fractions!

auto Fraction 2

  • Tip 3: For longer numerator or denominator expressions (especially when the expressions have white spaces which may trigger the frac-replace prematurely), enclose the expressions in round brackets ().

auto Fraction 3

  • Tip 4: The plugin will remove the outermost brackets in numerator and denominator.

8. Shortcut for Align Block

  • use "Alt+Shift+A" (Mac: "Option+Shift+A") shortcut key to quickly insert \begin{align*} \end{align*} block

  • Tip 1: If you have already typed some expressions and want to add the \begin{align*} and \end{align*} to the front and back, you can first select the texts then press "Alt+Shift+A" (Mac: "Option+Shift+A").

  • Tip 2: Quick next line syntax within align block

    • pressing "enter" within an align block will automatically insert \\ to the end of the line, go to next line and add the "&" symbol.
    • press "shift+enter" to go to next line without adding these symbols.
  • Tip 3: Changing parameter

    • the default parameter "align*" can be changed in the plugin settings.
  • Tip 4: Edit Short Cut

    • You may edit the shortcut keys in Settings -> Hotkeys

add Align Block

9. Shortcut for Matrix Block

  • use "Alt+Shift+M" (Mac: "Option+Shift+M") shortcut key to quickly insert \begin{pmatrix} \end{pmatrix} block

  • Tip 1: quick next item and next line syntax within matrix block

    • pressing "tab" within a matrix block will automatically insert " & ".
    • pressing "enter" within a matrix block will automatically insert " \\ ".
    • press "shift+enter" to go to next line without adding these symbols.
  • Tip 2: Changing parameter

    • the default parameter "pmatrix" can be changed in the plugin settings. e.g. matrix, bmatrix, Bmatrix, vmatrix, Vmatrix
  • Tip 3: Edit Short Cut

    • You may edit the shortcut keys in Settings -> Hotkeys

add Matrix Block

【Enhanced!】10. Custom shorthand

  • Use multi-letters custom shorthand for common latex snippets. e.g. typing "al" followed by "space" key will replace with "\alpha"
  • You may set your own custom shorthand in the plugin settings page. Separate the shorthand and the snippet with ":" ; end each set of snippets with ";" and a newline. e.g. al:\alpha; bi:\binom{#cursor}{#tab};
  • Tip1: If the expression ends with curly brackets "{}", cursor will automatically be placed within the brackets.
  • Tip2: Use "#cursor" within snippet to set the cursor position after replacement
  • Tip3: Use "#tab" within snippet for cases of multiple parameters. e.g. bi:\binom{#cursor}{#tab}, after keying bi and spacebar, the shorthand will expand into \binom{|}{#tab} with cursor in the first brackets. After keying the values in first brackets, press tab to jump to the #tab location to continue typing.
  • Note: The system will ignore a shorthand if it is preceeded by an alphabet. eg. "ta" is the shorthand for "\tau. Typing "delta" followed by space will NOT trigger the replacement.
  • Below is the list of default shorthand:
Shorthand String Shorthand String Shorthand String
sq \sqrt{} bb \mathbb{} bf \mathbf{}
te \text{} inf \infty bi \binom{#cursor}{#tab}
cd \cdot qu \quad ti \times
al \alpha be \beta ga \gamma
Ga \Gamma de \delta De \Delta
ep \epsilon ze \zeta et \eta
th \theta Th \Theta io \iota
ka \kappa la \lambda La \Lambda
mu \mu nu \nu xi \xi
Xi \Xi pi \pi Pi \Pi
rh \rho si \sigma Si \Sigma
ta \tau up \upsilon Up \Upsilon
ph \phi Ph \Phi ch \chi
ps \psi Ps \Psi om \omega
Om \Omega

Note:

  • The repo depends on the latest Obsidian API (obsidian.d.ts) in Typescript Definition format, which is still in early alpha so might break anytime!
  • This is my first Obsidian Plugin project, bugs might be present. Please use with caution.
  • Compatible with builtin vim-mode.

source code:

see https://github.com/joeyuping/quick_latex_obsidian




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
appsinthesky/Kotlin-Bluetooth发布时间:2022-07-07
下一篇:
mneri/pnglatex: Create PNG Images from LaTeX Formulas发布时间:2022-07-09
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap