[XeTeX] Eq multi-labeling problem (with file)

Alan Munn amunn at msu.edu
Wed Jul 22 23:50:40 CEST 2009


At 9:33 PM +0300 7/22/09, snvv wrote:
>Hello,
>I when i set a multi-labeling equation the results is like (1a ) (1 b) etc
>(see attached file).
>
>Is it possible to make that numbering (1a) (1b) or (1-1) (1-2) etc ?
>
>
>Thank you
>snvv
>
>
>Sorry, the file was not attached in my previous mail
>
>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>I use the following code
>%!TEX TS-program = xelatex -output-driver="xdvipdfmx -q -E"
>%!TEX encoding = UTF-8 Unicode
>\documentclass[a4papper,oneside,12pt]{book}

a4paper

>\usepackage{amssymb}
>\usepackage{amsmath}
>\usepackage{fontspec,fontenc,xunicode,xltxtra,xgreek} %

don't use fontenc with xetex; also you don't need to load fontspec 
and xunicode separately when you load xltxtra, so this should be:

\usepackage{xltxtra,xgreek}

It would be easier if you had added the complete small document here 
instead of a snippet of code.

>
>
>and
>
>\begin{subequations}\label{grp}
>\begin{align}
>a&=b+c\label{second}\\
>d&=e+f+g\label{third}\\
>h&=i+j\label{fourth}
>\end{align}
>\end{subequations}


If you want the greek enumeration to go away, and be replaced by 
a/b/c etc.  then put \nogreekalph at the beginning of your document.

If you want to change the format of the subequations then you need to 
redefine the subequations environment.  See sample file below.

Alan



\documentclass[a4paper,oneside,12pt]{book}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{xltxtra,xgreek} %

\nogreekalph
\begin{document}
\setmainfont[Mapping=tex-text]{Times}
\makeatletter
\renewenvironment{subequations}{%
   \refstepcounter{equation}%
   \protected at edef\theparentequation{\theequation}%
   \setcounter{parentequation}{\value{equation}}%
   \setcounter{equation}{0}%
   \def\theequation{\theparentequation--\alph{equation}}% This line 
formats the subequations
   \ignorespaces
}{%
   \setcounter{equation}{\value{parentequation}}%
   \ignorespacesafterend
}
\makeatother
and

\begin{subequations}\label{grp}
\begin{align}
a&=b+c\label{second}\\
d&=e+f+g\label{third}\\
h&=i+j\label{fourth}
\end{align}
\end{subequations}
\end{document}



-- 
Alan Munn						amunn at msu.edu
Department of Linguistics
and Germanic, Slavic, Asian and African Languages		Tel. 
	517-355-7491
Michigan State University, East Lansing MI 48824 USA	Fax	517-432-2736


More information about the XeTeX mailing list