Math & ScienceFormular with unit to the right?

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
halfling
Posts: 5
Joined: Sat Mar 28, 2009 5:43 pm

Formular with unit to the right?

Post by halfling »

Hey

I'm needing help to find an easy way to wright this?

Image

Is there any simple code instead of this code.

Code: Select all

\begin{minipage}[H]{0.9\linewidth}
 \centering
\begin{eqnarray}
\nonumber
\mathscr{R}_1 & \ll & \mathscr{R}_4 \\
\nonumber
&\Updownarrow & \\
\nonumber
\frac{l_1}{\mu_0\cdot\mu_r\cdot A_1} &\ll& \frac{l_4}{\mu_0\cdot\mu_r\cdot A_4} \label{eq:reluctant}
\end{eqnarray}
\end{minipage}
\begin{minipage}[H]{0.1\linewidth}
 \flushright
\begin{eqnarray}
\nonumber
 \left[\Omega\right] \nonumber\\
\nonumber\\
\left[\Omega\right] 
\end{eqnarray}
\end{minipage}
hope some one can help
and thanks
Editor: Kile
OS: openSUSE 11.1 KDE 4.1

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Formular with unit to the right?

Post by localghost »

There is a much simpler way to do that, respectively two.

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{kpfonts}
\usepackage{amsmath}
\usepackage{mathtools}

\parindent0em

% Setup for other tag formats (mathtools)
\newtagform{brackets}{[}{]}

\begin{document}
  \usetagform{brackets}
  \begin{align}
    \mathscr{R}_1 &\ll\mathscr{R}_4 \tag{$\Omega$}\\
    &\;\Updownarrow \nonumber \\
    \frac{l_1}{\mu_0\cdot\mu_r\cdot A_1} &\ll\frac{l_4}{\mu_0\cdot\mu_r\cdot A_4}\tag{$\Omega$}\label{eqn:reluctant}
  \end{align}
  \usetagform{default}
  \begin{align}
    \mathscr{R}_1 &\ll\mathscr{R}_4 &\left[\Omega\right] \\
    &\;\Updownarrow \nonumber \\
    \frac{l_1}{\mu_0\cdot\mu_r\cdot A_1} &\ll\frac{l_4}{\mu_0\cdot\mu_r\cdot A_4}&\left[\Omega\right]\label{eqn:reluctant}
  \end{align}
\end{document}
For more information about such modifications to math expressions refer to the manual of amsmath and mathtools (from the mh bundle). Useful stuff is available with the "Math mode" document.


Best regards and welcome to the board
Thorsten¹
halfling
Posts: 5
Joined: Sat Mar 28, 2009 5:43 pm

Re: Formular with unit to the right?

Post by halfling »

Thanks for the reply but it was not what i was looking for it is not the reference of the equation that i wanted to replaces.

But some thing like this:
EQUATION [UNIT] (REF NR)
A+B = C [A] (1.1)

I know it looks like it on the picture
Me fault that I can't wright the right question!

Thanks for the links it will make the use of amsmath easier.
Editor: Kile
OS: openSUSE 11.1 KDE 4.1
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Formular with unit to the right?

Post by localghost »

Take a careful look at the second align environment in the code above. It's exactly what you want. I was not sure what you wanted to have. That's why I introduced two possible solutions. Here's a reduced example.

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{kpfonts}
\usepackage{amsmath}

\parindent0em

\begin{document}
  \begin{align}
    \mathscr{R}_1 &\ll\mathscr{R}_4 &\left[\Omega\right] \\
    &\;\Updownarrow \nonumber \\
    \frac{l_1}{\mu_0\cdot\mu_r\cdot A_1} &\ll\frac{l_4}{\mu_0\cdot\mu_r\cdot A_4}&\left[\Omega\right]\label{eqn:reluctant}
  \end{align}
\end{document}
halfling
Posts: 5
Joined: Sat Mar 28, 2009 5:43 pm

Formular with unit to the right?

Post by halfling »

I need to have the unit and equation ref as far right as possible on the page
while the equation is center on the page

with the align default option the equation is to the left and the unit is centered between the equation and equation ref

I want

Code: Select all

							EQUATION									[unit] (ref)
align default is

Code: Select all


							EQUATION						[unit] 					(ref)
Hope this helps on what I mean
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Formular with unit to the right?

Post by gmedina »

Hi halfling,

try adding some horizontal space to the code provided by localghost:

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[mathscr]{eucal}
\usepackage{amsmath}

\begin{document}

\begin{align}
  \hspace{3.6cm}\mathscr{R}_1 &\ll\mathscr{R}_4 &\hspace{4.3cm}\left[\Omega\right] \\
  &\;\Updownarrow \nonumber \\
  \frac{l_1}{\mu_0\cdot\mu_r\cdot A_1} &\ll\frac{l_4}{\mu_0\cdot\mu_r\cdot A_4}&\left[\Omega\right]\label{eqn:reluctant}
\end{align}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
halfling
Posts: 5
Joined: Sat Mar 28, 2009 5:43 pm

Re: Formular with unit to the right?

Post by halfling »

It cut work, but the problem I see by using, this method is that I have to guess how long the horizontal space must be depending on the length of the equation.

But thanks for the suggestion.
Editor: Kile
OS: openSUSE 11.1 KDE 4.1
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Formular with unit to the right?

Post by gmedina »

Then use flalign instead of align:

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[mathscr]{eucal}
\usepackage{amsmath}

\begin{document}

\begin{flalign}
  &&\mathscr{R}_1 &\ll\mathscr{R}_4 &&\left[\Omega\right] \\
  &&&\;\Updownarrow \nonumber \\
  &&\frac{l_1}{\mu_0\cdot\mu_r\cdot A_1} &\ll\frac{l_4}{\mu_0\cdot\mu_r\cdot A_4}&&\left[\Omega\right]\label{eqn:reluctant}
\end{flalign}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
halfling
Posts: 5
Joined: Sat Mar 28, 2009 5:43 pm

Re: Formular with unit to the right?

Post by halfling »

Thanks for all the help

The last replay was what I looked for

So my problem is solved

Thanks again
Editor: Kile
OS: openSUSE 11.1 KDE 4.1
Post Reply