LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-22-2022, 03:05 PM   #1
Faki
Member
 
Registered: Oct 2021
Posts: 574

Rep: Reputation: Disabled
align equations with latex


I want to align equations and called `flalign`.

This gets me

Code:
 : LaTeX Error: Environment flalign undefined.
What else can I try for aligning equations. Here is the implementation that failed.

Code:
\begin{equation}
\begin{flalign*}
  f(u) & =\sum_{j=1}^{n} x_jf(u_j)&\\
       & =\sum_{j=1}^{n} x_j \sum_{i=1}^{m} a_{ij}v_i&\\
       & =\sum_{j=1}^{n} \sum_{i=1}^{m} a_{ij}x_jv_i
\end{flalign}
\end{equation}

Last edited by Faki; 04-22-2022 at 04:00 PM.
 
Old 04-22-2022, 03:11 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,795

Rep: Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002
Quote:
Originally Posted by Faki View Post
I want to align equations and called `flalign`.
This gets me
Code:
 : LaTeX Error: Environment flalign undefined.
What else can I try for aligning equations. Here is the implementation that failed.
Code:
\begin{flalign*}
  f(u) & =\sum_{j=1}^{n} x_jf(u_j)&\\
       & =\sum_{j=1}^{n} x_j \sum_{i=1}^{m} a_{ij}v_i&\\
       & =\sum_{j=1}^{n} \sum_{i=1}^{m} a_{ij}x_jv_i
\end{flalign}
Related to this, presumably??
https://www.linuxquestions.org/quest...es-4175711028/

Again, may want to look up the error(s), and read the docs:
https://www.overleaf.com/learn/latex..._XXX_undefined
 
Old 04-22-2022, 03:54 PM   #3
Faki
Member
 
Registered: Oct 2021
Posts: 574

Original Poster
Rep: Reputation: Disabled
I want to align without using amsmath. The other question you mention was about texinfo which only accepts tex syntax rather than latex.

Last edited by Faki; 04-22-2022 at 03:56 PM.
 
Old 04-22-2022, 04:01 PM   #4
Faki
Member
 
Registered: Oct 2021
Posts: 574

Original Poster
Rep: Reputation: Disabled
Have also tried align and split. That also failed.
 
Old 04-22-2022, 04:35 PM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,795

Rep: Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002
Quote:
Originally Posted by Faki View Post
I want to align without using amsmath. The other question you mention was about texinfo which only accepts tex syntax rather than latex.
...and...
Quote:
Originally Posted by Faki
Have also tried align and split. That also failed.
As with your other thread, you provide no details. Saying "also failed" says nothing, and you don't say WHY you don't want to use amsmath either, what version/distros of things you're using, etc.

Again: you were given a link to the documentation, along with a specific link to your exact error. Did you read/follow it??
 
Old 04-22-2022, 04:42 PM   #6
Faki
Member
 
Registered: Oct 2021
Posts: 574

Original Poster
Rep: Reputation: Disabled
I am using Ubuntu 18.04 LTS. And TeX 3.14159265 (TeX Live 2017/Debian).

When using multiline, align, aligned, flalign, I get

Code:
: LaTeX Error: Environment undefined.
Is there no built-in equation alignment in latex? Many things I have read from documentation always relates to amsmath, rather that built-in features in latex.

Last edited by Faki; 04-22-2022 at 04:51 PM.
 
Old 04-22-2022, 08:40 PM   #7
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by Faki View Post
When using multiline, align, aligned, flalign, I get

Code:
: LaTeX Error: Environment undefined.
This really tells us nothing. What is the command structure used (code) for each of those, and exactly what are the messages.
Each of those functions has its own syntax for calling and returning and you have to satisfy the syntax when calling them, as well as the environment.

I don't use Tex, LaTex, etc but coding experience tells me you are not using the proper structure of environment and code for that error to pop up.
 
1 members found this post helpful.
Old 04-22-2022, 11:19 PM   #8
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,818

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by Faki View Post
I want to align equations and called `flalign`.

This gets me

Code:
 : LaTeX Error: Environment flalign undefined.
What else can I try for aligning equations. Here is the implementation that failed.

Code:
\begin{equation}
\begin{flalign*}
  f(u) & =\sum_{j=1}^{n} x_jf(u_j)&\\
       & =\sum_{j=1}^{n} x_j \sum_{i=1}^{m} a_{ij}v_i&\\
       & =\sum_{j=1}^{n} \sum_{i=1}^{m} a_{ij}x_jv_i
\end{flalign}
\end{equation}
I got it to work but:
  1. Comment out the "equation" environment. When I have that uncommented, I get an error message squawking about nested equation environments. The equations, as written, don't seem to want to work in the "equation" environment, anyway, so I'd simply stick with "flalign/flalign*".
  2. The "flalign" error has to do with you beginning an "flalign*" environment but ending it with "flalign" instead of "flalign*". ("flalign" is a prefect acceptable environment but you can't mix 'em in the same set of equations.)
  3. I thought that those ampersands before the double backslashes might be a problem. Looks like is affects the indentation of the equations. Works without it as well (but indented from the left margin a bit). Use them or lose them; your call on style. (Hey! I learned something today!)

(Love seeing people using LaTeX.)

HTH...
 
Old 04-23-2022, 09:11 AM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,795

Rep: Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002
Quote:
Originally Posted by Faki View Post
I am using Ubuntu 18.04 LTS. And TeX 3.14159265 (TeX Live 2017/Debian). When using multiline, align, aligned, flalign, I get
Code:
: LaTeX Error: Environment undefined.
Is there no built-in equation alignment in latex? Many things I have read from documentation always relates to amsmath, rather that built-in features in latex.
Again, *WHY* don't you want to use amsmath?? What is the problem in using it??

And you were given a link to latex docs, which deal with the error, tell you what causes it, and how to fix it. While it does mention amsmath, it is as an EXAMPLE...in your case, replace it with what you ARE missing and/or how it's written.
 
Old 04-23-2022, 10:14 AM   #10
Faki
Member
 
Registered: Oct 2021
Posts: 574

Original Poster
Rep: Reputation: Disabled
Have found that AMS-LaTeX is included as part of the LaTeX collection, and one does not have to download or install it separately. So it is now ok to use it. Thank you so very much. Noticed that the problem was with &\\, which needs to be replaced with \cr
 
  


Reply

Tags
align, latex



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LaTeX forum / Where to ask LaTeX questions? max_sipos Linux - Software 2 12-21-2011 12:01 PM
plotting difference equations which are dependent on linear equations ta0kira Programming 6 11-22-2008 10:08 PM
Align LaTeX correctly edgjerp Linux - Software 2 10-23-2007 08:03 AM
About LaTeX and fonts in LaTeX g4j31a5 Linux - Software 4 09-19-2006 07:36 AM
LaTeX commands: texi2pdf, latex, dvipdf kaon Linux - Software 7 01-23-2005 03:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration