asdocx: Export from Stata to Word, Excel, LaTeX & HTML Forums asdocx Forum Output to Multiple Documents Simultaneously?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • Kevin Blaine
    Participant
    Post count: 50

    Hi Dr. Shah — I’m trying to write results to multiple documents simultaneously to improve efficiency. Is that functionality available?

    Here’s a snippet of the code showing what I’m hoping to do:

    //	GLOBAL ASDOCX TEXT SHORTCUT
    		
    	global text "asdocx, save("Abstract Results Draft") text("
    
    //	ABSTRACT DOCUMENT
    
    	asdocx collect on
    	asdocx, text(Results Section) save("Abstract Results Draft") title replace
    	tab approach_ablation, matcell(approach)
    	local n_ra = approach[1,1]
    	local n_ts = approach[2,1]
    	local percent_ra = round(`n_ra'/r(N)*100,.1)
    	local percent_ts = round(100-`percent_ra',1)
            $text   Transseptal puncture was performed in `n_ra' (`percent_ra'%), and 
            $text   transaortic catheterization was performed in `n_ts' (`percent_ts'%). 
    
    //     ABSTRACT DATA TABLES
    
           asdocx tab flu approach_ablation, chi save(Abstract Tables) replace column matcell(flu) tzok dec(2) title(\i)
    	local y_ra = flu[2,1]
    	local n_ra = flu[1,1]
    	local y_ts = flu[2,2]
    	local n_ts = flu[1,2]
    	local y_flu = `y_ra'+`y_ts'
    	local y_flu_per = round(`y_flu'/(`y_flu'+`n_ra'+`n_ts')*100,.1)
    	local y_per_ra = round(`y_ra'/`y_flu'*100,.1)
    	local y_per_ts = round(`y_ts'/`y_flu'*100.1)
    	loca pval = round(r(p),.100)
    
    //     BACK TO ABSTRACT TEXT
           $text   Overall, fluoroscopy was necessary for `y_flu' procedures (`y_flu_per'%), 
           $text   with fluoroscopy being required significantly more among TS patients 
           $text   compared to RA (`y_per_ts'% vs`y_per_ra'%, p<`pva;')
    
    Kevin Blaine
    Participant
    Post count: 50

    Also, because I have a feeling I’ll be using this forum regularly, what is the markdown syntax for code blocks here?

    Attaullah Shah
    Moderator
    Post count: 76

    asdocx keeps backup of all the files it creates. These backups can be used to re-generate Excel, Word, Html, or Latex files. If you are writing to two files at the same time, you need to just remember the files names. Once they are ready for export, supply the file name in the save() option. In your case, you can export the two files with:

    asdocx export, save(Abstract Results Draft)
    asdocx export, save(Abstract Tables)
    Attaullah Shah
    Moderator
    Post count: 76

    You can enter Stata codes and output inside the <pre> </pre> tags, e.g., <pre> some Stata code here </pre> This will appear as:

    some Stata code here

    Please also note that html converts the Stata’s local macro symbol ` to code, therefore, you need to use the html escape sequence of &grave; instead of ` You can also write it as &#96; instead of &grave;.

    Kevin Blaine
    Participant
    Post count: 50

    There it is — that’s what I was looking for, on both counts! THANK YOU!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.