I am interested in changing the way -the POSITION, in fact, where
LaTeX shows the equation labels and the captions for the figures,
tables and so on.
FIRST, I want equation labels to appear in the margin area (the area
set for marginal notes, different from the normal or principal text
area).
SECOND, I would like also captions for figures to appear at that
margin.
An example of the final appearance I want to get can be seen at this
two files. Please check them if you want to understand what I mean:
http://personales.upv.es/~vigibos/objective1.zip --> For equation
labels
http://personales.upv.es/~vigibos/objective2.zip --> For figure
captions
Thank you in advance for your answers!
--
Vicent Giner
> FIRST, I want equation labels to appear in the margin area (the area
> set for marginal notes, different from the normal or principal text
> area).
amsmath:
\renewcommand\maketag@@@[1]{\rlap{\ \m@th\normalfont#1}}
regular:
\renewcommand\@eqnnum{\rlap{\ \normalfont \normalcolor (\theequation)}}
(with appropriate \makeatletter)
> SECOND, I would like also captions for figures to appear at that
> margin.
\usepackage{sidecap}
--
Donald Arseneau as...@triumf.ca
>
> amsmath:
>
> \renewcommand\maketag@@@[1]{\rlap{\ \m@th\normalfont#1}}
>
> (with appropriate \makeatletter)
>
Donald,
Thank you for your suggestion. I tried it, but I get some annoying
unexpected effects, as you can see at this sample page (please, check
it):
http://personales.upv.es/~vigibos/ThisIsWhatIGet.pdf
The problem is I do not understand perfectly the way "\rlap{\
\m@th\normalfont#1}" works, so I can't figure out how can I fix /
improve your suggestion.
I mean, I need:
- equation labels to observe the distance between the text and the
margin area, which is saved at \marginparsep,
- equation labels to be vertically centered with the equation, as usual
(now they are vertically aligned with the bottom line, more or less).
- equation references within the text not to be modified (now, they are
shown in a wrong way: the rest of the text is written over them).
I think there should be a package or a simple command for this...
> Donald Arseneau wrote:
>
>>
>> amsmath:
>>
>> \renewcommand\maketag@@@[1]{\rlap{\ \m@th\normalfont#1}}
>>
>
> The problem is I do not understand perfectly the way "\rlap{\
> \m@th\normalfont#1}" works, so I can't figure out how can I fix /
> improve your suggestion.
\rlap creates a zero width box and if something uses the primitive \eqno
(as equation does) and the material has zero width it is placed on a line
of its own. That is one of the effects you see. The other is that \eqref
also uses \maketag@@@ deep down causing it to ove-rlap with the
surrounding text.
> I mean, I need:
>
> - equation labels to observe the distance between the text and the
> margin area, which is saved at \marginparsep,
>
> - equation labels to be vertically centered with the equation, as usual
> (now they are vertically aligned with the bottom line, more or less).
>
> - equation references within the text not to be modified (now, they are
> shown in a wrong way: the rest of the text is written over them).
>
> I think there should be a package or a simple command for this...
Here's a somewhat crude solution.
% try with and without twoside.
\documentclass[twoside]{article}
\usepackage{amsmath}
\makeatletter
%%% page check for even/odd
% Stolen from komascript.
\def\mh@newevenodd@label@nn#1#2{%
\expandafter\gdef\csname mh@evenodd@#1\endcsname{#2}%
}
\def\mh@getevenodd@n #1{%
\@ifundefined{mh@evenodd@#1}{\value{page}}%
{\@nameuse{mh@evenodd@#1}}}
\def\mh@evenodd{0}
\DeclareRobustCommand\IfOddPageTF{%
\begingroup
\@tempcnta=\mh@evenodd\relax
\advance\@tempcnta by\@ne
\xdef\mh@evenodd{\the\@tempcnta}%
\@bsphack
\protected@write\@auxout{}{%
\string\mh@newevenodd@label@nn{\mh@evenodd}{\noexpand\the\value{page}}}%
\@esphack
\count@\mh@getevenodd@n{\mh@evenodd}\relax
\expandafter\endgroup
\ifodd\count@
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
}
%%%
% recall the boxes can't be 0pt, otherwise TeX might put it on a
% separate line so we make them almost 0pt.
\def\mh@print@in@outer@margin#1{%
\if@twoside
\IfOddPageTF
{\makebox[1sp][l]{\hspace{\tagmarginsep}#1}}%
{\makebox[1sp][r]{#1\hspace{\textwidth}\hspace{\tagmarginsep}}}%
\else
{\makebox[1sp][l]{\hspace{\tagmarginsep}#1}}%
\fi
}
\newlength\tagmarginsep
\setlength\tagmarginsep{\marginparsep}
\def\print@eqnum{\mh@print@in@outer@margin{\tagform@\theequation}}
\def\make@df@tag@@#1{%
\gdef\df@tag{\mh@print@in@outer@margin
{\maketag@@@{#1}\def\@currentlabel{#1}}}}
\def\make@df@tag@@@#1{%
\gdef\df@tag{%
\mh@print@in@outer@margin{\tagform@{#1}}%
\toks@\@xp{\p@equation{#1}}%
\edef\@currentlabel{\the\toks@}%
}%
}
\def\endmathdisplay@a{%
\if@eqnsw
\gdef\df@tag{%
\mh@print@in@outer@margin{\tagform@\theequation}%
}%
\fi
\if@fleqn \@xp\endmathdisplay@fleqn
\else \ifx\df@tag\@empty \else \veqno \alt@tag \df@tag \fi
\ifx\df@label\@empty \else \@xp\ltx@label\@xp{\df@label}\fi
\fi
\ifnum\dspbrk@lvl>\m@ne
\postdisplaypenalty -\@getpen\dspbrk@lvl
\global\dspbrk@lvl\m@ne
\fi
}
\makeatother
\begin{document}
\input{tufte}
\begin{equation}
a= b
\end{equation}
\begin{equation*}
a= b \tag{TAG}
\end{equation*}
\begin{gather}
a=b
\end{gather}
\begin{gather*}
a=b \tag{ffF}
\end{gather*}
\begin{align}
a&=b
\end{align}
\begin{align*}
a&=b \tag*{dd}
\end{align*}
\begin{multline}
First \\ Second \\ Third
\end{multline}
\newpage
\input{tufte}
\begin{equation}
a= b
\end{equation}
\begin{equation*}
a= b \tag{TAG}
\end{equation*}
\begin{gather}
a=b
\end{gather}
\begin{gather*}
a=b \tag{ffF}
\end{gather*}
\begin{align}
a&=b
\end{align}
\begin{align*}
a&=b \tag*{dd}
\end{align*}
\begin{multline}
First \\ Second \\ Third
\end{multline}
\end{document}
--
Morten
> Donald Arseneau wrote:
> > \renewcommand\maketag@@@[1]{\rlap{\ \m@th\normalfont#1}}
> unexpected effects, as you can see at this sample page (please, check
> it):
>
> http://personales.upv.es/~vigibos/ThisIsWhatIGet.pdf
> The problem is I do not understand perfectly the way "\rlap{\
> \m@th\normalfont#1}" works,
\rlap is essentially an abbreviation for \makebox[l]{0pt}. The rest is
copied from the original definition of \maketag@@@.
> I mean, I need:
>
> - equation labels to observe the distance between the text and the
> margin area, which is saved at \marginparsep,
Replace the single space "\ " with "\hspace{\marginparsep}"
> - equation labels to be vertically centered with the equation, as usual
I had forgotten the special handling of zero-width equation numbers.
So give some width by putting a thin space (\,) before \rlap.
> - equation references within the text not to be modified (now, they are
> shown in a wrong way: the rest of the text is written over them).
Arggh! I avoided recommending \tagform@ because it is bypassed by
a \tag command. But I didn't notice that \eqref invokes it too
(whether "it" is \tagform@ or \maketag@@@). I think the best
solution is to redefine \eqref.
Follow Morten's advice.
--
Donald Arseneau as...@triumf.ca
Thank you for your great suggestion. I didn't mean you to work for me!!
:-S
Anyway, I have no idea of LaTeX macros/programming, so, when I've tried
your solution, I get an error like this:
" Missing $ inserted "
just on the very first "\end{equation}" line.
What can the reason for that?
Thank you in advance.
--
Vicent
Can you provide an example? The example file I posted did work, right?
--
Morten
No, it didn't. It's your file what I was talking about.
This is the log file I obtain with TeXnicCenter:
(sorry for this is a long file)
----------------------------------------------------
This is pdfeTeX, Version 3.141592-1.21a-2.2 (MiKTeX 2.4) (preloaded
format=latex 2006.7.12) 7 AUG 2006 16:16
entering extended mode
**C:/Documents*and*Settings/vigibos/Mis*documentos/Poli/Investigació/DEA/PROVA*ETIQUETES.tex
(C:/Documents and Settings/vigibos/Mis
documentos/Poli/Investigació/DEA/PROVA ETIQUETES.tex
LaTeX2e <2005/12/01>
Babel <v3.8g> and hyphenation patterns for english, dumylang,
nohyphenation, german, ngerman, spanish, catalan, french,
loaded.
(C:\texmf\tex\latex\base\article.cls
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
(C:\texmf\tex\latex\base\size10.clo
File: size10.clo 2005/09/16 v1.4f Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
) (C:\texmf\tex\latex\amsmath\amsmath.sty
Package: amsmath 2000/07/18 v2.13 AMS math features
\@mathmargin=\skip43
For additional information on amsmath, use the `?' option.
(C:\texmf\tex\latex\amsmath\amstext.sty
Package: amstext 2000/06/29 v2.01
(C:\texmf\tex\latex\amsmath\amsgen.sty
File: amsgen.sty 1999/11/30 v2.0
\@emptytoks=\toks14
\ex@=\dimen103
)) (C:\texmf\tex\latex\amsmath\amsbsy.sty
Package: amsbsy 1999/11/29 v1.2d
\pmbraise@=\dimen104
) (C:\texmf\tex\latex\amsmath\amsopn.sty
Package: amsopn 1999/12/14 v2.01 operator names
)
\inf@bad=\count87
LaTeX Info: Redefining \frac on input line 211.
\uproot@=\count88
\leftroot@=\count89
LaTeX Info: Redefining \overline on input line 307.
\classnum@=\count90
\DOTSCASE@=\count91
LaTeX Info: Redefining \ldots on input line 379.
LaTeX Info: Redefining \dots on input line 382.
LaTeX Info: Redefining \cdots on input line 467.
\Mathstrutbox@=\box26
\strutbox@=\box27
\big@size=\dimen105
LaTeX Font Info: Redeclaring font encoding OML on input line 567.
LaTeX Font Info: Redeclaring font encoding OMS on input line 568.
\macc@depth=\count92
\c@MaxMatrixCols=\count93
\dotsspace@=\muskip10
\c@parentequation=\count94
\dspbrk@lvl=\count95
\tag@help=\toks15
\row@=\count96
\column@=\count97
\maxfields@=\count98
\andhelp@=\toks16
\eqnshift@=\dimen106
\alignsep@=\dimen107
\tagshift@=\dimen108
\tagwidth@=\dimen109
\totwidth@=\dimen110
\lineht@=\dimen111
\@envbody=\toks17
\multlinegap=\skip44
\multlinetaggap=\skip45
\mathdisplay@stack=\toks18
LaTeX Info: Redefining \[ on input line 2666.
LaTeX Info: Redefining \] on input line 2667.
) (C:\texmf\tex\latex\amsfonts\amssymb.sty
Package: amssymb 2002/01/22 v2.2d
(C:\texmf\tex\latex\amsfonts\amsfonts.sty
Package: amsfonts 2001/10/25 v2.2f
\symAMSa=\mathgroup4
\symAMSb=\mathgroup5
LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version
`bold'
(Font) U/euf/m/n --> U/euf/b/n on input line 132.
))
\tagmarginsep=\skip46
(PROVA ETIQUETES.aux)
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line
88.
LaTeX Font Info: ... okay on input line 88.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 88.
LaTeX Font Info: ... okay on input line 88.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 88.
LaTeX Font Info: ... okay on input line 88.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line
88.
LaTeX Font Info: ... okay on input line 88.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line
88.
LaTeX Font Info: ... okay on input line 88.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 88.
LaTeX Font Info: ... okay on input line 88.
(C:\texmf\tex\context\sample\tufte.tex)
LaTeX Font Info: Try loading font information for U+msa on input
line 92.
(C:\texmf\tex\latex\amsfonts\umsa.fd
File: umsa.fd 2002/01/19 v2.2g AMS font definitions
)
LaTeX Font Info: Try loading font information for U+msb on input
line 92.
(C:\texmf\tex\latex\amsfonts\umsb.fd
File: umsb.fd 2002/01/19 v2.2g AMS font definitions
)
! Missing $ inserted.
<inserted text>
$
l.94 \end{equation}
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Display math should end with $$.
<to be read again>
\par
l.94 \end{equation}
The `$' that I just saw supposedly matches a previous `$$'.
So I shall assume that you typed `$$' both times.
! Missing $ inserted.
<inserted text>
$
l.94 \end{equation}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Display math should end with $$.
<to be read again>
\endgroup
l.94 \end{equation}
The `$' that I just saw supposedly matches a previous `$$'.
So I shall assume that you typed `$$' both times.
! Missing $ inserted.
<inserted text>
$
l.97 a=b \tag{TAG}
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Display math should end with $$.
<to be read again>
\par
l.97 a=b \tag{TAG}
The `$' that I just saw supposedly matches a previous `$$'.
So I shall assume that you typed `$$' both times.
! LaTeX Error: Bad math environment delimiter.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.98 \end{equation*}
Your command was ignored.
Type I <command> <return> to replace it with another command,
or <return> to continue without it.
! You can't use `\eqno' in vertical mode.
\endmathdisplay@a ...\df@tag \@empty \else \veqno
\alt@tag \df@tag \fi
\ifx ...
l.98 \end{equation*}
Sorry, but I'm not programmed to handle this case;
I'll just pretend that you didn't ask for it.
If you're in the wrong mode, you might be able to
return to the right one by typing `I}' or `I$' or `I\par'.
! Missing $ inserted.
<inserted text>
$
l.98 \end{equation*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Display math should end with $$.
<to be read again>
\endgroup
l.98 \end{equation*}
The `$' that I just saw supposedly matches a previous `$$'.
So I shall assume that you typed `$$' both times.
! Missing $ inserted.
<inserted text>
$
l.106 \end{gather*}
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Missing } inserted.
<inserted text>
}
l.106 \end{gather*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing } inserted.
<inserted text>
}
l.106 \end{gather*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing } inserted.
<inserted text>
}
l.106 \end{gather*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing \cr inserted.
<inserted text>
\cr
l.106 \end{gather*}
I'm guessing that you meant to end an alignment here.
! Missing { inserted.
<inserted text>
{
l.106 \end{gather*}
I've put in what seems to be necessary to fix
the current column of the current alignment.
Try to go on, since this might almost work.
! Missing { inserted.
<inserted text>
{
l.106 \end{gather*}
I've put in what seems to be necessary to fix
the current column of the current alignment.
Try to go on, since this might almost work.
! Extra }, or forgotten $.
<recently read> }
l.106 \end{gather*}
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.
! Missing $ inserted.
<inserted text>
$
l.106 \end{gather*}
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Missing } inserted.
<inserted text>
}
l.106 \end{gather*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Misplaced alignment tab character &.
\math@cr@@@ ->\ifst@rred \nonumber \fi &
\relax \make@display@tag
\ifst@rred ...
l.106 \end{gather*}
I can't figure out why you would want to use a tab mark
here. If you just want an ampersand, the remedy is
simple: Just type `I\&' now. But if some right brace
up above has ended a previous alignment prematurely,
you're probably due for more error messages, and you
might try typing `S' now just to see what is salvageable.
! Misplaced \cr.
\math@cr@@@ ...fi \global \advance \row@ \@ne \cr
l.106 \end{gather*}
I can't figure out why you would want to use a tab mark
or \cr or \span just now. If something like a right brace
up above has ended a previous alignment prematurely,
you're probably due for more error messages, and you
might try typing `S' now just to see what is salvageable.
! Extra }, or forgotten \endgroup.
\gmeasure@ ...avetaglength@ \crcr #1\math@cr@@@ }}
\restorecounters@
\if@fleq...
l.106 \end{gather*}
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.
! Missing $ inserted.
<inserted text>
$
l.106 \end{gather*}
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Missing } inserted.
<inserted text>
}
l.106 \end{gather*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing } inserted.
<inserted text>
}
l.106 \end{gather*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing } inserted.
<inserted text>
}
l.106 \end{gather*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing \cr inserted.
<inserted text>
\cr
l.106 \end{gather*}
I'm guessing that you meant to end an alignment here.
! Missing { inserted.
<inserted text>
{
l.106 \end{gather*}
I've put in what seems to be necessary to fix
the current column of the current alignment.
Try to go on, since this might almost work.
! Missing { inserted.
<inserted text>
{
l.106 \end{gather*}
I've put in what seems to be necessary to fix
the current column of the current alignment.
Try to go on, since this might almost work.
! Extra }, or forgotten $.
<recently read> }
l.106 \end{gather*}
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.
! Missing number, treated as zero.
<to be read again>
\relax
l.106 \end{gather*}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
\relax
l.106 \end{gather*}
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Missing $ inserted.
<inserted text>
$
l.106 \end{gather*}
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Missing } inserted.
<inserted text>
}
l.106 \end{gather*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing $$ inserted.
<to be read again>
\par
l.106 \end{gather*}
Displays can use special alignments (like \eqalignno)
only if nothing but the alignment itself is between $$'s.
! Misplaced \cr.
\math@cr@@@ ->\cr
l.106 \end{gather*}
I can't figure out why you would want to use a tab mark
or \cr or \span just now. If something like a right brace
up above has ended a previous alignment prematurely,
you're probably due for more error messages, and you
might try typing `S' now just to see what is salvageable.
! Misplaced \noalign.
\math@cr@@ ... \iffalse }\fi \math@cr@@@ \noalign
{\vskip #1\relax }
l.106 \end{gather*}
I expect to see \noalign only after the \cr of
an alignment. Proceed, and I'll ignore this case.
! Misplaced \noalign.
\black@ #1->\noalign
{\ifdim #1>\displaywidth \dimen@ \prevdepth
\nointerlin...
l.106 \end{gather*}
I expect to see \noalign only after the \cr of
an alignment. Proceed, and I'll ignore this case.
! Extra }, or forgotten \endgroup.
\endgather ->\math@cr \black@ \totwidth@ \egroup
$$\ignorespacesafterend
l.106 \end{gather*}
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.
! Missing $ inserted.
<inserted text>
$
l.106 \end{gather*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Display math should end with $$.
<to be read again>
\endgroup
l.106 \end{gather*}
The `$' that I just saw supposedly matches a previous `$$'.
So I shall assume that you typed `$$' both times.
[1
{psfonts.map}] (C:\texmf\tex\context\sample\tufte.tex)
! Missing $ inserted.
<inserted text>
$
l.126 \end{equation}
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Display math should end with $$.
<to be read again>
\par
l.126 \end{equation}
The `$' that I just saw supposedly matches a previous `$$'.
So I shall assume that you typed `$$' both times.
! Missing $ inserted.
<inserted text>
$
l.126 \end{equation}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Display math should end with $$.
<to be read again>
\endgroup
l.126 \end{equation}
The `$' that I just saw supposedly matches a previous `$$'.
So I shall assume that you typed `$$' both times.
! Missing $ inserted.
<inserted text>
$
l.129 a= b \tag{TAG}
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Display math should end with $$.
<to be read again>
\par
l.129 a= b \tag{TAG}
The `$' that I just saw supposedly matches a previous `$$'.
So I shall assume that you typed `$$' both times.
! LaTeX Error: Bad math environment delimiter.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.130 \end{equation*}
Your command was ignored.
Type I <command> <return> to replace it with another command,
or <return> to continue without it.
! You can't use `\eqno' in vertical mode.
\endmathdisplay@a ...\df@tag \@empty \else \veqno
\alt@tag \df@tag \fi
\ifx ...
l.130 \end{equation*}
Sorry, but I'm not programmed to handle this case;
I'll just pretend that you didn't ask for it.
If you're in the wrong mode, you might be able to
return to the right one by typing `I}' or `I$' or `I\par'.
! Missing $ inserted.
<inserted text>
$
l.130 \end{equation*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Display math should end with $$.
<to be read again>
\endgroup
l.130 \end{equation*}
The `$' that I just saw supposedly matches a previous `$$'.
So I shall assume that you typed `$$' both times.
! Missing $ inserted.
<inserted text>
$
l.138 \end{gather*}
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Missing } inserted.
<inserted text>
}
l.138 \end{gather*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing } inserted.
<inserted text>
}
l.138 \end{gather*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing } inserted.
<inserted text>
}
l.138 \end{gather*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing \cr inserted.
<inserted text>
\cr
l.138 \end{gather*}
I'm guessing that you meant to end an alignment here.
! Missing { inserted.
<inserted text>
{
l.138 \end{gather*}
I've put in what seems to be necessary to fix
the current column of the current alignment.
Try to go on, since this might almost work.
! Missing { inserted.
<inserted text>
{
l.138 \end{gather*}
I've put in what seems to be necessary to fix
the current column of the current alignment.
Try to go on, since this might almost work.
! Extra }, or forgotten $.
<recently read> }
l.138 \end{gather*}
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.
! Missing $ inserted.
<inserted text>
$
l.138 \end{gather*}
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Missing } inserted.
<inserted text>
}
l.138 \end{gather*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Misplaced alignment tab character &.
\math@cr@@@ ->\ifst@rred \nonumber \fi &
\relax \make@display@tag
\ifst@rred ...
l.138 \end{gather*}
I can't figure out why you would want to use a tab mark
here. If you just want an ampersand, the remedy is
simple: Just type `I\&' now. But if some right brace
up above has ended a previous alignment prematurely,
you're probably due for more error messages, and you
might try typing `S' now just to see what is salvageable.
! Misplaced \cr.
\math@cr@@@ ...fi \global \advance \row@ \@ne \cr
l.138 \end{gather*}
I can't figure out why you would want to use a tab mark
or \cr or \span just now. If something like a right brace
up above has ended a previous alignment prematurely,
you're probably due for more error messages, and you
might try typing `S' now just to see what is salvageable.
! Extra }, or forgotten \endgroup.
\gmeasure@ ...avetaglength@ \crcr #1\math@cr@@@ }}
\restorecounters@
\if@fleq...
l.138 \end{gather*}
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.
! Missing $ inserted.
<inserted text>
$
l.138 \end{gather*}
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Missing } inserted.
<inserted text>
}
l.138 \end{gather*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing } inserted.
<inserted text>
}
l.138 \end{gather*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing } inserted.
<inserted text>
}
l.138 \end{gather*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing \cr inserted.
<inserted text>
\cr
l.138 \end{gather*}
I'm guessing that you meant to end an alignment here.
! Missing { inserted.
<inserted text>
{
l.138 \end{gather*}
I've put in what seems to be necessary to fix
the current column of the current alignment.
Try to go on, since this might almost work.
! Missing { inserted.
<inserted text>
{
l.138 \end{gather*}
I've put in what seems to be necessary to fix
the current column of the current alignment.
Try to go on, since this might almost work.
! Extra }, or forgotten $.
<recently read> }
l.138 \end{gather*}
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.
! Missing number, treated as zero.
<to be read again>
\relax
l.138 \end{gather*}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
\relax
l.138 \end{gather*}
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Missing $ inserted.
<inserted text>
$
l.138 \end{gather*}
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Missing } inserted.
<inserted text>
}
l.138 \end{gather*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing $$ inserted.
<to be read again>
\par
l.138 \end{gather*}
Displays can use special alignments (like \eqalignno)
only if nothing but the alignment itself is between $$'s.
! Misplaced \cr.
\math@cr@@@ ->\cr
l.138 \end{gather*}
I can't figure out why you would want to use a tab mark
or \cr or \span just now. If something like a right brace
up above has ended a previous alignment prematurely,
you're probably due for more error messages, and you
might try typing `S' now just to see what is salvageable.
! Misplaced \noalign.
\math@cr@@ ... \iffalse }\fi \math@cr@@@ \noalign
{\vskip #1\relax }
l.138 \end{gather*}
I expect to see \noalign only after the \cr of
an alignment. Proceed, and I'll ignore this case.
! Misplaced \noalign.
\black@ #1->\noalign
{\ifdim #1>\displaywidth \dimen@ \prevdepth
\nointerlin...
l.138 \end{gather*}
I expect to see \noalign only after the \cr of
an alignment. Proceed, and I'll ignore this case.
! Extra }, or forgotten \endgroup.
\endgather ->\math@cr \black@ \totwidth@ \egroup
$$\ignorespacesafterend
l.138 \end{gather*}
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.
! Missing $ inserted.
<inserted text>
$
l.138 \end{gather*}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Display math should end with $$.
<to be read again>
\endgroup
l.138 \end{gather*}
The `$' that I just saw supposedly matches a previous `$$'.
So I shall assume that you typed `$$' both times.
[2] (PROVA ETIQUETES.aux) )
Here is how much of TeX's memory you used:
1157 strings out of 95456
12101 string characters out of 1188928
59800 words of memory out of 1061390
4282 multiletter control sequences out of 60000
5339 words of font info for 22 fonts, out of 1000000 for 2000
40 hyphenation exceptions out of 8191
27i,8n,24p,282b,142s stack positions out of
5000i,500n,10000p,200000b,32768s
PDF statistics:
13 PDF objects out of 300000
0 named destinations out of 300000
1 words of extra memory for PDF output out of 65536
<C:\texmf\fonts\type1\bluesky\cm\cmmi10.pfb><C:\texmf\fonts\type1\bluesky\cm\cmr10.pfb>
Output written on PROVA ETIQUETES.pdf (2 pages, 20419 bytes).
>
> Morten Høgholm wrote:
>> Can you provide an example? The example file I posted did work, right?
>
> No, it didn't. It's your file what I was talking about.
I am quite sure it isn't. ;-) For instance I see that you load amssymb and
that didn't appear in my example file. However adding that package still
works for me, so...
> ) (C:\texmf\tex\latex\amsfonts\amssymb.sty
> Package: amssymb 2002/01/22 v2.2d
>
> (C:\texmf\tex\latex\amsfonts\amsfonts.sty
> Package: amsfonts 2001/10/25 v2.2f
> ))
Please post your complete non-working example plus add a \listfiles before
\documentclass so that we can see the version numbers of the various
packages.
--
Morten
You are right, I added "amssymb" package, just for trying.
I have realized that I get "errors" when building the file but, then, I
get the expected results, anyway!!!
Here
http://personales.upv.es/~vigibos/prova1.zip
you can get 3 files:
- prova1.tex
- prova1.log
- prova1.pdf
In prova1.tex you'll find your example, more or less. I've added
"\listfiles" before all, as you told me.
In prova1.log you'll find the log when building the file with
TeXnicCenter, version 1 Beta 7.01.
In prova1.pdf you can see the document that has been created and that
looks perfect, despite the errors shown in prova1.log.
I think TeXnicCenter is too strict, maybe, or there's something wrong
with it... I don't know.
Anyway, also I want to show you the effect of your solution on my real
document:
http://personales.upv.es/~vigibos/principal_070806.pdf
First equations appear in page 4, and they look perfect!!! Just the
effect I wanted. :-)
The same for page 15, this time with an odd page... :-) But, oops,
I realize that there is too much vertical spacing within those
equations and between each of them and the previous and next text (you
can see this other document:
http://personales.upv.es/~vigibos/principal_original.pdf , the same
origin but without your solution). That extra vertical gap is present
in all the equations.
And, look at page 27. Equations (1.15) and (1.16) aren't affected by
your code. Those equations where created with this LaTeX sentences:
\begin{eqnarray}
p_g(\delta) &=& \Phi\left(\delta + \frac{6C_p}{\lambda}\right) -
\Phi\left(\delta -
\frac{6C_p}{\lambda}\right)\label{eq:prob_verde_normal}\\
p_y(\delta) &=& \Phi\left(\delta + 3C_p\right) - \Phi\left(\delta -
3C_p\right) - p_g(\delta)\label{eq:prob_amarilla_normal}
\end{eqnarray}
The same with equations (1.26) and (1.27) in page 31, which are build
in the same way. And also with (2.13) and (2.14) (page 45).
And, at the end of that very same page 31, we have an equation (1.28)
and, then, in page 32, two tables, and then, another equation, (1.29)
one... But... oops!! The label is in the wrong place. This is not as
serious as it seems, because I suppose that "float" package has got
something to do with this "error", but, look at equation (2.1)!! And
look at page 43, also.
So, there's something wrong. I think it has to do with the extra
vertical space which is added after each equation. And maybe it has to
do with that extrange "Missing $ inserted" error.
So, what do you think about it?
--
Vicent
> Morten,
>
> You are right, I added "amssymb" package, just for trying.
>
> I have realized that I get "errors" when building the file but, then, I
> get the expected results, anyway!!!
>
> Here
>
> http://personales.upv.es/~vigibos/prova1.zip
>
> you can get 3 files:
>
> - prova1.tex
One problem I see here is that there are spurious blank lines in the
definitions of \mh@print@in@outer@margin, \make@df@tag, and
\endmathdisplay@a, which will cause that problem. The most likely reason
is that Google's html view of it added the lines but when you choose "Show
original" they are no longer present.
> The same for page 15, this time with an odd page... :-) But, oops,
> I realize that there is too much vertical spacing within those
> equations and between each of them and the previous and next text (you
> can see this other document:
> http://personales.upv.es/~vigibos/principal_original.pdf , the same
> origin but without your solution). That extra vertical gap is present
> in all the equations.
Try with those blank lines removed.
>
> And, look at page 27. Equations (1.15) and (1.16) aren't affected by
> your code. Those equations where created with this LaTeX sentences:
>
>
> \begin{eqnarray}
> p_g(\delta) &=& \Phi\left(\delta + \frac{6C_p}{\lambda}\right) -
> \Phi\left(\delta -
> \frac{6C_p}{\lambda}\right)\label{eq:prob_verde_normal}\\
> p_y(\delta) &=& \Phi\left(\delta + 3C_p\right) - \Phi\left(\delta -
> 3C_p\right) - p_g(\delta)\label{eq:prob_amarilla_normal}
> \end{eqnarray}
Yes that is deliberate - you really shouldn't be using eqnarray. It is
rather easy to fix but I think it is better that you convert those
eqnarrays into align.
> And, at the end of that very same page 31, we have an equation (1.28)
> and, then, in page 32, two tables, and then, another equation, (1.29)
> one... But... oops!! The label is in the wrong place. This is not as
> serious as it seems, because I suppose that "float" package has got
> something to do with this "error", but, look at equation (2.1)!! And
> look at page 43, also.
The page checking I used in the example should produce the correct result
after a couple of runs but the errors might influence it.
--
Morten
Morten Høgholm wrote:
> One problem I see here is that there are spurious blank lines in the
> definitions of \mh@print@in@outer@margin, \make@df@tag, and
> \endmathdisplay@a, which will cause that problem. The most likely reason
> is that Google's html view of it added the lines but when you choose "Show
> original" they are no longer present.
I used "show original" and there still were some strange characters (I
copied and pasted, and I had a strange "D3" in the definition of
"mh@evenodd", and things like that. Once I realized of those strange
errors and cut off all the spaces, it worked OK!!!
> Yes that is deliberate - you really shouldn't be using eqnarray. It is
> rather easy to fix but I think it is better that you convert those
> eqnarrays into align.
I've done that, also, and finally I've got what I wanted. But, why I
shouldn't be using eqnarray?
Thank you very much, Morten.
Do you mind if I refer your solution in the Spanish LaTeX forum
(CervanTeX). I think that it's quite interesting.
Thanks a lot, again.
--
Vicent
http://www.imf.au.dk/system/latex/artikler/eqnarray_is_bad/eqnarray_is_bad.pdf
more or less sums it up
--
/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
> I've done that, also, and finally I've got what I wanted. But, why I
> shouldn't be using eqnarray?
Lars paper lists many reasons but by far the most grueling is the wrong
spacing.
> Do you mind if I refer your solution in the Spanish LaTeX forum
> (CervanTeX). I think that it's quite interesting.
Anything posted in a newsgroup like this is public, so... :-)
--
Morten
Morten Høgholm wrote:
>
> Anything posted in a newsgroup like this is public, so... :-)
So, I've decided to arrange it a little and to upload it to my web
area:
http://personales.upv.es/~vigibos/margin_eq_label_by_MH.tex
The explanations are in Spanish, but it refers also to this Usenet
thread.
Thank you a lot for your help. I love this piece of code!!
--
Vicent