Difference between revisions of "Text Command"

From GeoGebra Manual
Jump to: navigation, search
m (format)
m (Tool's name updated (Insert Text -> Text))
 
(One intermediate revision by one other user not shown)
Line 19: Line 19:
 
: {{Example|1=If ''a = 2'' and ''c = a<sup>2</sup>'', then <code>Text(c, (2, 1), true, true)</code> returns the LaTeX text ''"4"'' at the position ''(2, 1)''.}}
 
: {{Example|1=If ''a = 2'' and ''c = a<sup>2</sup>'', then <code>Text(c, (2, 1), true, true)</code> returns the LaTeX text ''"4"'' at the position ''(2, 1)''.}}
 
;Text( <Object>, <Point>, <Boolean for Substitution of Variables>, <Boolean for LaTeX formula>, <Horizontal alignment [-1|0|1]>, <Vertical alignment [-1|0|1]> )
 
;Text( <Object>, <Point>, <Boolean for Substitution of Variables>, <Boolean for LaTeX formula>, <Horizontal alignment [-1|0|1]>, <Vertical alignment [-1|0|1]> )
: Returns the formula of the object as a text object at the position of the given point. The first Boolean variable determines whether values are substituted to variables (''true'') or variable names are shown in the text (''false'').  If the second Boolean variable is ''true'', the text is rendered using [[LaTeX]]. The values -1, 0, 1 for horizontal and vertical alignment shift the text from the default position respectively as follows:
+
: Returns the formula of the object as a text object at the position of the given point. The first Boolean variable determines whether values are substituted to variables (''true'') or variable names are shown in the text (''false'').  If the second Boolean variable is ''true'', the text is rendered using [[LaTeX]]. The values -1, 0, 1 for horizontal and vertical alignment shift the text object from the default position respectively as follows:
 
:* -1: horizontal shift leftwards / vertical shift downwards
 
:* -1: horizontal shift leftwards / vertical shift downwards
:* 0: centers the text horizontally / vertically on the given point  
+
:* 0: centers the text object horizontally / vertically at the given point  
:*1: horizontal shift rightwards, vertical shift upwards
+
:*1: horizontal shift rightwards / vertical shift upwards
: {{Example|1=If ''a = 2'' and ''c = a<sup>2</sup>'', then <code>Text(c, (2, 1), true, true, -1, 0)</code> returns the LaTeX text ''"4"'' to the left of ''(2, 1)'', and aligned vertically with the point.}}
+
: {{Example|1=If ''a = 2'' and ''c = a<sup>2</sup>'', then <code>Text(c, (2, 1), true, true, -1, 0)</code> returns the LaTeX text ''"4"'' to the left of ''(2, 1)'', and vertically aligned with the point.}}
{{Note|1=See also [[File:Mode text.svg|link=|22px]] [[Insert Text Tool|Insert Text]] tool.}}
+
{{Note|1=See also [[File:Mode text.svg|link=|22px]] [[Text Tool|Text]] tool.}}

Latest revision as of 18:53, 26 January 2021


Text( <Object> )
Returns the formula of the object as a text object.
Note: By default, values are substituted to variables.
Example: If a = 2 and c = a2, then Text(c) returns the text "4".
Text( <Object>, <Boolean for Substitution of Variables> )
Returns the formula of the object as a text object. The Boolean variable determines whether values are substituted to variables (true) or variable names are shown in the text (false).
Example:
If a = 2 and c = a2, then
  • Text(c, true) returns the text "4" and
  • Text(c, false) returns the text "a2".
Text( <Object>, <Point> )
Returns the formula of the object as a text object at the position of the given point.
Example: Text("hello", (2, 3)) returns the text "hello" at the position (2, 3).
Text( <Object>, <Point>, <Boolean for Substitution of Variables> )
Returns the formula of the object as a text object, at the position of the given point. The Boolean variable determines whether values are substituted to variables (true) or variable names are shown in the text (false).
Example: If a = 2 and c = a2, then Text(c, (2, 1), true) returns the text "4" at the position (2, 1).
Text( <Object>, <Point>, <Boolean for Substitution of Variables>, <Boolean for LaTeX formula> )
Returns the formula of the object as a text object at the position of the given point. First Boolean variable determines whether values are substituted to variables (true) or variable names are shown in the text (false). If the second Boolean variable is true, the text is rendered using LaTeX.
Example: If a = 2 and c = a2, then Text(c, (2, 1), true, true) returns the LaTeX text "4" at the position (2, 1).
Text( <Object>, <Point>, <Boolean for Substitution of Variables>, <Boolean for LaTeX formula>, <Horizontal alignment [-1|0|1]>, <Vertical alignment [-1|0|1]> )
Returns the formula of the object as a text object at the position of the given point. The first Boolean variable determines whether values are substituted to variables (true) or variable names are shown in the text (false). If the second Boolean variable is true, the text is rendered using LaTeX. The values -1, 0, 1 for horizontal and vertical alignment shift the text object from the default position respectively as follows:
  • -1: horizontal shift leftwards / vertical shift downwards
  • 0: centers the text object horizontally / vertically at the given point
  • 1: horizontal shift rightwards / vertical shift upwards
Example: If a = 2 and c = a2, then Text(c, (2, 1), true, true, -1, 0) returns the LaTeX text "4" to the left of (2, 1), and vertically aligned with the point.
Note: See also Mode text.svg Text tool.
© 2024 International GeoGebra Institute