zizhongyan / StataImproved

Improved Stata Editor for macOS : a sublime text 3 plugin
MIT License
48 stars 15 forks source link

can we customize our own snippet? #31

Open dreistein543 opened 2 years ago

dreistein543 commented 2 years ago

I have written a snippet for myself to simplify the use of esttab

however, it cannot work. the auto-completion function does identify my snippet. as displayed below:

截屏2022-11-03 17 12 41

I wander if you can help me to see what's wrong? my snippet as below

<snippet>
    <content><![CDATA[
local File      "using ../table/${1:FileName}.tex"
local Models    "${2:ModelName}"
local Pnum      "${3:# after dot}"
local Title     "${4:tableName} \label{tab:${5:Label for table}}"
local StarMark  "star(*0.1 ** 0.05 *** 0.01)"
local TabStyle  "nogap compress noomit nomtitle label b(`Pnum') t(`Pnum') `StarMark' booktabs"
local AlignKind "D{.}{.}{-1}"
local YEffect   "Year     = _Iyear*"
local IEffect   "Industry = _Iind*"
local PEffect   "" 
local MGroup    `""' 
local GrpPat    "" 
local OrderList "" 
local ModelStat " N              N_clust        ar2    F         chi2   df_m" 
local StatLabel `""Observations" "Num of Firms" "R$^2$" "F value" "$\Chi^2$" "Degree of Freedom""'
local sfmt      "0 0 a2 3 3 0" 
local StatStar  "F chi2" 

    esttab `Models' `File',replace `TabStyle' align(`AlignKind') ///
        order(`OrderList')                                       ///
        indicate("`YEffect'" "`IEffect'" "PEffect")              /// 
        stats(`ModelStat',                                       ///
              fmt(`sfmt')                                        ///
              star(`StatStar') label(`StatLabel'))               ///
        mgroups(`MGroup',                                        ///
                pattern(`GrpPat') span                           ///
                prefix(\multicolumn{@span}{c}{) suffix(})        ///
                erepeat(\cmidrule(lr){@span}))
]]></content>
    <tabTrigger>esttabtex</tabTrigger>
    <scope>source.stata</scope>scope>
    <description>Output to LaTeX</description>description>
</snippet>