asdocx: Export from Stata to Word, Excel, LaTeX & HTML › Forums › asdocx Forum › Indent in Specific Cells Using Flexmat?
Tagged: table indent flexmat cells
Kevin BlaineParticipantJanuary 18, 2023 at 7:44 pmPost count: 44
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 ShahModeratorJanuary 20, 2023 at 12:35 pmPost count: 70
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.
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 exportTable: Results
Variables Frequencies Gender :Male 655Female 745 Notes:Kevin BlaineParticipantJanuary 20, 2023 at 7:21 pmPost count: 44
Fantastic. I thought something like this existed, but couldn’t find it. Makes sense to find out it is undocumented!
– KevinKevin BlaineParticipantFebruary 2, 2023 at 12:14 amPost count: 44
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
\bworks in Line 5, but nowhere else. And
\idoesn’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 ShahModeratorFebruary 3, 2023 at 12:22 pmPost count: 70
The use of both
\idirectives 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 ].
- You must be logged in to reply to this topic.