I need a LaTeX workaround for the array function

  • Context: LaTeX 
  • Thread starter Thread starter benorin
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around finding a workaround for the LaTeX array function in the context of writing an Insight article. Participants share their experiences and suggestions regarding LaTeX formatting, specifically focusing on alignment issues and alternative methods for displaying mathematical expressions.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Meta-discussion

Main Points Raised

  • One participant, Ben, expresses difficulty with the TeX interpreter not processing the array function, leading to misalignment in his article. He seeks a perfect solution for aligning long chains of equalities.
  • Another participant references a solution found on TeX Stack Exchange regarding alignment issues with cases or arrays.
  • Several participants suggest using different LaTeX environments, such as align* and eqnarray*, to achieve better formatting results.
  • Ben mentions using MS Office 365 and MathType for initial typesetting and questions which libraries would be suitable for exporting to the Insights blog editor.
  • A participant notes that manual carriage returns lead to unformatted output, suggesting that users should type everything in a row to allow the system to handle formatting.
  • There is a discussion about the differences in how MathJax is interpreted in the forum versus the Insights blog editor, with some uncertainty about the cause of any discrepancies.

Areas of Agreement / Disagreement

Participants generally agree that the array function does not work as intended in the Insights editor and that alternative LaTeX environments can be used. However, there remains some uncertainty about the best practices for formatting and the specific behavior of the Insights editor compared to the forum.

Contextual Notes

Some limitations include the potential differences in LaTeX interpretation between the forum and the Insights blog editor, as well as unresolved questions about the best libraries for exporting LaTeX from other software.

benorin
Science Advisor
Insights Author
Messages
1,442
Reaction score
191
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
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:
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.
 
@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).
 
@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
 
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   Reactions: Greg Bernhardt

Similar threads

  • · Replies 23 ·
Replies
23
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 2 ·
Replies
2
Views
10K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K