Announcement

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

  • PutPDF Format Syntax Issue

    Hi,

    I am using STATA 15 in a Unix terminal and I am having an issue using one functionality of putpdf. I am okay with creating the pdf, posting a table of data, and editing individual cells. However, based on the help file and the detailed online description, it should be possible to apply formatting in the following way:

    Code:
    * set up
    sysuse auto, clear
    putpdf begin
    putpdf table example = data(mpg price)
    
    * code chunk that does not work:
    putpdf table example(.,.), halign(center)
    When I implement the above code, I receive the below error:

    "invalid specification; row and column misspecified
    r(198);"

    It should be possible based on the help file to apply the halign formatting to the entire table using the (.,.) shorthand, where the "." mean the entire range of the row/column. I have tried many variations of this, and it appears that the only time I can use the "." is for the column/row options, where the command is specified as (1,.) or (.,1). I can never use (.,.).

    Normally I would find a work around, but it seems like the only work around here is to loop over every individual cell in the table and format. Any help would be appreciated!

  • #2
    Welcome to Statalist.

    Are you sure you have the latest updates to Stata applied? Your code does not fail on my system, and the resulting PDF (not shown here) has two very wide columns with the data centered in each cell. I note that help whatsnew shows numerous changes to putpdf since the 15.0 release.

    Code:
    . about
    
    Stata/SE 15.1 for Mac (64-bit Intel)
    Revision 11 Jan 2018
    ...                     
    
    . sysuse auto, clear
    (1978 Automobile Data)
    
    . putpdf begin
    
    . putpdf table example = data(mpg price)
    
    . putpdf table example(.,.), halign(center)
    
    . putpdf save example, replace
    
    .

    Comment


    • #3
      Thanks William, it was because I had not updated my STATA 15 version. Should have thought of that earlier.

      Comment

      Working...
      X