Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to show my equations in the form (Eq. 1) instead of (1).

I am trying using \tag but this changes completely.

share|improve this question
    
Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Christian Hupfer Apr 28 at 15:34
    
How should the equation numbers appear in cross-references: as (Eq. n), or as (n)? –  Mico Apr 28 at 15:38

3 Answers 3

up vote 3 down vote accepted

use

\documentclass[a5paper]{article}
\usepackage{amsmath}
\renewcommand\theequation{Eq.~\arabic{equation}}

\begin{document}
\begin{equation}\label{eq:1}
a^2+b^2=c^2 
\end{equation}
A cross-reference to equation~(\ref{eq:1}).
\end{document}

enter image description here

share|improve this answer
    
Thanks. It works! –  user2890946 Apr 28 at 17:37
2  
Is the word "equation" in the sentence "A cross-reference to equation (Eq. 1)" maybe redundant? –  Mico Apr 28 at 17:45

You could use the \tagform@ macro of the amsmath package.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\makeatletter % make "@" a letter-type symbol
\def\tagform@#1{\maketag@@@{(Eq.~#1\unskip\@@italiccorr)}}
\makeatother
\setlength\textwidth{2.5in} % just for this example
\begin{document}
\begin{equation}\label{eq:1}
a^2+b^2=c^2 
\end{equation}
A cross-reference to equation (\ref{eq:1}).
\end{document}
share|improve this answer
    
Thanks for the help. It works! –  user2890946 Apr 28 at 17:38

You can use the mathtools package and define tagforms, i.e. the formatting of the equation tag. The \usetagform is a switch to a new formatting of the tag, and you can have several. It is better in that case to use the cleveref package for the cross-references, as the default \eqref uses the formatting of the last \usetagform that appears outside of a group, which may not be wanted:

\documentclass[12pt,a5paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{fourier}
\usepackage{mathtools}
\usepackage{cleveref}
\usepackage{xcolor}

\newtagform{Eq}[\upshape]{(\text{Eq. }}{)}
\usetagform{Eq}
\newtagform{coloured}[\color{red}{[}]{}{]}

\begin{document}
Some stuff ...

\begin{equation}\label{silly}
 a = b + c
\end{equation}
As one can see in \cref{silly}, i. e.  in \eqref{silly}…
\usetagform{coloured}
\begin{equation}
\label{oomph}
 a²  = b²  + c²
\end{equation}
 or in \cref{oomph}, i. e.  in  \eqref{oomph}

\begin{equation}
\usetagform{default}
\label{grump}
 a³   = b³   + c³ 
\end{equation}
 or in \cref{grump}, i. e.  in  \eqref{grump}

\end{document} 

enter image description here

share|improve this answer
    
Thanks for the help. It works! –  user2890946 Apr 28 at 17:37
    
I forgot to say that you can change tag form only locally, i.e. have different types of equations with different tag forms. –  Bernard Apr 28 at 17:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.