I need a LaTeX workaround for the array function

  • LaTeX
  • Thread starter benorin
  • Start date
In summary, the conversation discusses the issue of the TeX interpreter not processing the array function for an Insight article. The conversation goes on to suggest using different environments and libraries for exporting the paper and provides a solution for getting eqnarray* to work in the Insights editor. The conclusion is that the Insights blog editor uses the same MathJax as the forum, but there may be some formatting differences.
  • #1
benorin
Homework Helper
Insights Author
1,435
186
I'm currently writing an Insight article and the TeX interpreter for this doesn't process the array function, it just dumps code for it whenever it appears. I make extensive use of the array function in the paper I'm converting to be an Insight. Is there a workaround you know of for this? I was mostly using array to align my long chains of equalities but for the moment I've just replaced the array with dbl $ code tags and it is functional but the alignment is off still, (they don't line up at the '=' sign). For matrices and binomial coefficients I have just done component form and alternate notation. I'm ok with how it displays but I want it to be perfect. Thanks for your time,
-Ben
 
Physics news on Phys.org
  • #3
Thank you
 
  • #5
I usually use:
Code:
\begin{eqnarray*}
F & = & ma \\
& = & \frac{GMm}{r^2}
\end{eqnarray*}
Looks like this:$$\begin{eqnarray*} F & = & ma \\ & = & \frac{GMm}{r^2} \end{eqnarray*} $$

Today I learned that you apparently don't need the dollar signs around a LaTeX environment like eqnarray* - it gets interpreted anyway. Hence the CODE tags...
 
Last edited:
  • #6
benorin said:
I'm currently writing an Insight article and the TeX interpreter for this doesn't process the array function, it just dumps code for it whenever it appears. I make extensive use of the array function in the paper I'm converting to be an Insight. Is there a workaround you know of for this? I was mostly using array to align my long chains of equalities but for the moment I've just replaced the array with dbl $ code tags and it is functional but the alignment is off still, (they don't line up at the '=' sign). For matrices and binomial coefficients I have just done component form and alternate notation. I'm ok with how it displays but I want it to be perfect. Thanks for your time,
-Ben
It's better to use the environments of amsmath. AFAIK they all work in the forums and the Insights.
 
  • #7
@vanhees71 I originally wrote the paper using MS Office 365 > Word and MathType (which is a handy GUI interface for math typesetting with assignable hot-keys for your favorite symbols or macros or expressions, etc) and I can export LaTeX, but I did so using the MathJax library because I assumed the Insights blog editor would naturally use the same MathJax that this forum uses. But evidently I was wrong. I know how to typeset for forums, at least enough to cover most calculus needs but LaTeX is not something I'm well-versed in. There be other libraries I can use to export my paper, which of those would be the correct one for Insights blog editor? (I can't list them all, too many).
 
  • #8
@Ibix forgive my cluelessness please, but I must ask how exactly do I get this eqnarray* to work in the Insights editor? I've tried a variety of ways and they result in not what is shown here
 
  • #9
Input:

1584092990055.png


Output:

1584093011109.png

Conclusion:


1.) A manual carriage return leads to an unformatted / not interpreted output. So they must be avoided. Just type everything in a row and let the system perform the carriage returns.

2.) eqnarray* and align* lead to the same output. The first should be used for multiple tabulators per line, the second is sufficient for equations as in the example.
 
  • #10
benorin said:
I assumed the Insights blog editor would naturally use the same MathJax that this forum uses. But evidently I was wrong.
It is the same, perhaps wordpress does something a little funny to mess with MathJax a little, I don't know
 
  • #11
I got it now. Thank you all who replied. It was the carriage return thing.
 
  • Like
Likes Greg Bernhardt

1. What is the array function in LaTeX?

The array function in LaTeX is used to create tables and matrices with specified columns and rows. It is commonly used in mathematical and scientific writing to organize data in a structured format.

2. Why might I need a workaround for the array function?

There may be instances where the array function does not meet the specific formatting needs of a document. In these cases, a workaround may be necessary to achieve the desired result.

3. What is a workaround for the array function in LaTeX?

A workaround for the array function in LaTeX could involve using alternative table or matrix environments, such as tabular or matrix, or using additional packages that offer more customizable options.

4. Are there any limitations to using a workaround for the array function?

Yes, there may be limitations depending on the chosen workaround. Some may require additional coding or may not be compatible with certain document classes. It is important to thoroughly test the workaround before using it in a final document.

5. Can you provide an example of a LaTeX workaround for the array function?

One example of a LaTeX workaround for the array function is using the tabular environment with the \hline command to create horizontal lines between rows in a table. This can give the appearance of an array, but with more customizable options for column widths and alignment.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
23
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
9K
  • Programming and Computer Science
Replies
4
Views
750
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
280
  • Programming and Computer Science
Replies
20
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
Back
Top