diff --git a/src/nl/hannahsten/texifyidea/lang/LatexPackage.kt b/src/nl/hannahsten/texifyidea/lang/LatexPackage.kt index 9847c4bfa..84e559102 100644 --- a/src/nl/hannahsten/texifyidea/lang/LatexPackage.kt +++ b/src/nl/hannahsten/texifyidea/lang/LatexPackage.kt @@ -43,6 +43,7 @@ open class LatexPackage @JvmOverloads constructor( val COLOR = LatexPackage("color") val COMMENT = LatexPackage("comment") val CSQUOTES = LatexPackage("csquotes") + val DIFFCOEFF = LatexPackage("diffcoeff") val ETOOLBOX = LatexPackage("etoolbox") val EUROSYM = LatexPackage("eurosym") val FLOAT = LatexPackage("float") @@ -87,6 +88,7 @@ open class LatexPackage @JvmOverloads constructor( val TEXTCOMP = LatexPackage("textcomp") val TIKZ = LatexPackage("tikz") val ULEM = LatexPackage("ulem") + val UPGREEK = LatexPackage("upgreek") val VARIOREF = LatexPackage("varioref") val WASYSYM = LatexPackage("wasysym") val WIDETABLE = LatexPackage("widetable") diff --git a/src/nl/hannahsten/texifyidea/lang/commands/LatexDiffcoeffCommand.kt b/src/nl/hannahsten/texifyidea/lang/commands/LatexDiffcoeffCommand.kt new file mode 100644 index 000000000..fbfa086ee --- /dev/null +++ b/src/nl/hannahsten/texifyidea/lang/commands/LatexDiffcoeffCommand.kt @@ -0,0 +1,36 @@ +package nl.hannahsten.texifyidea.lang.commands + +import nl.hannahsten.texifyidea.lang.LatexPackage + +/** + * @author Florian Kraft + */ +enum class LatexDiffcoeffCommand( + override val command: String, + override vararg val arguments: Argument = emptyArray(), + override val dependency: LatexPackage = LatexPackage.DIFFCOEFF, + override val display: String? = null, + override val isMathMode: Boolean = true, +) : LatexCommand { + + DIFF("diff", "order-spec".asOptional(), "differentiand".asRequired(), "variable(s)".asRequired(), "pt of eval".asOptional()), + DIFF_STAR("diff*", "order-spec".asOptional(), "differentiand".asRequired(), "variable(s)".asRequired(), "pt of eval".asOptional()), + DIFF_STAR_STAR("diff**", "order-spec".asOptional(), "variable(s)".asRequired(), "differentiand".asRequired(), "pt of eval".asOptional()), + DIFFP("diffp", "order-spec".asOptional(), "differentiand".asRequired(), "variable(s)".asRequired(), "pt of eval".asOptional()), + DIFFP_STAR("diffp*", "order-spec".asOptional(), "differentiand".asRequired(), "variable(s)".asRequired(), "pt of eval".asOptional()), + DIFFP_STAR_STAR("diffp**", "order-spec".asOptional(), "variable(s)".asRequired(), "differentiand".asRequired(), "pt of eval".asOptional()), + DIFS("difs", "order-spec".asOptional(), "differentiand".asRequired(), "variable(s)".asRequired(), "pt of eval".asOptional()), + DIFS_STAR("difs*", "order-spec".asOptional(), "differentiand".asRequired(), "variable(s)".asRequired(), "pt of eval".asOptional()), + DIFS_STAR_STAR("difs**", "order-spec".asOptional(), "variable(s)".asRequired(), "differentiand".asRequired(), "pt of eval".asOptional()), + DIFSP("difsp", "order-spec".asOptional(), "differentiand".asRequired(), "variable(s)".asRequired(), "pt of eval".asOptional()), + DIFSP_STAR("difsp*", "order-spec".asOptional(), "differentiand".asRequired(), "variable(s)".asRequired(), "pt of eval".asOptional()), + DIFSP_STAR_STAR("difsp**", "order-spec".asOptional(), "variable(s)".asRequired(), "differentiand".asRequired(), "pt of eval".asOptional()), + DIFC("difc", "order-spec".asOptional(), "differentiand".asRequired(), "variable(s)".asRequired(), "pt of eval".asOptional()), + DIFC_STAR_STAR("difc**", "order-spec".asOptional(), "variable(s)".asRequired(), "differentiand".asRequired(), "pt of eval".asOptional()), + DIFCP("difcp", "order-spec".asOptional(), "differentiand".asRequired(), "variable(s)".asRequired(), "pt of eval".asOptional()), + DIFCP_STAR_STAR("difcp**", "order-spec".asOptional(), "variable(s)".asRequired(), "differentiand".asRequired(), "pt of eval".asOptional()), + ; + + override val identifier: String + get() = name +} diff --git a/src/nl/hannahsten/texifyidea/lang/commands/LatexGreekCommand.kt b/src/nl/hannahsten/texifyidea/lang/commands/LatexGreekCommand.kt index 7070c8d3d..6131a4f94 100644 --- a/src/nl/hannahsten/texifyidea/lang/commands/LatexGreekCommand.kt +++ b/src/nl/hannahsten/texifyidea/lang/commands/LatexGreekCommand.kt @@ -15,57 +15,57 @@ enum class LatexGreekCommand( val collapse: Boolean = false ) : LatexCommand { - ALPHA("alpha", display = "α", collapse = true), - BETA("beta", display = "β", collapse = true), - GAMMA("gamma", display = "γ", collapse = true), - CAPITAL_GAMMA("Gamma", display = "Γ", collapse = true), - CAPITAL_GAMMA_VARIANT("varGamma", dependency = AMSMATH, collapse = true), - DELTA("delta", display = "δ", collapse = true), - CAPITAL_DELTA("Delta", display = "Δ", collapse = true), - CAPITAL_DELTA_VARIANT("varDelta", dependency = AMSMATH, collapse = true), - EPSILON("epsilon", display = "ϵ", collapse = true), - BETTER_LOOKING_EPSILON("varepsilon", display = "ε", collapse = true), - ZETA("zeta", display = "ζ", collapse = true), - ETA("eta", display = "η", collapse = true), - THETA("theta", display = "θ", collapse = true), - THETA_VARIANT("vartheta", display = "ϑ", collapse = true), - CAPITAL_THETA("Theta", display = "Θ", collapse = true), - CAPITAL_THETA_VARIANT("varTheta", dependency = AMSMATH, collapse = true), - IOTA("iota", display = "ι", collapse = true), - KAPPA("kappa", display = "κ", collapse = true), - LAMBDA("lambda", display = "λ", collapse = true), - CAPITAL_LAMBDA("Lambda", display = "Λ", collapse = true), - CAPITAL_LAMBDA_VARIANT("varLambda", dependency = AMSMATH, collapse = true), - MU("mu", display = "μ", collapse = true), - NU("nu", display = "ν", collapse = true), - XI("xi", display = "ξ", collapse = true), - CAPITAL_XI("Xi", display = "Ξ", collapse = true), - CAPITAL_XI_VARIANT("varXi", dependency = AMSMATH, collapse = true), - PI("pi", display = "π", collapse = true), - PI_VARIANT("varpi", display = "ϖ", collapse = true), - CAPITAL_PI("Pi", display = "Π", collapse = true), - CAPITAL_PI_VARIANT("varPi", dependency = AMSMATH, collapse = true), - RHO("rho", display = "ρ", collapse = true), - RHO_VARIANT("varrho", display = "ϱ", collapse = true), - SIGMA("sigma", display = "σ", collapse = true), - FINAL_SIGMA("varsigma", display = "ς", collapse = true), - CAPITAL_SIGMA("Sigma", display = "Σ", collapse = true), - CAPITAL_SIGMA_VARIANT("varSigma", dependency = AMSMATH, collapse = true), - TAU("tau", display = "τ", collapse = true), - UPSILON("upsilon", display = "υ", collapse = true), - CAPITAL_UPSILON("Upsilon", display = "ϒ", collapse = true), - CAPITAL_UPSILON_VARIANT("Upsilon", dependency = AMSMATH, collapse = true), - PHI_STRAIGHT("phi", display = "ϕ", collapse = true), - PHI_CURLY("varphi", display = "φ", collapse = true), - CAPITAL_PHI("Phi", display = "Φ", collapse = true), - CAPITAL_PHI_VARIANT("varPhi", dependency = AMSMATH, collapse = true), - CHI("chi", display = "χ", collapse = true), - PSI("psi", display = "ψ", collapse = true), - CAPITAL_PSI("Psi", display = "Ψ", collapse = true), - CAPITAL_PSI_VARIANT("varPsi", dependency = AMSMATH, collapse = true), - OMEGA("omega", display = "ω", collapse = true), - CAPITAL_OMEGA("Omega", display = "Ω", collapse = true), - CAPITAL_OMEGA_VARIANT("varOmega", dependency = AMSMATH, collapse = true), + ALPHA("alpha", display = "α"), + BETA("beta", display = "β"), + GAMMA("gamma", display = "γ"), + CAPITAL_GAMMA("Gamma", display = "Γ"), + CAPITAL_GAMMA_VARIANT("varGamma", dependency = AMSMATH), + DELTA("delta", display = "δ"), + CAPITAL_DELTA("Delta", display = "Δ"), + CAPITAL_DELTA_VARIANT("varDelta", dependency = AMSMATH), + EPSILON("epsilon", display = "ϵ"), + BETTER_LOOKING_EPSILON("varepsilon", display = "ε"), + ZETA("zeta", display = "ζ"), + ETA("eta", display = "η"), + THETA("theta", display = "θ"), + THETA_VARIANT("vartheta", display = "ϑ"), + CAPITAL_THETA("Theta", display = "Θ"), + CAPITAL_THETA_VARIANT("varTheta", dependency = AMSMATH), + IOTA("iota", display = "ι"), + KAPPA("kappa", display = "κ"), + LAMBDA("lambda", display = "λ"), + CAPITAL_LAMBDA("Lambda", display = "Λ"), + CAPITAL_LAMBDA_VARIANT("varLambda", dependency = AMSMATH), + MU("mu", display = "μ"), + NU("nu", display = "ν"), + XI("xi", display = "ξ"), + CAPITAL_XI("Xi", display = "Ξ"), + CAPITAL_XI_VARIANT("varXi", dependency = AMSMATH), + PI("pi", display = "π"), + PI_VARIANT("varpi", display = "ϖ"), + CAPITAL_PI("Pi", display = "Π"), + CAPITAL_PI_VARIANT("varPi", dependency = AMSMATH), + RHO("rho", display = "ρ"), + RHO_VARIANT("varrho", display = "ϱ"), + SIGMA("sigma", display = "σ"), + FINAL_SIGMA("varsigma", display = "ς"), + CAPITAL_SIGMA("Sigma", display = "Σ"), + CAPITAL_SIGMA_VARIANT("varSigma", dependency = AMSMATH), + TAU("tau", display = "τ"), + UPSILON("upsilon", display = "υ"), + CAPITAL_UPSILON("Upsilon", display = "ϒ"), + CAPITAL_UPSILON_VARIANT("Upsilon", dependency = AMSMATH), + PHI_STRAIGHT("phi", display = "ϕ"), + PHI_CURLY("varphi", display = "φ"), + CAPITAL_PHI("Phi", display = "Φ"), + CAPITAL_PHI_VARIANT("varPhi", dependency = AMSMATH), + CHI("chi", display = "χ"), + PSI("psi", display = "ψ"), + CAPITAL_PSI("Psi", display = "Ψ"), + CAPITAL_PSI_VARIANT("varPsi", dependency = AMSMATH), + OMEGA("omega", display = "ω"), + CAPITAL_OMEGA("Omega", display = "Ω"), + CAPITAL_OMEGA_VARIANT("varOmega", dependency = AMSMATH), ; override val identifier: String diff --git a/src/nl/hannahsten/texifyidea/lang/commands/LatexMathCommand.kt b/src/nl/hannahsten/texifyidea/lang/commands/LatexMathCommand.kt index 44a2fffe2..2f43a02a9 100644 --- a/src/nl/hannahsten/texifyidea/lang/commands/LatexMathCommand.kt +++ b/src/nl/hannahsten/texifyidea/lang/commands/LatexMathCommand.kt @@ -5,7 +5,7 @@ import arrow.core.getOrNone import arrow.core.nonEmptySetOf /** - * @author Hannah Schellekens, Sten Wessel + * @author Hannah Schellekens, Sten Wessel, Florian Kraft */ object LatexMathCommand { @@ -16,9 +16,11 @@ object LatexMathCommand { private val ARROWS: Set = LatexArrowCommand.entries.toSet() private val GENERIC_COMMANDS: Set = LatexGenericMathCommand.entries.toSet() private val UNCATEGORIZED_STMARYRD_SYMBOLS: Set = LatexUncategorizedStmaryrdSymbols.entries.toSet() + private val DIFFCOEFF: Set = LatexDiffcoeffCommand.entries.toSet() + private val UPGREEK: Set = LatexUpgreekCommand.entries.toSet() private val ALL: Set = GREEK_ALPHABET + OPERATORS + MATHTOOLS_COLONEQ + DELIMITERS + ARROWS + - GENERIC_COMMANDS + UNCATEGORIZED_STMARYRD_SYMBOLS + GENERIC_COMMANDS + UNCATEGORIZED_STMARYRD_SYMBOLS + DIFFCOEFF + UPGREEK private val lookup = HashMap>() private val lookupDisplay = HashMap>() diff --git a/src/nl/hannahsten/texifyidea/lang/commands/LatexUpgreekCommand.kt b/src/nl/hannahsten/texifyidea/lang/commands/LatexUpgreekCommand.kt new file mode 100644 index 000000000..67069d907 --- /dev/null +++ b/src/nl/hannahsten/texifyidea/lang/commands/LatexUpgreekCommand.kt @@ -0,0 +1,62 @@ +package nl.hannahsten.texifyidea.lang.commands + +import nl.hannahsten.texifyidea.lang.LatexPackage +import nl.hannahsten.texifyidea.lang.LatexPackage.Companion.UPGREEK + +/** + * @author Florian Kraft + */ +enum class LatexUpgreekCommand( + override val command: String, + override vararg val arguments: Argument = emptyArray(), + override val dependency: LatexPackage = LatexPackage.DEFAULT, + override val display: String? = null, + override val isMathMode: Boolean = true, + val collapse: Boolean = false +) : LatexCommand { + + UPALPHA("upalpha", display = "α", dependency = UPGREEK), + UPBETA("upbeta", display = "β", dependency = UPGREEK), + UPGAMMA("upgamma", display = "γ", dependency = UPGREEK), + UPGAMMA_CAPITAL("Upgamma", display = "Γ", dependency = UPGREEK), + UPDELTA("updelta", display = "δ", dependency = UPGREEK), + UPDELTA_CAPITAL("Updelta", display = "Δ", dependency = UPGREEK), + UPEPSILON("upepsilon", display = "ϵ", dependency = UPGREEK), + UPEPSILON_VARIANT("upvarepsilon", display = "ε", dependency = UPGREEK), + UPZETA("upzeta", display = "ζ", dependency = UPGREEK), + UPETA("upeta", display = "η", dependency = UPGREEK), + UPTHETA("uptheta", display = "θ", dependency = UPGREEK), + UPTHETA_VARIANT("upvartheta", display = "ϑ", dependency = UPGREEK), + UPTHETA_CAPITAL("Uptheta", display = "Θ", dependency = UPGREEK), + UPIOTA("upiota", display = "ι", dependency = UPGREEK), + UPKAPPA("upkappa", display = "κ", dependency = UPGREEK), + UPLAMBDA("uplambda", display = "λ", dependency = UPGREEK), + UPLAMBDA_CAPITAL("Uplambda", display = "Λ", dependency = UPGREEK), + UPMU("upmu", display = "μ", dependency = UPGREEK), + UPNU("upnu", display = "ν", dependency = UPGREEK), + UPXI("upxi", display = "ξ", dependency = UPGREEK), + UPXI_CAPITAL("Upxi", display = "Ξ", dependency = UPGREEK), + UPPI("uppi", display = "π", dependency = UPGREEK), + UPPI_VARIANT("upvarpi", display = "ϖ", dependency = UPGREEK), + UPPI_CAPITAL("Uppi", display = "Π", dependency = UPGREEK), + UPRHO("uprho", display = "ρ", dependency = UPGREEK), + UPRHO_VARIANT("upvarrho", display = "ρ", dependency = UPGREEK), + UPSIGMA("upsigma", display = "σ", dependency = UPGREEK), + UPSIGMA_VARIANT("upvarsigma", display = "σ", dependency = UPGREEK), + UPSIGMA_CAPITAL("Upsigma", display = "Σ", dependency = UPGREEK), + UPTAU("uptau", display = "τ", dependency = UPGREEK), + UPUPSILON("upupsilon", display = "υ", dependency = UPGREEK), + UPUPSILON_CAPITAL("Upupsilon", display = "ϒ", dependency = UPGREEK), + UPPHI("upphi", display = "ϕ", dependency = UPGREEK), + UPPHI_VARIANT("upvarphi", display = "φ", dependency = UPGREEK), + UPPHI_CAPITAL("Upphi", display = "Φ", dependency = UPGREEK), + UPCHI("upchi", display = "χ", dependency = UPGREEK), + UPPSI("uppsi", display = "ψ", dependency = UPGREEK), + UPPSI_CAPITAL("Uppsi", display = "Ψ", dependency = UPGREEK), + UPOMEGA("upomega", display = "ω", dependency = UPGREEK), + UPOMEGA_CAPITAL("Upomega", display = "Ω", dependency = UPGREEK), + ; + + override val identifier: String + get() = name +} \ No newline at end of file