The following control words are used to set text formatting properties.
1. \b : If a sentence contains
\b, it will be shown in bold. However, this option is not sticky. So, new lines will be shown in regular font face.
2. \i : To show text in italic. This option is not sticky. So, new lines will be shown in regular font face.
3. \par : To start a new paragraph
4. \super : Show text in super-script, e.g
asdocx, text(The R\super2 is 0.25)
will be shown as The R2 is 0.25
5. \sub : Show text in sub-script, e.g
asdocx, text(The B\sub1 is 0.98)
will be shown as The B1 is 0.98
Options are written outside the brackets of the text(). The following options can be used to format the given text.
1. h1 or heading1: Either
heading1 is used to make the current line as heading 1. Similarly,
heading9 can be used.
2. title : option title is used to make the current line as document title.
asdocx, text(This is my new text line) fs(14)
asdocx, text(Yet another line) font(Arial)
5. Page breaks
Page breaks can be added with the option
pagebreak(before) inserts a page break before a given table.
pagebreak(after) inserts a page break after the table.
6. linebreak : adds a typical line break. New text restarts on the next line.
Consider the following examples:
asdocx, text("Panel Data Analysis") title replace
asdocx, text("Results and Summary Statistics.") fs(18)
asdocx, text("\b I a am bold item. ") fs(12)
asdocx, text("This section of the report will present the results and analysis.") fs(14)
asdocx, text(\i Notes to the tables are reported in table notes.)
asdocx, text(" Significance level is reported with *, **, ***. ")
asdocx, text("The R\super2 of the model is 0.0764.")
asdocx, text("The coefficient B\sub1 indicates a positive ...")
The output from the above codes is given below.
The convenience trick
It can be tedious to type
asdocx, text() each time you want to add a text line. To make this process easier, you can save
asdocx, text( to a local or global macro and then include that macro at the beginning of the text line. However, this does not completely eliminate the need to close the brackets at the end of each text line. Thankfully, asdocx automatically checks each text command for the closing bracket and will add it if it is missing. One limitation to keep in mind is that this method does not allow you to include options. This is because the bracket is added to the end of the line, making everything part of the text, including any options that may have been added to the text command. To add options, you must write the full text command in a conventional way, as you can see in example 2.
Example Reports : Text, results and graphs
Example 1 : Download the Do File | Download the output file
Example 2 : Using convenience trick | Download the output file