Math & ScienceEquation tag/label

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
ankhi
Posts: 32
Joined: Sun Aug 26, 2012 6:07 pm

Equation tag/label

Post by ankhi »

Hi I was trying to give 2' and 5a' as my equation number but couldnt figure out how to do it. So I thought \tag in equation* env will help but latex says that env is not defined.

Also whenever I am putting \usepackage{amsmath} in the preamble I am getting the following

Code: Select all

("C:\Program Files\MiKTeX 2.9\tex\latex\ams\math\amsopn.sty")

! LaTeX Error: Command \iint already defined.
               Or name \end... illegal, see p.192 of the manual.
Please help. I am new in this as I started latex only 5 days ago. I am running protex in windows.
Last edited by cgnieder on Sun Aug 26, 2012 6:19 pm, edited 1 time in total.

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Equation tag/label

Post by cgnieder »

This is probably new for you as well but it would be important: can you provide us with a Infominimal working example?

The following small example uses amsmath's subequations environment. For more information on it and on typesetting math in general I recommend reading mathmode.

Code: Select all

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation*}
 a = b
\end{equation*}

\begin{equation}
 c = d
\end{equation}

\begin{subequations}
 \begin{align}
  e &= f \\
  g &= h
 \end{align}
\end{subequations}

\end{document}
subequations.png
subequations.png (4.66 KiB) Viewed 8863 times
Regards
site moderator & package author
ankhi
Posts: 32
Joined: Sun Aug 26, 2012 6:07 pm

Equation tag/label

Post by ankhi »

Well this is my preamble.

Code: Select all

\pagestyle{fancy} % options: empty , plain , fancy
\renewcommand{\headrulewidth}{0pt} % customise the layout...
\lhead{}\chead{}\rhead{}
\lfoot{}\cfoot{\thepage}\rfoot{}

%%% SECTION TITLE APPEARANCE
\usepackage{sectsty}
\allsectionsfont{\sffamily\mdseries\upshape} % (See the fntguide.pdf for font help)
% (This matches ConTeXt defaults)

%%% ToC (table of contents) APPEARANCE
\usepackage[nottoc,notlof,notlot]{tocbibind} % Put the bibliography in the ToC
\usepackage[titles,subfigure]{tocloft} % Alter the style of the Table of Contents
\usepackage{wasysym}
\renewcommand{\cftsecfont}{\rmfamily\mdseries\upshape}
\renewcommand{\cftsecpagefont}{\rmfamily\mdseries\upshape} % No bold!
\newcommand{\superscript}[1]{\ensuremath{^{\textrm{#1}}}}
\newcommand{\subscript}[1]{\ensuremath{_{\textrm{#1}}}}
\newcommand{\del}[1]{\ensuremath{\delta}}
\newcommand{\lrarw}[1]{\ensuremath{\longrightarrow}}

%bibliography
\usepackage[square,numbers]{natbib}

%Maths

%\usepackage{amsmath, amsthm, amssymb}

%graphics-Figures and tables
\usepackage{graphicx}
%%% END Article customizations

%%% The "real" document content comes below...

\title{....}
\author{.....}
\date{} % Activate to display a given date or no date (if empty),
         % otherwise the current date is printed 

\begin{document}
I just took the article temple and modified. but as you can see when ever I am putting the amsmath package I am getting the above error. I read that link you gave already. but how to do it if I can't have amsmath??? :(
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Equation tag/label

Post by cgnieder »

This looks as if you didn't start with the easiest type of document. Do you use a template that you downloaded from somewhere?

Anyway, please take the time and read the information about how to create a Infominimal working example and try to create a real one. (It starts with \documentclass and ends with \end{document}, is as short as possible but recreates the error). Without it it will be hard if not impossible to help. (For instance, if I copy the code you provided and make it into a complete document it runs fine with amsmath!)

Regards
site moderator & package author
ankhi
Posts: 32
Joined: Sun Aug 26, 2012 6:07 pm

Re: Equation tag/label

Post by ankhi »

ok that sounds strange.... :o

ok can you suggest a template for a scientific article with lots of maths, figures and table with references as that is about what I need....

I am a pro in word so kinda feeling like running back. :?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10359
Joined: Mon Mar 10, 2008 9:44 pm

Re: Equation tag/label

Post by Stefan Kottwitz »

Do you write for a specific journal? They often provide a template or even require to use theirs. Otherwise, even if you use a template, check what you need of it. Remove or comment out packages you don't need. Here, for example, you've got a package conflict, since amsmath and another package (for example txfonts) define a symbol with the same name.

Stefan
LaTeX.org admin
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Equation tag/label

Post by cgnieder »

There are sites that provide templates but I can't tell you how good they are.

I would strongly recommend trying to build a Infominimal working example! You need to be able to do that anyway, so you can start as well with the document you have. You could begin by creating a new document where you copy your whole document into. Then you start deleting everything until the error disappears. The last thing you deleted will then tell you what created the error.

Regards
site moderator & package author
ankhi
Posts: 32
Joined: Sun Aug 26, 2012 6:07 pm

Re: Equation tag/label

Post by ankhi »

doing the minimum working example thing right now guys... donno where I am.... :?
ankhi
Posts: 32
Joined: Sun Aug 26, 2012 6:07 pm

Equation tag/label

Post by ankhi »

ok I started from scratch again and put the modifications 1 by 1. So amsmath is working now (no clue why!!)

and I am getting this error

! Argument of \frac has an extra }.
<inserted text>
\par
l.107 ...1 m_2)\frac(m_1+m_2 )}\bigg)^{-1\frac{2}}
}

when I add this part only:

Code: Select all

\begin{equation}
D_{12} \propto {\bigg({(m_1 m_2)\frac(m_1+m_2 )}\bigg)^{-1\frac{2}}}
\end{equation}
without this is working... :?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10359
Joined: Mon Mar 10, 2008 9:44 pm

Re: Equation tag/label

Post by Stefan Kottwitz »

It's good to know about the importance of such a code example - if one posts a complete small example with the problem, which can be tested, the problem is usually quickly solved here in the forum. You could hack down a copy of your code, reducing it step by step, removing unrelated code and text.

You will see, with LaTeX it's different to working with Word: for any problem, you could tell us code, and you very probably can get one or more lines of code which fix it. No vague GUI explanations and not reproducable formatting issues.

Stefan
LaTeX.org admin
Post Reply