Difference between revisions of "Text Command"

From GeoGebra Manual
Jump to: navigation, search
m (1 revision: tt => code)
m (Tool's name updated (Insert Text -> Text))
 
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<noinclude>{{Manual Page|version=4.0}}[[Category:Manual (official)|{{PAGENAME}}]]</noinclude>
+
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|text}}
{{command|text}}
+
; Text( <Object> )
; Text[Object]: Returns the formula for the object as a [[texts|text object]].
+
: Returns the formula of the object as a [[texts|text object]].
: {{Note| By default, values are substituted for variables.}}
+
: {{Note| By default, values are substituted to variables.}}
: {{Example|1=If ''a = 2'' and ''c = a<sup>2</sup>'', then <code>Text[c]</code> returns the text "4".}}
+
: {{Example|1=If ''a = 2'' and ''c = a<sup>2</sup>'', then <code>Text(c)</code> returns the text ''"4"''.}}
; Text[Object, Boolean]: Returns the formula for the object as a text object. The Boolean variable determines if values are substituted for variables (''true'') or if variable names are shown in the text (''false'').
+
; Text( <Object>, <Boolean for Substitution of Variables> )
: {{Example|1= If ''a = 2'' and ''c =  a<sup>2</sup>'', then  
+
: 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'').
: <code>Text[c, true]</code> returns the text "4" and  
+
:{{Example|1=<div>If ''a = 2'' and ''c =  a<sup>2</sup>'', then  
: <code>Text[c, false]</code> returns the text "''a<sup>2</sup>''".}}
+
:* <code>Text(c, true)</code> returns the text ''"4"'' and  
; Text[Object, Point]: Returns the formula for the object as a text object at the position of the given point.
+
:* <code>Text(c, false)</code> returns the text ''"a<sup>2</sup>"''.</div>}}
: {{Example| <code>Text["hello", (2, 3)]</code> draws the text at the position ''(2, 3)''.}}
+
; Text( <Object>, <Point> )
; Text[Object, Point, Boolean]: Returns the formula for the object as a text object at the position of the given point. The Boolean variable determines if values are substituted for variables (''true'') or if variable names are shown in the text (''false'').
+
: Returns the formula of the object as a text object at the position of the given point.
; Text[Object, Point, Boolean,Boolean]: {{description}}
+
: {{Example|1=<code>Text("hello", (2, 3))</code> returns the text ''"hello"'' at the position ''(2, 3)''.}}
 
+
; Text( <Object>, <Point>, <Boolean for Substitution of Variables> )
{{Note|See also [[Insert Text Tool]]}}
+
: 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|1=If ''a = 2'' and ''c = a<sup>2</sup>'', then <code>Text(c, (2, 1), true)</code> 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|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]> )
 +
: 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|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]] [[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