OutputStepsRecord - Maple Help

Student[Basics]

 OutputStepsRecord
 format and/or display annotated steps

 Calling Sequence Student[Basics][OutputStepsRecord](steps) Student[Basics][OutputStepsRecord](steps, options)

Parameters

 steps - list of records displaystyle=... - (optional) columns, compact, or linear output=... - (optional) print, printf, typeset, canvas, script, list, record, link

Description

 • The OutputStepsRecord command is used to format and display a "steps" data structure, used by many of the internal Student commands for showing the steps of solving a math problem.  Such a command creates a list of Records containing "math" and "annotation"s, and this routine takes care of displaying those steps in a consistent way.
 • The displaystyle option controls the layout of the content.
 When displaystyle=columns, substeps are split out into a second column to the right of the main steps.
 When displaystyle=linear, annotations appear on their own line as a title, preceding the math for each step.
 When displaystyle=compact, annotations appear on the same line, to the right of the math, except for annotations that introduce a series of substeps, which appear on their own line as a title.
 • The output option controls the rendering mechanism and return value.
 output=typeset is the default rendering mode when using the Standard Worksheet Interface.  It displays textbook style math in a layout according to displaystyle.
 output=printf is the default rendering mode when using the Command-line version of Maple.  It displays ASCII style math notation, and is ideal for copy & paste into an email or text-based application.
 output=print uses the print command to render output in a linear centered fashion.
 output=canvas returns a XML string that can be used as part of a MapleLearn document.
 output=link deploys the steps as a MapleLearn document and provides a web hyperlink to the document as output.
 output=script returns a DocumentTools:-Canvas:-Script object.
 output=record returns the input as a Record
 output=list returns the input as a list of lists

Package Usage

 • This function is part of the Student[Basics] package, so it can be used in the short form OutputStepsRecord(..) only after executing the command with(Student[Basics]). However, it can always be accessed through the long form of the command by using Student[Basics][OutputStepsRecord](..).

Examples

 > $\mathrm{with}\left(\mathrm{Student}\left[\mathrm{Basics}\right]\right):$
 > steps := [   Record(math=<2*x+5*y=19,x-2*y=-4>,annotation="solve system"),   Record(math=(x=2*y-4),annotation="solve equation 2 for x",          substeps=[              Record(math=(x-2*y=-4),annotation="equation 2"),              Record(math=(x=-4+2*y),annotation=_MTEXT("add %1 to both sides",2*y))          ]   ),   Record(math=(y=3),annotation="substitute value of x into equation 1 and solve",          substeps=[              Record(math=(2*x+5*y=19),annotation="equation 1"),              Record(math=(2 %* (2*y-4)+5*y=19),annotation="sub in value for x"),              Record(math=(4 %* y-8+5 %* y=19),annotation="expand"),              Record(math=(9*y-8=19),annotation="collect"),              Record(math=(9*y=27),annotation="add 8 to both sides"),              Record(math=(y=3),annotation="divide both sides by 9")          ]   ),   Record(math=(x=2 %* (3)-4),annotation=_MTEXT("substitute %1 into %2",y=3,x=2*y-4)),   Record(math=(x=2),annotation="simplify"),   Record(math=,annotation="solution") ]:
 > $\mathrm{OutputStepsRecord}\left(\mathrm{steps}\right)$
 $\begin{array}{lll}\text{•}& {}& \text{solve system}\\ {}& {}& \left[\begin{array}{c}{2}{}{x}{+}{5}{}{y}{=}{19}\\ {x}{-}{2}{}{y}{=}{-4}\end{array}\right]\\ \text{▫}& {}& \text{solve equation 2 for x}\\ {}& \text{◦}& \text{equation 2}\\ {}& {}& {x}{-}{2}{}{y}{=}{-4}\\ {}& \text{◦}& {\text{add}}\phantom{\rule[-0.0ex]{1.0thickmathspace}{0.0ex}}{2}{}{y}\phantom{\rule[-0.0ex]{1.0thickmathspace}{0.0ex}}{\text{to both sides}}\\ {}& {}& {x}{=}{2}{}{y}{-}{4}\\ \text{▫}& {}& \text{substitute value of x into equation 1 and solve}\\ {}& \text{◦}& \text{equation 1}\\ {}& {}& {2}{}{x}{+}{5}{}{y}{=}{19}\\ {}& \text{◦}& \text{sub in value for x}\\ {}& {}& \left[{}\right]{+}{5}{}{y}{=}{19}\\ {}& \text{◦}& \text{expand}\\ {}& {}& \left[{}\right]{-}{8}{+}\left[{}\right]{=}{19}\\ {}& \text{◦}& \text{collect}\\ {}& {}& {9}{}{y}{-}{8}{=}{19}\\ {}& \text{◦}& \text{add 8 to both sides}\\ {}& {}& {9}{}{y}{=}{27}\\ {}& \text{◦}& \text{divide both sides by 9}\\ {}& {}& {y}{=}{3}\\ \text{•}& {}& {\text{substitute}}\phantom{\rule[-0.0ex]{1.0thickmathspace}{0.0ex}}{y}{=}{3}\phantom{\rule[-0.0ex]{1.0thickmathspace}{0.0ex}}{\text{into}}\phantom{\rule[-0.0ex]{1.0thickmathspace}{0.0ex}}{x}{=}{2}{}{y}{-}{4}\\ {}& {}& {x}{=}\left[{}\right]{-}{4}\\ \text{•}& {}& \text{simplify}\\ {}& {}& {x}{=}{2}\\ \text{•}& {}& \text{solution}\\ {}& {}& \left[\begin{array}{c}{x}{=}{2}\\ {y}{=}{3}\end{array}\right]\end{array}$ (1)
 > $\mathrm{OutputStepsRecord}\left(\mathrm{steps},'\mathrm{displaystyle}'='\mathrm{columns}'\right)$

 > $\mathrm{OutputStepsRecord}\left(\mathrm{steps},'\mathrm{displaystyle}'='\mathrm{compact}'\right)$
 $\begin{array}{ll}\left[\begin{array}{c}{2}{}{x}{+}{5}{}{y}{=}{19}\\ {x}{-}{2}{}{y}{=}{-4}\end{array}\right]& \text{solve system}\\ \text{solve equation 2 for x}& {}\\ {x}{-}{2}{}{y}{=}{-4}& \text{equation 2}\\ {x}{=}{2}{}{y}{-}{4}& {\text{add}}\phantom{\rule[-0.0ex]{1.0thickmathspace}{0.0ex}}{2}{}{y}\phantom{\rule[-0.0ex]{1.0thickmathspace}{0.0ex}}{\text{to both sides}}\\ \text{solve equation 2 for x}& {}\\ {x}{=}{2}{}{y}{-}{4}& {}\\ \text{substitute value of x into equation 1 and solve}& {}\\ {2}{}{x}{+}{5}{}{y}{=}{19}& \text{equation 1}\\ \left[{}\right]{+}{5}{}{y}{=}{19}& \text{sub in value for x}\\ \left[{}\right]{-}{8}{+}\left[{}\right]{=}{19}& \text{expand}\\ {9}{}{y}{-}{8}{=}{19}& \text{collect}\\ {9}{}{y}{=}{27}& \text{add 8 to both sides}\\ {y}{=}{3}& \text{divide both sides by 9}\\ \text{substitute value of x into equation 1 and solve}& {}\\ {y}{=}{3}& {}\\ {x}{=}\left[{}\right]{-}{4}& {\text{substitute}}\phantom{\rule[-0.0ex]{1.0thickmathspace}{0.0ex}}{y}{=}{3}\phantom{\rule[-0.0ex]{1.0thickmathspace}{0.0ex}}{\text{into}}\phantom{\rule[-0.0ex]{1.0thickmathspace}{0.0ex}}{x}{=}{2}{}{y}{-}{4}\\ {x}{=}{2}& \text{simplify}\\ \left[\begin{array}{c}{x}{=}{2}\\ {y}{=}{3}\end{array}\right]& \text{solution}\end{array}$ (2)
 > $\mathrm{OutputStepsRecord}\left(\mathrm{steps},'\mathrm{output}'='\mathrm{printf}'\right)$
 • solve system         Matrix(2, 1, [[2*x+5*y = 19],[-2*y+x = -4]]) ▫        solve equation 2 for x                 ◦ equation 2                 -2*y+x = -4                 ◦ add 2*y to both sides                 x = 2*y-4 ▫        substitute value of x into equation 1 and solve                 ◦ equation 1                 2*x+5*y = 19                 ◦ sub in value for x                 2*(2*y-4)+5*y = 19                 ◦ expand                 4*y+5*y-8 = 19                 ◦ collect                 9*y-8 = 19                 ◦ add 8 to both sides                 9*y = 27                 ◦ divide both sides by 9                 y = 3 • substitute y = 3 into x = 2*y-4         x = 2*3-4 • simplify         x = 2 • solution         Matrix(2, 1, [[x = 2],[y = 3]])
 > $\mathrm{OutputStepsRecord}\left(\mathrm{steps},'\mathrm{output}'='\mathrm{print}'\right)$
 ${"solve system"}$
 $\left[\begin{array}{c}2{}x+5{}y=19\\ x-2{}y=-4\end{array}\right]$
 ${"solve equation 2 for x"}$
 ${"equation 2"}$
 ${x}{-}{2}{}{y}{=}{-4}$
 ${"add 2*y to both sides"}$
 ${x}{=}{2}{}{y}{-}{4}$
 ${"substitute value of x into equation 1 and solve"}$
 ${"equation 1"}$
 ${2}{}{x}{+}{5}{}{y}{=}{19}$
 ${"sub in value for x"}$
 ${\mathrm{%*}}{}\left({2}{,}{2}{}{y}{-}{4}\right){+}{5}{}{y}{=}{19}$
 ${"expand"}$
 ${\mathrm{%*}}{}\left({4}{,}{y}\right){-}{8}{+}{\mathrm{%*}}{}\left({5}{,}{y}\right){=}{19}$
 ${"collect"}$
 ${9}{}{y}{-}{8}{=}{19}$
 ${"add 8 to both sides"}$
 ${9}{}{y}{=}{27}$
 ${"divide both sides by 9"}$
 ${y}{=}{3}$
 ${"substitute y = 3 into x = 2*y-4"}$
 ${x}{=}{\mathrm{%*}}{}\left({2}{,}{3}\right){-}{4}$
 ${"simplify"}$
 ${x}{=}{2}$
 ${"solution"}$
 $\left[\begin{array}{c}x=2\\ y=3\end{array}\right]$ (3)
 > $\mathrm{OutputStepsRecord}\left(\mathrm{steps},\mathrm{output}='\mathrm{link}'\right)$

Compatibility

 • The Student[Basics][OutputStepsRecord] command was introduced in Maple 2021.