\begin{IEEEeqnarray}{rCl}
$w_{j,n}(k)$ &=& $D^j(\mathbf{x}*\mathbf{\tilde{h}_{j,n}})(k)$
\nonumber\\
&=& $(\mathbf{x}*\mathbf{\tilde{h}_{j,n}})
(2^jk)$ \nonumber \\
&=& $\sum_{l=0}^{N-1}\tilde{h}_{j,n}(l)x[(2^jk-l),\mathop{mod}
\,N]$.
\label{eqn:wpcoef}
\end{IEEEeqnarray}
I keep getting an error which says that \mathbf and \tilde are allowed
only in math mode, but then again, that's what I put the $ for. The
example on the IEEE transactions HOWTO does the same thing for getting
a \geq symbol, and their example works perfectly. What's wrong with my
code snippet?
You probably shouldn't be using $ inside IEEEeqnarray.
Ciao
Enrico
> I keep getting an error which says that \mathbf and \tilde are allowed
> only in math mode, but then again, that's what I put the $ for. The
> example on the IEEE transactions HOWTO does the same thing for getting
> a \geq symbol, and their example works perfectly. What's wrong with my
> code snippet?
I don't know, and I didn't read the IEEEtrantools documentation, but
my minimal example does work. Can you send a minimal example that
fails please?
\documentclass{minimal}
\usepackage{IEEEtrantools}
\begin{document}
\begin{IEEEeqnarray}{rCl}
X &=& A\tilde{A} \\
&=& B\,.
\end{IEEEeqnarray}
\end{document}
Regards,
Marc van Dongen
>I recently tried this code in the IEEEeqnarray environment :
>
>\begin{IEEEeqnarray}{rCl}
> $w_{j,n}(k)$ &=& $D^j(\mathbf{x}*\mathbf{\tilde{h}_{j,n}})(k)$
>\nonumber\\
> &=& $(\mathbf{x}*\mathbf{\tilde{h}_{j,n}})
>(2^jk)$ \nonumber \\
> &=& $\sum_{l=0}^{N-1}\tilde{h}_{j,n}(l)x[(2^jk-l),\mathop{mod}
>\,N]$.
> \label{eqn:wpcoef}
>\end{IEEEeqnarray}
IEEEeqnarray (like all other math display environments)
inserts $-signs at the beginning and end of all cells
of the alignment. These therefore typeset the contents
in math mode. Inserting you _own_ $-signs is a trick
to _leave_ math mode. I also get an error from your example
at "$w_", since subscripts must be in math mode.
Remove all eight $-signs and it works fine for me.
Dan
To reply by email, change LookInSig to luecking
> IEEEeqnarray (like all other math display environments)
> inserts $-signs at the beginning and end of all cells
> of the alignment.
Not for all possible column types. It has text columns as well.
However, the r, C and l column specifications of darthshak's
original example (which also works for me when the $ are removed)
are indeed all rendered in math mode. The s, t, u and x column
types are text.
Although originally inspired by the shortcomings of eqnarray,
IEEEeqnarray is pretty general. I had at one point considered
naming it IEEEhalign as it is basically a LaTeX frontend to
halign.
Cheers,
Mike Shell
>On Wed, 27 Jan 2010 11:25:54 -0600
>Dan Luecking <Look...@uark.edu> wrote:
>
>
>> IEEEeqnarray (like all other math display environments)
>> inserts $-signs at the beginning and end of all cells
>> of the alignment.
>
>
>Not for all possible column types. It has text columns as well.
>However, the r, C and l column specifications of darthshak's
>original example (which also works for me when the $ are removed)
>are indeed all rendered in math mode. The s, t, u and x column
>types are text.
Well, there _were_ no such columns (and I did say "math
display" not "text display")...
>Although originally inspired by the shortcomings of eqnarray,
>IEEEeqnarray is pretty general.
...but your reply prompted me to look up the documentation
and I must say I like what you have done, both in the
IEEEeqnarray environment itself and the very good
documentation (IEEEtran_HOWTO.pdf). Much of that document
is useful even for IEEEtran nonusers.
>I had at one point considered
>naming it IEEEhalign as it is basically a LaTeX frontend to
>halign.
Well, you don't want to confuse those who've never
heard of \halign.
> ...but your reply prompted me to look up the documentation
> and I must say I like what you have done, both in the
> IEEEeqnarray environment itself and the very good
> documentation (IEEEtran_HOWTO.pdf). Much of that document
> is useful even for IEEEtran nonusers.
It's an honor to hear something like that. :)
There is some aspect of some of my work that is "addictive"
in the sense that some users really like my atypical way of
thinking (but I'm sure some others might feel the opposite,
LOL), and when that happens they take to it like a duck to
water.
A case in point is Stefan M. Moser who did a great writeup
about formatting equations in LaTeX which featured IEEEeqnarray:
http://moser.cm.nctu.edu.tw/manuals.html#eqlatex
http://moser.cm.nctu.edu.tw/docs/typeset_equations.pdf
> Well, you don't want to confuse those who've never heard of
> \halign.
That's a good point. Makes me feel better about the "road not
taken". The main drawback with the name "IEEEeqnarray" is that
it implies that it's only for math use. That's what I started
out doing alright, but it became something much more general
along the way - tables, etc.
When I saw Knuth's explanation and examples of alignments under
TeX, it struck me as being so elegant. Such attention to detail.
And, by contrast, base LaTeX is so disappointing in this regard.
The lack of "Knuth's mark of quality", typical in most new LaTeX
users' tables, is irksome to see so often. Even Kopka's and
Daly's book (at least in my old 2nd edition copy) has some
tables whose spacing makes one less than proud.
Every LaTeX user who is doing tables should, at a bare minimum,
load Mittelbach's array.sty.
I'm really glad there are so many solutions on CTAN to these
sorts of problems. All the community contributions are the
real strength (and fun) of the TeX/LaTeX system.
Cheers,
Mike
> It's an honor to hear something like that. :)
>
> There is some aspect of some of my work that is "addictive"
> in the sense that some users really like my atypical way of
> thinking (but I'm sure some others might feel the opposite,
> LOL), and when that happens they take to it like a duck to
> water.
>
> A case in point is Stefan M. Moser who did a great writeup
> about formatting equations in LaTeX which featured IEEEeqnarray:
>
>
> http://moser.cm.nctu.edu.tw/manuals.html#eqlatex
> http://moser.cm.nctu.edu.tw/docs/typeset_equations.pdf
I am reading this document and it says using 'equation' exclusively
env for a single equation. That document uses hyperref package. And
the hyperref README states 'equation' env is not well supported and a
workaround is suggested. I doubt many people are aware of this. But
what exactly is the problem when using equation with hyperref? Thanks.
Leo
>Michael Shell <ne...@michaelshell.org> writes:
>>
>> A case in point is Stefan M. Moser who did a great writeup
>> about formatting equations in LaTeX which featured IEEEeqnarray:
>>
>>
>> http://moser.cm.nctu.edu.tw/manuals.html#eqlatex
>> http://moser.cm.nctu.edu.tw/docs/typeset_equations.pdf
>
>I am reading this document and it says using 'equation' exclusively
>env for a single equation. That document uses hyperref package. And
>the hyperref README states 'equation' env is not well supported and a
>workaround is suggested. I doubt many people are aware of this. But
>what exactly is the problem when using equation with hyperref?
Perhaps the problem is that hyperref would have to support both
the standard latex equation environment as well as the amsmath
version. Perhaps that is a difficult task and has not (yet) been
done?
> I am reading this document and it says using 'equation' exclusively
> env for a single equation. That document uses hyperref package. And
> the hyperref README states 'equation' env is not well supported and a
> workaround is suggested. I doubt many people are aware of this. But
> what exactly is the problem when using equation with hyperref? Thanks.
hyperref README contains:
| amsmath
| -------
| The environments equation and eqnarray are not supported too well.
| For example, there can be spacing problems. Consider using the
| environments that package amsmath provide, e.g. gather for equation.
| The environment equation can even redefined to use gather:
|
| \usepackage{amsmath}
| \let\equation\gather
| \let\endequation\endgather
Yours sincerely
Heiko <ober...@uni-freiburg.de>
The spacing problems of eqnarray are well known, but
amsmath provides a direct substitute, align.
The spacing probelms of latex's own equation are the same
as those of $$ because it is just a very thin wrapper around
$$.
But amsmath redefines equation. Are you saying that even this
has spacing problems that gather doesn't? If so, I'd like to
know what they are.
Anyway, I and (I believe) the OP interpret the README as
stating that hyperref doesn't support equation too well. I am
sure that is what the OP was asking about, and the above says
nothing about that.
> On Tue, 02 Feb 2010 10:05:48 +0100, Heiko Oberdiek
> <ober...@uni-freiburg.de> wrote:
>
> >hyperref README contains:
> >
> >| amsmath
> >| -------
> >| The environments equation and eqnarray are not supported too well.
> >| For example, there can be spacing problems. Consider using the
> >| environments that package amsmath provide, e.g. gather for equation.
> >| The environment equation can even redefined to use gather:
> >|
> >| \usepackage{amsmath}
> >| \let\equation\gather
> >| \let\endequation\endgather
>
> The spacing problems of eqnarray are well known, but
> amsmath provides a direct substitute, align.
>
> The spacing probelms of latex's own equation are the same
> as those of $$ because it is just a very thin wrapper around
> $$.
>
> But amsmath redefines equation. Are you saying that even this
> has spacing problems that gather doesn't? If so, I'd like to
> know what they are.
amsmath uses different code for equation and gather, thus you
are free to investigate. I don't have an example at hand and don't
have time to investigate or to check old test files or old
mailings/postings.
> Anyway, I and (I believe) the OP interpret the README as
> stating that hyperref doesn't support equation too well. I am
> sure that is what the OP was asking about, and the above says
> nothing about that.
If someone has time to provide a more elaborate and better
description/explanation, please do thus. I happily welcome
contributions that improve the documentation of hyperref.
Yours sincerely
Heiko <ober...@uni-freiburg.de>
They might want a more consistent look
\documentclass[a4paper]{article}
\usepackage{amsmath}
\begin{document}
short\rlap{\rule{0.7\textwidth}{1pt}}
\begin{equation}
\label{eq:2}
a=b
\end{equation}
short\rlap{\rule{0.7\textwidth}{1pt}}
\begin{gather}
\label{eq:3}
a=b
\end{gather}
\end{document}
--
/daleif (remove RTFSIGNATURE from email address)
LaTeX FAQ: http://www.tex.ac.uk/faq
LaTeX book: http://www.imf.au.dk/system/latex/bog/ (in Danish)
Remember to post minimal examples, see URL below
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
http://www.minimalbeispiel.de/mini-en.html
I will happily write rewrite that paragraph, but
at some point you have to tell me what it means:
- Does _hyperref_ itself have some issue with the
equation environment, or not? That is what I am
asking (and the OP too, I thought).
As near as I can tell \ref still links to \label.
TeX's distinction between \abovedisplayskip and \abovedisplayshortskip
is a design principle, not a problem. It would be correct to say that
the gather environment has spacing problems because it doesn't apply
\abovedisplayshortskip when it would be correct. So the hint in
hyperref's readme is quite misguided; redefining equation in terms of
gather makes things worse. The breqn package goes at great lengths to
simulate the behavior of the standard TeX display math (p. 4 of the
manual, listed as "high-quality spacing"). Neither LaTeX's nor
amsmath's equation environment have spacing problems, but gather has!
--
Change “LookInSig” to “tcalveu” to answer by mail.
I use hyperref and amsmath's equation in all my documents, and have
never encountered any problem caused by this combination. If there were
any problem then it'd be a hyperref bug because the equation environment
could hardly be more correct than it is now. Furthermore I've never
heard of any spacing problems of TeX's $$. $$...$$ should be avoided
because it is too low-level and does not allow shifting of the equation
number, but all this should be no problem as long as hyperref is
concerned. I think the hint in the README is just wrong as long as no
one has found a problem yet.
>> Anyway, I and (I believe) the OP interpret the README as
>> stating that hyperref doesn't support equation too well. I am
>> sure that is what the OP was asking about, and the above says
>> nothing about that.
>
> If someone has time to provide a more elaborate and better
> description/explanation, please do thus. I happily welcome
> contributions that improve the documentation of hyperref.
If no one is able to point out a real problem caused by the equation
environment, just remove that paragraph :-)
The following example does what is supposed to:
\documentclass{article}
\usepackage{amsmath}
\usepackage{hyperref}
\begin{document}
\eqref{eq:1}, \eqref{eq:2}
\clearpage
\vspace*{7cm}
\begin{equation}
\label{eq:1}
a = b
\end{equation}
\clearpage
\vspace*{3cm}
\begin{gather}
\label{eq:2}
a = b
\end{gather}
\clearpage
\null
\end{document}
> - Does _hyperref_ itself have some issue with the
> equation environment, or not? That is what I am
> asking (and the OP too, I thought).
As I had already written, I don't have the time to investigate.
All involved packages are open source, thus the investigation
can be done by others who wants to have or insist on having
proven statements.
Yours sincerely
Heiko <ober...@uni-freiburg.de>
as does the rest of the amsmath envs. I think it was a design issue. I
once saw a modified version of gather that worked as equation on the
first line, but it never made it to the wild public
>Dan Luecking <Look...@uark.edu> wrote:
>
>> - Does _hyperref_ itself have some issue with the
>> equation environment, or not? That is what I am
>> asking (and the OP too, I thought).
>
>As I had already written, I don't have the time to investigate.
>All involved packages are open source, thus the investigation
>can be done by others who wants to have or insist on having
>proven statements.
Note, I was not actually asking if you had investigated;
it would be enough to know whether there are KNOWN
problems. If not, the paragraph can be misunderstood.
Since you seem now to be saying you don't know of any
problems, I would rewrite the paragraph to remove that
impression.
Its seems, therefore, that the inconsistency of spacing
between equation eqnarray and other displays is the only
point being made. Since this seems to be completely
unrelated to compatibility with hyperref, I would either
remove the paragraph completely, or rephrase it thusly:
"There are no known incompatibilities between hyperref and
amsmath. However, as the environments equation and eqnarray
give spacing inconsistent with other display environments,
consider using the environments that package amsmath provides,
e.g. gather for equation, align for eqnarray. The environment
equation can even be redefined to use gather:
\usepackage{amsmath}
\let\equation\gather
\let\endequation\endgather"
If I have misunderstood the situation, please ignore.
> On Thu, 04 Feb 2010 09:42:38 +0100, Heiko Oberdiek
> <ober...@uni-freiburg.de> wrote:
>
> >Dan Luecking <Look...@uark.edu> wrote:
> >
> >> - Does _hyperref_ itself have some issue with the
> >> equation environment, or not? That is what I am
> >> asking (and the OP too, I thought).
> >
> >As I had already written, I don't have the time to investigate.
> >All involved packages are open source, thus the investigation
> >can be done by others who wants to have or insist on having
> >proven statements.
>
> Note, I was not actually asking if you had investigated;
> it would be enough to know whether there are KNOWN
> problems. If not, the paragraph can be misunderstood.
> [...]
Thank for your notes. I have now reformulated the paragraph
as
| The environments equation and eqnarray are not supported too well.
| For example, there might be spacing problems (eqnarray isn't recommended
| anyway, see CTAN:info/l2tabu/, the situation for equation is unclear,
| because nobody is interested in investigating). Consider using the
| environments that package amsmath provide, e.g. gather for equation.
| The environment equation can even redefined to use gather:
|
| \usepackage{amsmath}
| \let\equation\gather
| \let\endequation\endgather
Yours sincerely
Heiko <ober...@uni-freiburg.de>
> Thank for your notes. I have now reformulated the paragraph
> as
>
> | The environments equation and eqnarray are not supported too well.
> | For example, there might be spacing problems (eqnarray isn't recommended
> | anyway, see CTAN:info/l2tabu/, the situation for equation is unclear,
> | because nobody is interested in investigating). Consider using the
> | environments that package amsmath provide, e.g. gather for equation.
> | The environment equation can even redefined to use gather:
> |
> | \usepackage{amsmath}
> | \let\equation\gather
> | \let\endequation\endgather
Heiko,
Perhaps I misunderstand, but it seems that there are no known problems
with equation and hyperref. So, perhaps the whole paragraph is best
deleted. There may be spacing problems with eqnarray, but these are
not the result of hyperref, so none of this should even be mentioned
in the hyperref docs.
If you later get an actual problem report, then you can add mention of
it and/or fix the problem, but as it is, hyperref should be assumed
to be innocent until evidence beyond a reasonable doubt is presented.
Cheers,
Mike Shell
> On Wed, 10 Feb 2010 10:20:23 +0100
> Heiko Oberdiek <ober...@uni-freiburg.de> wrote:
>
> > Thank for your notes. I have now reformulated the paragraph
> > as
> >
> > | The environments equation and eqnarray are not supported too well.
> > | For example, there might be spacing problems (eqnarray isn't recommended
> > | anyway, see CTAN:info/l2tabu/, the situation for equation is unclear,
> > | because nobody is interested in investigating). Consider using the
> > | environments that package amsmath provide, e.g. gather for equation.
> > | The environment equation can even redefined to use gather:
> > |
> > | \usepackage{amsmath}
> > | \let\equation\gather
> > | \let\endequation\endgather
>
> Perhaps I misunderstand, but it seems that there are no known problems
> with equation and hyperref.
I hadn't written it for fun, thus there were something, but I don't
have time to investigate. If I would remove *all* stuff from the
documentation that might be unclear or unproven then the whole
documentation of hyperref would probably be blank.
> So, perhaps the whole paragraph is best
> deleted. There may be spacing problems with eqnarray, but these are
> not the result of hyperref, so none of this should even be mentioned
> in the hyperref docs.
eqnarray might be deprecated (I don't know the official status), but
it is present in LaTeX(2e) and using it with hyperref happens.
> If you later get an actual problem report, then you can add mention of
> it and/or fix the problem, but as it is, hyperref should be assumed
> to be innocent until evidence beyond a reasonable doubt is presented.
\documentclass{article}
\usepackage[fleqn]{amsmath}
\usepackage[pageanchor=false]{hyperref}
\textheight=0mm % to get many page breaks
\begin{document}
A\ref{eq}
\begin{equation}
X\label{eq}
\end{equation}
\end{document}
hyperref prevents a page break between A and X.
Without hyperref or using gather, then A and X are on different pages.
Yours sincerely
Heiko <ober...@uni-freiburg.de>
The manual states that \equation is redefined so that \refstepcounter
(which writes a hyperlink) is executed inside the displaymath, which
solves the problem. However, this is only done if fleqn is not set, do
you know why?
The reason for the inhibition of the page break is a \penalty 10000
right after the \pdfdest. This is caused by \Hy@RestoreLastskip, which
in turn is set by \Hy@SaveLastskip:
\def\Hy@SaveLastskip{%
\let\Hy@RestoreLastskip\relax
\ifvmode
\ifdim\lastskip=\z@
\let\Hy@RestoreLastskip\nobreak
This code introduces penalties after a lot of anchors. Any of the
following modifications solves the problem:
\long\def\equation{% no test for \if@fleqn
\mathdisplay@push
\st@rredfalse \global\@eqnswtrue
\mathdisplay{equation}%
\incr@eqnum
}
\def\Hy@SaveLastskip{% \@empty instead of \nobreak
\let\Hy@RestoreLastskip\relax
\ifvmode
\ifdim\lastskip=\z@
\let\Hy@RestoreLastskip\@empty
\else
\begingroup
\skip@=-\lastskip
\edef\x{%
\endgroup
\def\noexpand\Hy@RestoreLastskip{%
\noexpand\ifvmode
\noexpand\@empty
\vskip\the\skip@
\vskip\the\lastskip\relax
\noexpand\fi
}%
}%
\x
\fi
\else
\ifhmode
\ifdim\lastskip=\z@
\let\Hy@RestoreLastskip\@empty
\else
\begingroup
\skip@=-\lastskip
\edef\x{%
\endgroup
\def\noexpand\Hy@RestoreLastskip{%
\noexpand\ifhmode
\noexpand\@empty
\hskip\the\skip@
\hskip\the\lastskip\relax
\noexpand\fi
}%
}%
\x
\fi
\fi
\fi
}%
However, there are probably good reasons why these macros are defined as
they are currently, which I can't even speculate about.