Menu

#1395 autocomplete for \text{ substitutes \textbf{text}

None
works-for-me
nobody
1
2020-01-08
2015-07-29
Anonymous
No

When using the "\text" command with amsmath, texstudio autocompletes "\text{" with "\textbf{text}".

Related

Bugs: #1395

Discussion

  • Jan  Sundermeyer

    Jan Sundermeyer - 2015-07-30

    works fine here.
    do you use "most used" completer tab ?
    Maybe you should deactivate "complete common prefix" ...

     
  • kozimodo

    kozimodo - 2015-07-30

    I can't seem to find where that is. Is it one of the "completion files"?

     
  • Jan  Sundermeyer

    Jan Sundermeyer - 2015-07-30

    the completer has three tabs: typical/most used/all
    If you don't know what I am talking about, you probably have not changed it in the configuration

    "complete common prefix" is an option under options/completion/complete common prefix

    Do have a line "\usepackage{amsmath}" in your latex source file ?

     
  • kozimodo

    kozimodo - 2015-07-30

    I'm still having "\textbf{" substituted when I type "\text{". I have "\usepackage{amsmath}" in a personal style file which is invoked in my main source file. But I do see that if I directly invoke "\usepackage{amsmath}", "\text{" works correctly even without unchecking "complete common prefix".

     
  • Jan  Sundermeyer

    Jan Sundermeyer - 2015-07-30

    personal style files, meaning local stored style files, are not processed by txs.
    Use "\input{my_style.tex}"

     
  • kozimodo

    kozimodo - 2015-07-30

    I used "\input{mystyle.sty}" but that still did not work. mystyle.sty is in "~/texmf/tex/latex/personal/".

     

    Last edit: kozimodo 2015-07-30
  • Jan  Sundermeyer

    Jan Sundermeyer - 2015-07-31

    you need to put it in your work directory (or wherever your tex source file is)
    Alternatively ayou could generate a cwl-file of your own, see manual.

     
  • kozimodo

    kozimodo - 2015-07-31

    But wouldn't that defeat the purpose of having a style file that is used in all of your documents?

     
  • Jan  Sundermeyer

    Jan Sundermeyer - 2015-07-31

    well, it is personal taste how to encapsulate the general settings of a document.
    txs (and many tutorials follow that concept) assumes a master document with preamble, which contains then the text or the includes.
    To ease reuse, templates can easily be used.

    Apart from that, txs directly reads all included files (if the apropriate options are enabled), thus it understands \usepackage in subfiles.
    If a usepackage is used, it assumes a system package which is scanned. The package is found via the kpsewhich command.
    Local style files are usually not scanned as they might change.

    So the recommendation of best practice with txs is:
    1) use templates
    2) put all used packages into your preamble
    3) if necessary include subfiles to separate chapters etc.

    as mentioned ealier, there are ways to circumvent txs behavior. In your case, you could generate a cwl-file for your personal style-file (see manual).

     
  • kozimodo

    kozimodo - 2015-07-31

    Perhaps having an option to scan local style files would make sense as an enhancement. I see how using a template can do everything I want but I find it aesthetically displeasing -- the whole reason I have a personal style file is so that I can keep my preamble as uncluttered as possible. Should I file a request for an enhancement?

     
  • Jan  Sundermeyer

    Jan Sundermeyer - 2015-07-31

    you could create a feaure request but i doubt that it will be implemented soon.
    By the way, you might already have the result of the scan on your computer (in ~/.config/texstudio)
    Please check ...
    In your case, if the cwl-file is not already present (but probably incomplete), generate it manually.
    It is not complicated nor very laborious.

     
  • kozimodo

    kozimodo - 2015-07-31

    Yes, it was quite straightforward to add the text command to mystyle.cwl and enable it. Thank you!

     
  • Jan  Sundermeyer

    Jan Sundermeyer - 2015-07-31

    you could also make use of #include:... since amsmath.cwl (and many others) is already provided by txs

     
  • kozimodo

    kozimodo - 2015-07-31

    Beautiful! Many thanks!

     
  • Jan  Sundermeyer

    Jan Sundermeyer - 2015-08-01
    • status: open --> works-for-me
    • Group: -->
     
  • kozimodo

    kozimodo - 2020-01-08

    Has there been some reversion in 2.12.18? Even though I have amsmath.cwl enabled in completion, \text{ now autocompletes as \textbf{} again. Nothing in my configuration has changed.

     
    • Jan  Sundermeyer

      Jan Sundermeyer - 2020-01-08

      Works for me.

      Which mode are you using for completion (typical, favourite,fuzzy,all ) ?

      Am 08.01.20 um 20:54 schrieb kozimodo:

      Has there been some reversion in 2.12.18? Even though I have
      amsmath.cwl enabled in completion, \text{ now autocompletes as
      \textbf{} again. Nothing in my configuration has changed.


      [bugs:#1395] https://sourceforge.net/p/texstudio/bugs/1395/
      autocomplete for \text{ substitutes \textbf{text}

      Status: works-for-me
      Group:
      Labels: autocomplete \text
      Created: Wed Jul 29, 2015 02:28 PM UTC by Anonymous
      Last Updated: Sat Aug 01, 2015 09:45 PM UTC
      Owner: nobody

      When using the "\text" command with amsmath, texstudio autocompletes
      "\text{" with "\textbf{text}".


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/texstudio/bugs/1395/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #1395

  • kozimodo

    kozimodo - 2020-01-08

    I'm using typical.

     
    • Jan  Sundermeyer

      Jan Sundermeyer - 2020-01-09

      please continue on github with reporting the error.
      A screencast of the problem may be helpful.

      Am 08.01.2020 um 21:56 schrieb kozimodo kozimodo@users.sourceforge.net:

      
      I'm using typical.

      [bugs:#1395] autocomplete for \text{ substitutes \textbf{text}

      Status: works-for-me
      Group:
      Labels: autocomplete \text
      Created: Wed Jul 29, 2015 02:28 PM UTC by Anonymous
      Last Updated: Wed Jan 08, 2020 07:54 PM UTC
      Owner: nobody

      When using the "\text" command with amsmath, texstudio autocompletes "\text{" with "\textbf{text}".

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/texstudio/bugs/1395/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #1395


Log in to post a comment.