• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

View

# TextWithGeoGebra-32

last edited by 10 years, 2 months ago

We will work through some examples of adding text to the geometry window of GeoGebra. We will start with simple cases and then add complexity. To give a context,

consider a GeoGebra file for demonstrating quadratic equations where we have three sliders, named a, b, and c, and a function f(x)=a*x^2+b*x+c. I) Adding text with the text tool.

A) Inserting basic text with the text tool.

The first method is to use the text tool. Select the second tool menu from the right. The third item in that menu is for inserting text. Select that item. Once the Insert Text Tool is selected, the icon is highlighted and the tool tip gives instructions to click in the graphics window where you want to insert text. Clicking in the window brings up a dialog box where we insert the text. We will start with a simple text that will become our header for the application. We want to inset the text "Considering Quadratic Equations". We simply type the text in and click the OK button. Since this will be our header, we would like to increase the size of the text and change its color. We select the text object and select "Change Properties." We change the size with the text tab and change the color with the color tab. B) Adding dynamic values with the text tool.

Besides text, we would also like to be able to add values that will change with dynamic demonstration. The syntax we will use is to have an empty string designated by two double quotation marks, a plus sign for concatenation, and the name of the object whose value we want. We will add in the vertex and get an ordered pair. We also have the option of including a non-empty string as well. For our example we will add words that let us know the ordered pair is the vertex. C) Adding formatted formulas, the LaTeX option:

One of the options we want is for the text to be formatted mathematics. GeoGebra gives you the option of interpreting the text as a LaTeX formula. For our purposes, LaTeX is a mathematical markup language whose syntax is beyond the scope of this article. However for simple constructions there is a drop down menu, which will call up the construction in LaTeX. We will give the instruction for the vertex, which involves fractions. The \frac construction from LaTex allows us to have the formatted fractions. We simply select the fraction from the drop down menu. GeoGebra will provide

\frac{}{}.

We then put the numerator and denominator between the braces. D) Adding values into the Formulas:

We would next like to have the mathematically formatted expressions, but use the live values rather then the variable names. We basically use the same rule we used when connecting text and values. The text that is part of the formula goes between double quotation marks and the names corresponding to values is outside the quotations. A plus sign is used to concatenate names and strings. We used

(\frac{ -b }{2 a}, f(\frac{ -b }{2 a}) )

for the vertex with names in the formulas. We use

"(\frac{ " + -b +"}{"+2 a+"}, f(\frac{"+ -b +"}{"+ 2 a+"}) )"

for the vertex using values. E) Combining text, mathematical typesetting, and values in a single text.

Finally, we would like to combine standard text, mathematical formulae, and values in a single text. We want to construct a text along the lines of

The vertex is ( an expressions using names of variables) or (an expression with values).

We then use

"The Vertex is $( \frac{ -b }{ 2 a},f( \frac{ -b}{2 a }))$ or $( \frac{" + (-(b)) + "}{" + (2 a) + "},f( \frac{" + (-(b)) + " }{" + (2 a) + "}))$ " It is worth noting that GeoGebra does not simplify between value sections. (That is why the example construction also uses xVert, yVert, and Vertex.)

The pieces of text between dollar signs are LaTex formulas. Carriage returns in the formulas are ignored. Carriage returns in the text are considered hard returns and will show up on screen. The returns from the wrapping in the text box will be ignored in the displayed text.

II) Advanced features – Some of the advanced features of text require that we change the object properties. We get to the properties either by right clicking (ctrl-click on Macs) on the object or choosing object properties from ***** A) Location – By default the location of a string is tied to the coordinates where it was created. A text string can be moved by dragging it to a desired location. The starting point of a text is upper right corner of a text. We can specify the coordinates of a point. Using the position tab, we can also set the location to a named point. Sometimes we would like to specify a point relative to the screen rather than to the coordinate system, for example, putting the title in the middle top of the screen. To do this we use the Corner[] command. The Corner command returns the coordinates of the lower left, lower right, upper right, and upper left corners respectively for values 1, 2, 3, and 4. We can designate a point in the middle from left to right ans 20% from top to bottom with a point:

Base=(.5*x(Corner)+.5*x(Corner), .8*y(Corner)+.2*y(Corner))

B) Visibility – Another advanced feature is visibility. Using the advanced tab of object properties, we can give a condition for a text to be visible.. In the example below we add a condition so text5 is only visible when the x coordinate of the point Vertex is negative. III) Labels and Captions.

Another way to add text to a GeoGebra construction is with the labels option. We find this in the basic tab of the advanced properties dialog. There is a check box to show the label. The options for the label are the name of the object, it value, its name and value, and a caption. In GeoGebra 3.2 the caption can only be static text. IV) Formula Text – A final command to consider is FormulaText, which displays formulas with proper typesetting. In the example we have been working on, FormulaText[f] gives the properly typeset formula for f(), with values plugged in for a, b, and c.