asdocx: Export from Stata to Word, Excel, LaTeX & HTML Forums asdocx Forum Indent in Specific Cells Using Flexmat?

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

    Hi Dr. Shah — I looked through the global formatting defaults .ado file, as well as all help documentation for asdocx and flexmat, but I couldn’t find anything related to indenting text/numbers in a given cell. Is that possible?

    Attaullah Shah
    Moderator
    Post count: 76

    This is one of the un-documented directive. When asdocx tries to convert flexmat file into MS Word or other formats, it examines each cell of the matrix for the \indent_# directive. Here, # represents the number of spaces that should be added before the text in that cell. For example, if a cell starts with \indent_4 , it will add four spaces before the text.
    You may also like to check text directors to format text, see this page.

    Example

    flexmat reset 
    asdocx setfile, save(indent.html) replace
    flexmat addrow, data(Variables, Frequencies)
    flexmat addrow, data(Gender :) row(2)
    flexmat addrow, data(\indent_4 Male, 655) row(3)
    flexmat addrow, data(\indent_4 Female, 745) row(4)
    asdocx export
    
    Table: Results
    Variables Frequencies
    Gender :
    Male
    655
    Female
    745
    Notes:
    Kevin Blaine
    Participant
    Post count: 50

    Fantastic. I thought something like this existed, but couldn’t find it. Makes sense to find out it is undocumented!

    – Kevin

    Kevin Blaine
    Participant
    Post count: 50

    Hi Dr. Shah — I’m finding that the text directors are inconsistent in flexmat. Sometimes they work, other times they don’t. For example, in the code below, using \b and \i, \b works in Line 5, but nowhere else. And \i doesn’t work at all. Any ideas?

    
    local r = 1
    asdocx setfile, save(Table1)
    flexmat reset 
    flexmat addrow, data(\b Day,\b Sample Size,\b Needed At Least 1 Medication) r(`r')
    flexmat addrow, data(\b Day 1, , ) r(`++r') emptyok
    flexmat addrow, data(\indent_4 \i WEBTips, 250 (50%),137 (54.8%)) r(`++r')
    flexmat addrow, data(\indent_4 \i WEBInfo, 250 (50%),154 (61.6%)) r(`++r')
    
    Attaullah Shah
    Moderator
    Post count: 76

    The use of both \indent and \i directives simultaneously is currently not supported. However, it is on my to-do list for future updates. Additionally, the addition of formatting directives for table headers is also not yet available. The text formatting directives were added specifically for text and paragraphs, see [ details here ].

    Kevin Blaine
    Participant
    Post count: 50

    Ah — that makes sense! Thanks for letting me know. 🙂

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