Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spell Check Do-File Editor

    Is there a way to do a spell check in the do-file editor. I create my tables and figures in the do-file. So I would like to check the spelling of headings, labels, and notes of the figures and tables. I understand that it is not feasible to have a spelling check for the whole do-file, but it would be helpful to be able to select certain parts of the do-file to be spelled checked.

  • #2
    For more advanced code editing, you may try a text editor such as Visual Studio Code (free, from Microsoft). VSC has addon packages for integration with various languages, including Stata. It probably has packages for spell checking as well. (Stata's own code editor is quite limited, I'm not sure why.)

    Check out videos introducing VSC or some other code/text editor with Stata integration.

    Comment


    • #3
      This isn't possible in the do file editor. I personally find spellchecking a distraction in any code because inevitably there bits of code, or commands, that get flagged and it's a visual distraction for me. Easy work around are to inspect either your do file or export file (e.g. Word file) in a program like Word to look for spelling or grammatical errors, typically at the end of your coding before finalizing your work.

      Comment


      • #4
        I used some external editors for short, while in graduate school, was long time ago but I think I tried VIM and Winedt with Stata dictionaries. My conclusion was that it is not worthy and the native do editor is doing just fine.

        About spell checking I feel like Leonardo, and my workflow is pretty much what he describes: Whatever I export from Stata to MS Word or Latex, I see in Word or Latex whether there are typos the first time I export it, so I go back to my do file and I fix it there. As Leonardo points out, the majority of your do file are commands and invented names of objects, so if you start spell checking there you will get a lot of stuff flagged.

        Comment


        • #5
          On a general basis: I would recommend against putting too much emphasis on our personal opinionated views, based on our personal experience and the tendency to generalise from limited knowledge.

          For what modern code editors do, check out videos or solid reviews.

          Comment


          • #6
            any code because inevitably there bits of code, or commands, that get flagged and it's a visual distraction
            Just to mention it. This statement is not correct. Modern code editors distinguish between text and code.

            Comment


            • #7
              StataCorp developers have commented on this at users' meetings. For a while, the main assumption was that serious Stata programmers would already have their own strong preferences about a text editor -- the more developed of which are highly elaborate and bear the benefits of not just years but decades of development.

              After experiment with various different editors, freeware, shareware and paid, I settled on VIm many years ago and use it daily with and outwith Stata. It's not for everyone and there is a fairly steep learning curve: the more effort you put in, the more you benefit.

              That said, each release sees enhancements Stata's inbuilt do-file editor -- but it doesn't purport to be a generalised word processor.

              Comment


              • #8
                Sounds like I have to make another editor work. Christopher Bratt I tired VSC but couldn't make it integrate with stata so that I can run commands from it. Maybe I should give it another try.

                Still I think for the price of stata, the do-file editor should have a built-in spell check. I think there beginners without previous knowledge of other editors that would like a spell checker. It is just much more convenient to not have to go to LaTeX and check your spelling. Besides if it is a figure, you would have to copy paste titles, labels etc. somewhere to check the spelling which is inconvenient.
                Last edited by Trevor Andrew; 28 Aug 2021, 22:59.

                Comment


                • #9
                  I do most of my coding in RStudio, so my knowledge of VS Code is limited. But I find it far easier to use than Stata's do-editor. Here are some links to start with:

                  https://www.smashingmagazine.com/201...l-studio-code/

                  https://code.visualstudio.com/docs/e...on-marketplace

                  https://marketplace.visualstudio.com...Yeaoh.stataRun
                  (Stata integration seems easier on a Mac than on Windows?)

                  Spell checking:
                  https://marketplace.visualstudio.com...-spell-checker

                  This spell checker is targeted towards code, maybe it can be customised. From within VS Code you can search for other extensions that do spell checking. (Spell checking in RStudio focuses on text and comments, but unfortunately, good Stata inegration is still lacking in RStudio).
                  Last edited by Christopher Bratt; 29 Aug 2021, 00:22.

                  Comment


                  • #10
                    So OP followed your advice based on "videos or solid reviews," and wasted half a day or full day to figure out that what you are recommending does not work.

                    And it turned out like this, because you are recommending stuff not on your "personal experience," but rather on what you overheard somewhere and some video that you watched.

                    On general note, personal knowledge is limited, but in some cases it is all there is.


                    Originally posted by Christopher Bratt View Post
                    On a general basis: I would recommend against putting too much emphasis on our personal opinionated views, based on our personal experience and the tendency to generalise from limited knowledge.

                    For what modern code editors do, check out videos or solid reviews.

                    Comment


                    • #11
                      You can try putting the request for a spell checker on the wish list for Stata 18.

                      But the thing is that it is not such a common request, to my knowledge you are the first one to complain about it, so I do not know whether Stata Corp will rush to address the issue.

                      Try to make something work that is available at the moment.

                      When I tried Vim with Stata integration, I just found Vim itself horrible. On the other hand Winedt with Stata integration was fine, because I was using Winedt anyways for Latex, and was familiar with how it works.

                      So what you can do it start from whichever is your favourite text editor, and see whether there is Stata integration for it.


                      Originally posted by Trevor Andrew View Post
                      Sounds like I have to make another editor work. Christopher Bratt I tired VSC but couldn't make it integrate with stata so that I can run commands from it. Maybe I should give it another try.

                      Still I think for the price of stata, the do-file editor should have a built-in spell check. I think there beginners without previous knowledge of other editors that would like a spell checker. It is just much more convenient to not have to go to LaTeX and check your spelling. Besides if it is a figure, you would have to copy paste titles, labels etc. somewhere to check the spelling which is inconvenient.

                      Comment


                      • #12
                        Trevor Andrew If you find VS Code attractive after having a look at videos introducing its capabilities, why not try it out? (Provided you don't consider an hour experimenting with a productivity app as time wasted.)

                        If VS Code is an attractive choice, it should be relatively easy for you to use a spell checker. I had a quick look, the option for highlighting text and checking that particular text is available for German (the Duden extension), but I'm not sure it's available for English. One way or the other, you could simply open another window in VS Code or some other text editor without saving the content as a file, turn on whatever spell checker you've installed and write the text you want to have checked. Then copy and paste in the original file.

                        Of course, using a more advanced text editor than Stata's do-file editor is only one option. Exporting to a word processor (such as Word) or is another option. I would assume using MS Word is more complicated and time consuming, but that's only my subjective view based on my experience with text editors and MS Word.

                        Comment

                        Working...
                        X