asdocx: Export from Stata to Word, Excel, LaTeX & HTML › Forums › asdocx Forum › Indent in Specific Cells Using Flexmat?
Tagged: table indent flexmat cells
-
AuthorPosts
-
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?
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: ResultsVariables Frequencies Gender : Male655 Female745 Notes: Fantastic. I thought something like this existed, but couldn’t find it. Makes sense to find out it is undocumented!
– Kevin
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')
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 ].Ah — that makes sense! Thanks for letting me know. 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.