how to insert a line break within a sequence of texts?

Cecilia Lucía Gigena shared this question 8 months ago
Needs Answer

I'm trying to make this sequence of texts, but something is not working regarding the line break:

Sequence(Text("" + (0 + 2i) + \\ + "cm", l5(i + 0)), i, 0, 30)


First item should look like this:


2

cm


If I only put one item, it works typing it like this:

2

\\cm


But that does not work within a sequence.

Comments (7)

photo
1

Sequence(Text("" + (0 + 2i) + "\\ " + "cm", l5(i + ?0), true, true), i, 0, 30)


  • \\ inside in the string
  • bolean parameter no 4 for laTex = true
  • ?0-->maybe: +1 instead of +0

https://wiki.geogebra.org/e...

note also: the new parameters 5 and 6 for alignment

photo
1

Thank you! That works.

But I didn't get the part of bolean parameter. Which parts of my formula are booleans? Why 2 booleans and not other quantity?


Another doubt: is there any way to make text align in the center?

photo
1

The value of a boolean is true or false. 3. and 4. Parameters in the formula has this value, so there are boolean parameter.

There are "position paramter" that means the meaning of the parameter is given by its position. If one wants to indicate the 4th parameter (laTex), then one is forced to indicate also the parameter. 1 to 3 so that a 4th parameter (laTex) can be defined at all.

For further questions: please read the above link very carefully and thoroughly.

photo
1

I know what a boolean is. I don't know why MY parameters are booleans. I didn't expect my code to ask me for "true" or "false" options.


I have used booleans for: "if this option is selected, then draw a ball, if this option is not selected, then hide the ball drawing". Or: "if variable is within this range of numbers, then draw a ball, otherwise, don't draw it". It's the first time I am dealing with booleans inside a text code.


So my code is:

Sequence(Text("" + (0 + 2i) + "\\ " + "cm", l5(i + ?0), true, true), i, 0, 30)


I assume I can divide it in these parts:

1) ""

2) (0 + 2i)

3) "\\ "

4) "cm"

5) l5(i + ?0)


You mentioned LaTex... you mean this one: "\\ " ?

I didn't know that was a boolean.

And which other one is also a boolean?

photo
1

quote: ou mentioned LaTex... you mean this one: "\\ " ?

yes

"\\ " inside a string is laTex code (not a bolean)

and the 4. parameter say to ggb: please interprete the text in the first parameter as latex (that mean all is in a string or converted to a string and this text has or has not laTex code [for example "\\ " or "\frac{"+<value>+"}{"+value+"}" etc])

photo
1

So when I say "true" for the first time I'm saying:


"\\ " is a latex code


And what does the second "true" mean?

photo
photo
1

Addendum:

Better wording: ......please interpret the full text in parameter 1 with the rules and syntax of laTex.....

there exist only one paramter to say ".... please...laTex...."

Maybe is more cleare if you read the above link (in my first post) very carefully and thoroughly

© 2021 International GeoGebra Institute