New MembersLine up at the left-center all the variables and names

You would like to introduce yourself before starting to post? That's a nice idea and here is the forum for you...
Post Reply
Philosophaie
Posts: 17
Joined: Sat Mar 21, 2015 8:59 pm

Line up at the left-center all the variables and names

Post by Philosophaie »

Here is my LaTeX project.

I want to be able to line up at the left-center all the variables and names.

I want them centered just lined up to the left.

Code: Select all

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
\centering
\begin{gather*}
\text{Keplerian Elements for each Planet with a Julian Century multiplier:}\\
\\
\text{a = Semi-Major Axis}\\
\text{e = Eccentricity}\\
\text{i = Inclination to the Ecliptic}\\
\text{N = Longitude of the Ascending Node}\\
\text{w = Argument of the Perihelion}\\
\text{LP = Longitude of the Perihelion}\\
\text{ML = Mean Longitude}\\
\\
\end{gather*}
\end{document}
like this:

Code: Select all

     a = Semi-Major Axis
     e = Eccentricity
     i = Inclination to the Ecliptic
     N = Longitude of the Ascending Node
     w = Argument of the Perihelion
     LP = Longitude of the Perihelion
     ML = Mean Longitude
not:

Code: Select all

          a = Semi-Major Axis
           e = Eccentricity
     i = Inclination to the Ecliptic
   N = Longitude of the Ascending Node
     w = Argument of the Perihelion
    LP = Longitude of the Perihelion
         ML = Mean Longitude

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Line up at the left-center all the variables and names

Post by Stefan Kottwitz »

Here is a good way:

Code: Select all

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
\begin{center}
  Keplerian Elements for each Planet with a Julian Century multiplier
\end{center}
\begin{align*}
  a  &= \text{Semi-Major Axis}\\
  e  &= \text{Eccentricity}\\
  i  &= \text{Inclination to the Ecliptic}\\
  N  &= \text{Longitude of the Ascending Node}\\
  w  &= \text{Argument of the Perihelion}\\
  LP &= \text{Longitude of the Perihelion}\\
  ML &= \text{Mean Longitude}
\end{align*}
\end{document}
Explanation:
  • For normal text at the beginning, I used a center environment. Still in text mode.
  • For the equations, I need an environment, which
    • works with math mode,
    • can work with multiple lines,
    • can align at relation symbols, that is, the equal sign,
    • and can be centered.
    The align* environment does all of this. The * means that this will not be numbered line by line. By the way, the & marks the place where the equations will be aligned at.
Stefan
LaTeX.org admin
Post Reply