texstudio-org / texstudio

TeXstudio is a fully featured LaTeX editor. Our goal is to make writing LaTeX documents as easy and comfortable as possible.
http://www.texstudio.org/
GNU General Public License v3.0
2.76k stars 343 forks source link

info/tooltips for math menu items #2810

Closed octaeder closed 1 year ago

octaeder commented 1 year ago
  1. I want to ask which or even all of the following main/math menu items should be enhanced with tooltips/info?
  2. Do you want info for functions (sin, cosin, inf, sup, ...)?
  3. Would it be nice to move item "annotations" like "(amsmath)" to the info and remove it from the item?
  4. I'm missing \bigl, \bigr, ... from amsmath. Your opinion/suggestion about where to place? Is related to \left and \right.

I know that this will introduce many text to be translated and added to additionaltranslations.cpp.

The following is a cut down from uiconfig. I removed items already having an info. Tag "insert id" removed for better readability.

<menu id="main/math" text="&amp;Math">
  <text="Subscript - _{}" insert="_{%|}" icon="subscript" shortcut="Ctrl+Shift+D"/>  
  <text="Superscript - ^{}" insert="^{%|}"  icon="superscript" shortcut="Ctrl+Shift+U"/>  
  <text="\frac{}{}" insert="\frac{%&lt;num%|%:translatable%>}{%&lt;den%:translatable%>}" icon="smallfrac" shortcut="Alt+Shift+F"/>    
  <text="\dfrac{}{}" insert="\dfrac{%&lt;num%|%:translatable%>}{%&lt;den%:translatable%>}" icon="dfrac" shortcut="Ctrl+Shift+F"/>  
  <text="\sqrt{}" insert="\sqrt{%|}" icon="sqrt" shortcut="Ctrl+Shift+Q"/>  
  <text="\left" insert="\left " shortcut="Ctrl+Shift+L"/>  
  <text="\right" insert="\right " shortcut="Ctrl+Shift+R"/>  

  <menu id="equations" text="Math &amp;Equations">
      <text="env equation* (amsmath)" insert="\begin{equation*}%\%|%\\end{equation*}"/>
      <text="env align (amsmath)" insert="\begin{align}%\%|%\\end{align}"/>
      <text="env alignat (amsmath)" insert="\begin{alignat}{%&lt;ncols%>}%\%&lt;content%>%\\end{alignat}"/>
      <text="env flalign (amsmath)" insert="\begin{flalign}%\%|%\\end{flalign}"/>
      <text="env gather (amsmath)" insert="\begin{gather}%\%|%\\end{gather}"/>
      <text="env multline (amsmath)" insert="\begin{multline}%\%|%\\end{multline}"/>
      <text="env align* (amsmath)" insert="\begin{align*}%\%|%\\end{align*}"/>
      <text="env alignat* (amsmath)" insert="\begin{alignat*}{%&lt;ncols%>}%\%&lt;content%>%\\end{alignat*}"/>
      <text="env flalign* (amsmath)" insert="\begin{flalign*}%\%|%\\end{flalign*}"/>
      <text="env gather* (amsmath)" insert="\begin{gather*}%\%|%\\end{gather*}"/>
      <text="env multline* (amsmath)" insert="\begin{multline*}%\%|%\\end{multline*}"/>
      <text="env cases (amsmath)" insert="\begin{cases}%\%|%\\end{cases}"/>
      <text="env split (amsmath)" insert="\begin{split}%\%|%\\end{split}"/>
  </menu>   

  <menu id="definitions" text="Math &amp;Definitions">
     <text="env Corollary (ntheorem)" insert="\begin{Corollary}\label{%&lt;key%>}%\%|%\\end{Corollary}"/>
     <text="env Definition (ntheorem)" insert="\begin{Definition}\label{%&lt;key%>}%\%|%\\end{Definition}"/>
     <text="env Example (ntheorem)" insert="\begin{Example}\label{%&lt;key%>}%\%|%\\end{Example}"/>
     <text="env Lemma (ntheorem)" insert="\begin{Lemma}\label{%&lt;key%>}%\%|%\\end{Lemma}"/>
     <text="env Proof (ntheorem)" insert="\begin{Proof}%\%|%\\end{Proof}"/>
     <text="env Proposition (ntheorem)" insert="\begin{Proposition}\label{%&lt;key%>}%\%|%\\end{Proposition}"/>
     <text="env Remark (ntheorem)" insert="\begin{Remark}\label{%&lt;key%>}%\%|%\\end{Remark}"/>
     <text="env Theorem (ntheorem)" insert="\begin{Theorem}\label{%&lt;key%>}%\%|%\\end{Theorem}"/>
  </menu>

  <menu id="fontstyles" text="Math Font St&amp;yles">
    <itext="Roman - \mathrm{}" insert="\mathrm{%|}" icon="font_mathrm"/>
    <itext="Italic - \mathit{}" insert="\mathit{%|}" icon="font_mathit"/>
    <itext="Bold - \mathbf{}" insert="\mathbf{%|}" icon="font_mathbf"/>
    <itext="Sans Serif - \mathsf{}" insert="\mathsf{%|}" icon="font_mathsf"/>
    <itext="Typewriter - \mathtt{}" insert="\mathtt{%|}" icon="font_mathtt"/>
    <itext="Calligraphic - \mathcal{}" insert="\mathcal{%|}" icon="font_mathcal"/>
    <itext="Blackboard Bold - \mathbb{} (amssymb)" insert="\mathbb{%|}" icon="font_mathbb"/>
    <itext="Fraktur - \mathfrak{} (amssymb)" insert="\mathfrak{%|}" icon="font_mathfrak"/>
  </menu>

  <menu id="grouping" text="Math &amp;Stacking Symbols">
     <text="\overline" insert="\overline{%&lt;content%>}"/>
     <text="\underline" insert="\underline{%&lt;content%>}"/> 
     <text="\overbrace" insert="\overbrace{%&lt;content%>}"/> 
     <text="\underbrace" insert="\underbrace{%&lt;content%>}"/> 
     <text="\overleftarrow" insert="\overleftarrow{%&lt;content%>}"/>
     <text="\overrightarrow" insert="\overrightarrow{%&lt;content%>}"/>
     <text="\stackrel" insert="\stackrel{%&lt;top symbol%>}{%&lt;bottom symbol%>}"/>
     <text="\overset (amsmath)" insert="\overset{%&lt;top symbol%>}{%&lt;symbol%>}"/>
     <text="\underset (amsmath)" insert="\underset{%&lt;bottom symbol%>}{%&lt;symbol%>}"/>
     <text="\sideset (amsmath)" insert="\sideset{%&lt;left ind+exp%>}{%&lt;right ind+exp%>}"/>
     <text="\prescript (mathtools)" insert="\prescript{%&lt;left exp%>}{%&lt;left ind%>}{%&lt;arg%>}"/>
  </menu>

  <menu id="fontaccent" text="Math &amp;Accents">
    <text="\acute{}" insert="\acute{%|}" icon="acute"/>
    <text="\grave{}" insert="\grave{%|}" icon="grave"/>
    <text="\tilde{}" insert="\tilde{%|}" icon="tilde"/>
    <text="\bar{}" insert="\bar{%|}" icon="bar"/>
    <text="\vec{}" insert="\vec{%|}" icon="vec"/>
    <text="\hat{}" insert="\hat{%|}" icon="hat"/>
    <text="\check{}" insert="\check{%|}" icon="check"/>
    <text="\breve{}" insert="\breve{%|}" icon="breve"/>
    <text="\dot{}" insert="\dot{%|}" icon="dot"/>
    <text="\ddot{}" insert="\ddot{%|}" icon="ddot"/>
  </menu>

</menu>
sunderme commented 1 year ago

Summary to avoid confusion: Use infos sparsely as it is not presented clearly, so work on it is mostly waste of time. More menus can be added but it should be something not already covered on other places and it should not be too fringe functionality.

Longer answer. 1./2. tooltips should help to clarify the use of a command. There is is no sense in adding info for \sin for example. This is especially true as there is no actual tooltip in the menu but rather some text in the status bar.

  1. no, as the info is not shown as prominent as the the menu text
  2. if you want to add a submenu ...
octaeder commented 1 year ago

Standardized text form in last three items ok? Compare to first two:

grafik

p.s. \dfrac in fact is AMSmath.

sunderme commented 1 year ago

There is only minuscule benefit in spelling out Fraction and Square Root. In your shoes, I would look for more relevant topics.

octaeder commented 1 year ago

I'll add following info attributes (besides small changes in text, s. above):

dfrac \dfrac is an amsmath package shorthand for \displaystyle\frac...

equation (not new, small changes) The equation environment centers one equation on the page and places the equation number in the margin.

align The align environment vertically aligns multiple equations. You can do so in several equation columns. Use & sign for alignment and splitting into columns.

alignat The alignat environment is a variation of the align environment and allows to explicitly specify the space between equation columns. For ex. use &\quad& as column separator. Give the number of columns as a parameter.

flalign The flalign environment is an align environment that stretches space between equation columns as much as possible, leaving just enough space at the margin for the equation number.

gather The gather environment is used for multiple centered equations separated by \, each having an equation number.

multline The multline environment is a variation of the equation environment used for equations that don't fit on one line. Use \ to split lines. Lines between the first and the last one will be centered.

equation* The equation* environment is an unnumbered equation environment.

align* The align* environment is an unnumbered align environment.

alignat* The alignat* environment is an unnumbered alignat environment.

flalign* The flalign* environment is an unnumbered flalign environment.

gather* The gather* environment is an unnumbered gather environment.

multline* The multline* environment is an unnumbered multline environment.

cases The cases environment provides a strucure that displays as a brace left to an array of lines with two left-aligned columns.

split The split environment is similar to the multline environment but allows vertical alignment using & signs. There is no eqn number. Use inside displayed environments.

sunderme commented 1 year ago

sounds okay