Use of Latex ( writing in array)

chijioke

Full Member
Joined
Jul 27, 2022
Messages
372
Please I need help with these. I want to have it in array.
[imath] \begin{array} a.~ 3.025^3 - \sqrt[4]{759.4} \\ b. ~\frac{118.6}{34.95} - \frac{2837}{1964} \\ c. ~\frac{2.874^3+6}{2.874^3-6} \\ d. ~2.908^3 + \sqrt[5]{248.4} \\ e. ~\sqrt[3]{130-\sqrt[3]{130}} \\ f. ~11.65 × 91.21-11.65^2 \\ g. ~\sqrt[5]{1.21^4+3.2^3} \\ \end{array} [/imath]
 
Please I need help with these. I want to have it in array.
[imath] \begin{array} a.~ 3.025^3 - \sqrt[4]{759.4} \\ b. ~\frac{118.6}{34.95} - \frac{2837}{1964} \\ c. ~\frac{2.874^3+6}{2.874^3-6} \\ d. ~2.908^3 + \sqrt[5]{248.4} \\ e. ~\sqrt[3]{130-\sqrt[3]{130}} \\ f. ~11.65 × 91.21-11.65^2 \\ g. ~\sqrt[5]{1.21^4+3.2^3} \\ \end{array} [/imath]
\begin{array}{l}
.
.
.
\end{array}

Note the change I made in bold. You need to tell it to left (center/right) justify the elements in the array cells.

-Dan
 
Yes, topsquark is correct, but at this site we need to provide alignment info (l, r or c) for each column. If you don't, then your output will render as a single list instead of an array (columns). The syntax for the array environment is shown at the link you were told about earlier (Functions Supported by katex.org). That is, when you don't understand why your LaTeX code does not render at all or as expected, the first things to do are: check documented syntax and proofread your typing. (You've been asked to do this, twice.) Checking the array syntax, we see:

ccSyntax.JPG

Proofreading your typing makes it obvious that {cc} is missing. Now, if a syntax displayed at the katex.org documentation for this forum is not clear to you, then search the Internet for keywords (eg: latex array) and look for an explanation. It took only two minutes for me to locate information you need to fix your code (starting with looking up the syntax above, followed by a simple Internet search to clarify the {cc} part).

1st Google result said:
\begin{array}{ccc}

Now each of the c's in {ccc} represents a column of the matrix and indicates that the entries of the column should be centered. If a 'c' were replaced by 'l', then the corresponding column would be typeset with all entries left-justified, and 'r' would produce a column with all entries right-justified…

Additionally, you hadn't followed prior instruction regarding the column delimiters. Don't use ~ to move to the next column; you must use & here. You may use ~ to indicate (to yourself) a blank entry in a column, but that's optional because you still need & between columns (whether a column is blank or not).

Other benefits from doing your own legwork are: learning additional options and remembering what you've learned. For example, your corrected code may render (in part) like this:

[imath] \begin{array}{ll} b. & \frac{118.6}{34.95} - \frac{2837}{1964} \\ c. & \frac{2.874^3+6}{2.874^3-6} \end{array} [/imath]

If you don't like the exponent 3 appearing also as a subscript on the number 34.95, the katex.org document (at the environment section) shows line-ending options to experiment with in those environments – like the one used to add vertical space here:

[imath] \begin{array}{ll} b. & \frac{118.6}{34.95} - \frac{2837}{1964} \\[5pt] \newline c. & \frac{2.874^3+6}{2.874^3-6} \end{array} [/imath]

There are many LaTeX resources. It is easy to find useful information on demand. Such efforts promote your brain to reinforce its memory encodings, making it more likely to remember what you've seen, versus being spoon-fed. Please, give it a try!

?
[imath]\;[/imath]
 
[imath] \begin{array}{lllllll} a.& 3.025^3 - \sqrt[4]{759.4} \\ \newline b. & \frac{118.6}{34.95} - \frac{2837}{1964} \\[5pt] \newline c. & \frac{2.874^3+6}{2.874^3-6} \\[5pt] \newline d. & 2.908^3 + \sqrt[5]{248.4} \\ \newline e. & \sqrt[3]{130-\sqrt[3]{130}} \\ \newline f. & 11.65 × 91.21-11.65^2 \\ \newline g. & \sqrt[5]{1.21^4+3.2^3} \\ \end{array} [/imath]
Thank you.
[imath] \begin{array}{ll} b. & \frac{118.6}{34.95} - \frac{2837}{1964} \\[5pt] \newline c. & \frac{2.874^3+6}{2.874^3-6} \end{array} [/imath]
But why did you choose 5pt instead of 3pt, 4pt, 6pt, 1pt or any other. Why must it be 5pt?
 
What is the difference between imath and tex [tags]?
Size and positioning, mostly.

[imath] stands for inline mode

[tex] does not center lines

Did you try experimenting at all? You can't break anything in the forum, by trying to answer your own questions.

There's more information about the various tag options in the post I'd told you about in July:

[imath]\;[/imath]
 
Top