We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question
0

How do you create a formula with multiple options

asked 2020-09-18 21:18:29 +0200

ostbits gravatar image

I'm trying to create something that looks like (in 3 lines)

          | n/2
f(n) =    |
          | 3n +1

There is no formula option (Insert->formula) which seems to do what I want, so I tried to use normal paragraphs. I used a left border on the n/2 term and the 3n + 1 term, and a right border on the f(n) term. The left borders showed on the monitor, the right border did not.

So I have two questions: (1) is there a better way of doing what I want, and (2) why doesn't the right border appear on my monitor?

You are all doing a great job. Thanks.

art

edit retag flag offensive close merge delete

Comments

There is no formula option (Insert->formula)

Have you tried Insert -> Object -> Formula ?

Opaque gravatar imageOpaque ( 2020-09-19 00:31:24 +0200 )edit

Sorry. Quick fingers, slow mind. You are correct. I should have written: Insert->Object->Formula. And I did try that but did not see something I could use. I couldn't see any multi-line separator which would allow three lines. I did see 'divide' which allowed me to do something like {n e N divide n > 0} which put a vertical line separator between the two terms.

ostbits gravatar imageostbits ( 2020-09-19 07:21:41 +0200 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2020-09-19 08:40:18 +0200

ajlittoz gravatar image

f(n) = left lline ~ stack { n/2 # ~ # 3 n + 1 } right none

I used ~ to add spaces in the formula which is 3 lines high. If you prefer 2 lines, remove # ~.

You can also write:

f(n) = left lline ~ stack { n over 2 # ~ # 3 n + 1 } right none

The "bars" are offered in the Brackets menu item and stacking in Formats.

To show the community your question has been answered, click the ✓ next to the correct answer, and "upvote" by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

edit flag offensive delete link more

Comments

1

@ostbits: Just some explaining and a bit of elaboration to show your additional options here:

  • Braces are often useful in a complex formula, to group the elements
  • Alignment modifiers can be used to adjust layout. They are alignl, alignc and alignr. You can use them on multiple group levels
  • A wide brace is often used (perhaps more in older texts) where you have the vertical bar.
  • The left and right keywords specify that "the following token is used for bracketing", and they are also modifiers that make the bracketing character stretch to cover the full heigth of the bracketed expression.

Using those, you can get this adjusted version of @ajlittoz' suggestion:

f(n) = left lbrace ~ stack {alignl {{alignc n} over {alignc 2}} # ~ # alignl{3 n + 1} } right none

keme gravatar imagekeme ( 2020-09-19 09:18:39 +0200 )edit

Did I ever say you are awesome? Thanks all Is there are reference to the "formula language"? Is the failure to show the right border in my example a bug?

ostbits gravatar imageostbits ( 2020-09-19 17:04:41 +0200 )edit

Difficult to answer (2) without a sample file.

keme gravatar imagekeme ( 2020-09-19 18:34:35 +0200 )edit

Finally got the borders working. But I'm going to use the 'formula' suggestions instead, and working is relative.

thanks

ostbits gravatar imageostbits ( 2020-09-20 01:39:37 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-09-18 21:18:29 +0200

Seen: 51 times

Last updated: Sep 19 '20