【问题标题】:Esttab: Append rtf files with page break?Esttab:附加带有分页符的rtf文件?
【发布时间】:2020-12-09 17:46:16
【问题描述】:

我使用循环将各种因变量的每个回归表附加到一个文件中:

global all_var var1 var2 var3

foreach var of global all_var {

capture noisily : eststo mod0: reg  `var' i.female
capture noisily : eststo mod1: reg  `var' i.female
capture noisily : eststo mod2: reg  `var' i.female

esttab mod0  mod1  mod2  using "file_name.rtf", append
}

但是,在最终的 rtf 文件中,一些表格超过了两页,看起来不太好。

有什么办法可以避免这种情况,例如引入某种分页符?

【问题讨论】:

    标签: append stata page-break


    【解决方案1】:

    community-contributedrtfutil 提供了一个解决方案:

    net describe rtfutil, from(http://fmwww.bc.edu/RePEc/bocode/r)
    
    TITLE
          'RTFUTIL': module to provide utilities for writing Rich Text Format (RTF) files
    
    DESCRIPTION/AUTHOR(S)
          
            The rtfutil package is a suite of file handling utilities for
          producing Rich Text Format (RTF) files in Stata, possibly
          containing plots and tables. These RTF files can then be opened
          by Microsoft Word, and possibly by alternative free word
          processors. The plots can be included by inserting, as linked
          objects, graphics files that might be produced by the graph
          export command in Stata. The tables can be included by using the
          listtex command, downloadable from SSC, with the handle() option.
    

    确切的语法将取决于您不提供任何示例数据的特定用例。

    【讨论】:

      【解决方案2】:

      安装 rtfutil 后,您可以使用 rtfappend。假设你想在 mod1 和 mod2 之间有一个分页符。

          esttab mod0 mod1 using "file_name.rtf", replace
          tempname handle
          rtfappend `handle' using "file_name.rtf", replace
          file write `handle' "\page" _n
          rtfclose `handle'
          esttab mod2 using "file_name.rtf", append
      

      如果你想要换行,只需将 \page 替换为 \line。

      【讨论】:

        猜你喜欢
        • 2013-06-24
        • 1970-01-01
        • 2011-06-04
        • 1970-01-01
        • 1970-01-01
        • 2019-06-15
        • 2014-05-14
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多