GeneralTerms beside equations

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
rasole
Posts: 14
Joined: Sat Oct 11, 2008 10:47 pm

Terms beside equations

Post by rasole »

Hi there,

I need to write the term of my equations beside the equation number, like [Hz] (Eq. 2.20).
The alignment of the equations must not be affected.
Any ideas?

Thanks

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
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Terms beside equations

Post by Juanjo »

Is this what you are searching for?

Code: Select all

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\def\tagform@#1{\maketag@@@{(\ignorespaces Eq.~#1\unskip\@@italiccorr)}}
\makeatother

\begin{document}

\begin{gather}
  a=b+c \\
  d=e+f
\end{gather}

\end{document}
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
rasole
Posts: 14
Joined: Sat Oct 11, 2008 10:47 pm

Re: Terms beside equations

Post by rasole »

Actually no, it's not the Eq.-thing but the [Hz] thing
I'll just attach an example
Attachments
help.jpg
help.jpg (4.38 KiB) Viewed 5323 times
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Terms beside equations

Post by Juanjo »

A simple hack could be

Code: Select all

\makeatletter
\def\tagform@#1{\maketag@@@{[Hz]\ (\ignorespaces Eq.~#1\unskip\@@italiccorr)}}
\makeatother
Anyway, this has side-effects if you use \eqref to cite equations. Your query is not clear enough, so perhaps there are bettter ways to proceed. Has [Hz] to appear in all equations? What is really that? By the way, which is the code you used to get the attached jpg? Why that code is not good enough?
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
rasole
Posts: 14
Joined: Sat Oct 11, 2008 10:47 pm

Re: Terms beside equations

Post by rasole »

The picture is made in MS Paint (shows what I want the final result to look like). I need help designing the code, so a can place such a term, the ['term'], after an equation, as I like.
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Terms beside equations

Post by Juanjo »

rasole wrote:The picture is made in MS Paint (shows what I want the final result to look like). I need help designing the code, so a can place such a term, the ['term'], after an equation, as I like.
OK about the picture, but you should still complete your answer. Does that term vary from equation to equation? Do you require to control it somehow?
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
rasole
Posts: 14
Joined: Sat Oct 11, 2008 10:47 pm

Terms beside equations

Post by rasole »

Yes I need to supply a different unit to every of my equations. The following code works, but makes errors, why I don't know

Code: Select all

\begin{eqnarray}
	5 &=& 2 + 3 & [unit]
\end{eqnarray}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Terms beside equations

Post by localghost »

There is an interesting document you should take a look at [1]. Seems to be written by our member daleif. A search in the forum may yield other suitable results.

[1] The PracTeX Journal - TeX Users Group | Lars Madsen: Avoid eqnarray!


Best regards
Thorsten¹
rasole
Posts: 14
Joined: Sat Oct 11, 2008 10:47 pm

Re: Terms beside equations

Post by rasole »

Sorry, I'm not that good at this yet, so if I could get some kind of example. Maybe it's something about making a 3 column table (not actually a table because of the missing equation number then).
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Terms beside equations

Post by localghost »

You can get a lot of examples by using the search function of the forum. Use the align environment provided by the amsmath package.

Code: Select all

\begin{align}
  F&=m\cdot a & \text{[Nm]}
\end{align}
Do some basic reading with lshort and l2tabu.
Post Reply