Formatting directives in flexmat tables


Text Formatting

  • Italic Text: Use \i before your text to make it italic. Example: \iThis text is italic.
  • Bold Text: Use \b to bold your text. Example: \bThis text is bold.

Superscript

To create superscripts, use \super followed by the number or text you want to superscript. Example: H\super2 for H2.

Line Formatting

  • Horizontal Line: \hline creates a single horizontal line across the table row.
  • Double Horizontal Line: \dhline is used for creating a double horizontal line.
  • Vertical Line: Use \vline to insert a vertical line.

Table Formatting

  • Row Header: \rowheader will format the current row as a header row, typically making the text bold and adding double underline.
  • Horizontal Merge: Use \hmerge_n to merge ‘n’ number of cells horizontally. Replace ‘n’ with the number of cells. Example: \hmerge_2 merges the next two cells horizontally.
  • Vertical Merge: \vmerge_n merges ‘n’ number of cells vertically. Replace ‘n’ with the number of cells to merge. Example: \vmerge_3 merges the next three cells vertically.

Text Alignment in Cells

  • Right Alignment: \qr aligns the text in a cell to the right.
  • Left Alignment: \ql aligns text to the left in a cell.
  • Center Alignment: \qc centers the text in a cell.

 

Example Use

* Save the file name
asdocx setfile, save(Example 1.docx) replace

flexmat reset

* Set vertical lines
flexmat addrow, data(\vlineVariables, \vlineCoefficients, \vlineR \super3)
flexmat addrow, data(Price, 0.235, 0.78) row(2)

* Make the text 0.980 bold and use superscript 3 with it
flexmat addrow, data(MPG, 0.3658, \b0.980\super3) row(3)

flexmat addrow, data(Weight, 0.9874, 0.8741) row(4)

* Export
asdocx export

flexmat formatting directives example table