Skip to contents

Interprets a single line of .smcl markup the way Stata's own Results window / Viewer would display it: {col N} jumps (padding with spaces) to absolute column N, {hline N} draws N (default 1 screen width's worth, capped at 78 as Stata's own default window width) - characters, {space N} inserts N literal spaces, {c NAME} substitutes a box-drawing / literal-brace character (see .SMCL_C_CODES), a syntax-2/4 directive ({res:text}, {ralign 12:text}) keeps just text (rendered according to its own rule when one applies, e.g. right-alignment), and every other directive (a style/mode marker, a link directive such as {help ...}, a comment {* ...}) is a zero-width no-op that is simply removed. Unrecognised directives are also removed rather than left in the output verbatim, since a stray {unknown} reads far worse in extracted text than silently dropping a directive this port has not seen.

Usage

.smcl_render_line(line)

Arguments

line

one raw line of .smcl text (as read from the file, one element of readLines()'s result)

Value

the plain-text rendering of that line