1

Here is the MWE. Once I added [xindy] while calling imakeidx, the sorting is fixed. But now xindy puts letter headings to each group. How can I get rid of those?

\documentclass{memoir}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[citestyle=authoryear-comp,bibstyle=authoryear,hyperref=true,maxcitenames=3,doi=false,url=true,backend=biber,natbib=true,maxbibnames=99,uniquename=false,uniquelist=false,indexing=cite]{biblatex}

\usepackage[xindy]{imakeidx}

\makeindex
\usepackage[itemlayout=abshang,indentunit=10pt]{idxlayout}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{auth00a,
  author = {Author},
  title = {MyBook A},
  date = {2000}
}
@article{auth00b,
  author = {Author},
  title = {MyBook B},
  date = {2000}
}


@article{morris2008effective,
  Author =       {Morris, Saul S. and Cogill, Bruce and Uauy, Ricardo},
  Journal =      {The Lancet},
  Number =       9612,
  Pages =        {608--21},
  Title =        {Effective international action against
                  undernutrition: Why has it proven so difficult and
                  what can be done to accelerate progress?},
  Volume =       371,
  Year =         2008
}

@article{biberanak2002,
  Author =       {Biber, F. Z{\"u}mr{\"u}t and {\"U}nak, Perihan and
                  Yurt, Fatma},
  sortname =    {Biber, F. Zumrut and Unak, Perihan and Yurt, Fatma},
  Doi =          {10.1080/10256010208033316},
  Journal =      {Isotopes in Environmental and Health Studies},
  Number =       2,
  Pages =        {87--93},
  Title =        {Stability of iodine content in iodized salt},
  Volume =       38,
  Year =         2002,
  Bdsk-Url-1 =   {dx.doi.org/10.1080/10256010208033316}
}

@article{wang2014trends,
  Author =       {Wang, Dong D. and Leung, Cindy W. and Li, Yanping and
                  Ding, Eric L. and Chiuve, Stephanie E. and Hu, Frank B.
                  and Willett, Walter C.},
  Journal =      {JAMA Internal Medicine},
  Number =       10,
  Pages =        {1587--95},
  Timestamp =    {2015.02.27},
  Title =        {Trends in dietary quality among adults in the
                  {U}nited {S}tates: 1999 through 2010},
  Volume =       174,
  Year =         2014
}



\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}
\parencite{auth00a,auth00b,wang2014trends,morris2008effective,biberanak2002}

\printindex

\end{document}

I use following command to compile:

xelatex -interaction nonstopmode mwebib
biber mwebib
xelatex -interaction nonstopmode mwebib
xindy -M texindy -M page-ranges -L Turkish -C utf8 mwebib.idx
xelatex -interaction nonstopmode mwebib
xelatex -interaction nonstopmode mwebib

Here is an image of what I get

enter image description here

It would be better if {\"U}nak was sorted as Unak, and no headings were given to letter groups in the bibliography.

Here is the log of xindy run:

Opening logfile "/dev/null" (done)
Reading indexstyle...
Loading module "/var/folders/hj/hqfjch716qg5php160jbtfgh0000gn/T/z2uZtkJFip"...
Loading module "lang/Turkish/utf8-lang.xdy"...
Loading module "lang/turkish/utf8.xdy"...
Finished loading module "lang/turkish/utf8.xdy".
Finished loading module "lang/Turkish/utf8-lang.xdy".
Loading module "texindy.xdy"...
Loading module "numeric-sort.xdy"...
Finished loading module "numeric-sort.xdy".
Loading module "latex.xdy"...
Loading module "tex.xdy"...
Finished loading module "tex.xdy".
Finished loading module "latex.xdy".
Loading module "latex-loc-fmts.xdy"...
Finished loading module "latex-loc-fmts.xdy".
Loading module "makeindex.xdy"...
Finished loading module "makeindex.xdy".
Loading module "latin-lettergroups.xdy"...
Finished loading module "latin-lettergroups.xdy".
Finished loading module "texindy.xdy".
Loading module "page-ranges.xdy"...
Finished loading module "page-ranges.xdy".
Finished loading module "/var/folders/hj/hqfjch716qg5php160jbtfgh0000gn/T/z2uZtkJFip".
Finished reading indexstyle.
Finalizing indexstyle... (done)

Reading raw-index "/var/folders/hj/hqfjch716qg5php160jbtfgh0000gn/T/tD8Zga0_Dw"... Finished reading raw-index.

Processing index... [10%] [20%] [30%] [40%] [50%] [60%] [70%] [80%] [90%] [100%] Finished processing index.

Writing markup... [10%] [20%] [30%] [40%] [50%] [60%] [70%] [80%] [90%] [100%] Markup written into file "./mwebib.ind".

moewe
  • 175,683
len71
  • 577
  • There is no difference in output between citestyle=authoryear-comp, bibstyle=authoryear and style=authoryear-comp. But the latter is arguably easier on the eyes in the source code. There is no need for hyperref=true, the default auto option will turn on hyperref support automatically, if the hyperref is loaded. – moewe Sep 01 '15 at 06:58
  • Can you please add a full MWE of what your index looks like and how it is created? Because from what I can see, the sorting in the bibliography should be just fine. – moewe Sep 01 '15 at 07:00
  • Note that the sorting in the index is not done by biblatex, but your favourite index tool (makeindex, xindy). So that tool needs to support proper UTF8 sorting (I think xindy should be able to do that, I'm not sure about makeindex). – moewe Sep 01 '15 at 09:40
  • Using \usepackage[xindy]{imakeidx} corrected the sort order. But now xindy puts letters (A, B, C, etc) above the groups. How do I get rid of them? – len71 Sep 01 '15 at 10:14
  • Can you explain how you compile your document? The only A and B I get are in "My Book A" and "My Book B". Can you also add an image of the output you get? – moewe Sep 01 '15 at 14:04
  • 1
    The sorting is right on my machine. Is your system up to date? Does \newcommand*\lettergroup[1]{} seem to do the trick with the groups? Otherwise you will have to change the .xdy file as in Customize xindy index layout. – moewe Sep 02 '15 at 07:18
  • If you want more help modifying xindy is suggest you ask a new question with the appropriate tags (maybe even drop the biblatex use as it is not really relevant to the problem at hand). – moewe Sep 02 '15 at 07:22
  • 1
    I have re-tagged the question as it is not really about biblatex, but rather about xindy now. – moewe Sep 02 '15 at 07:23
  • Please make sure your system is up to date. On my system I don't get a separate group for "Ü", everything is sorted under "U". Please provide the log output of the xindy run. – moewe Sep 02 '15 at 13:35
  • Added log. I have MacTeX 2015, based on TexLive 2015. – len71 Sep 02 '15 at 14:11
  • Mhh, that is interesting, my log looks pretty much the same. Maybe the language format files are different on TeXLive (I run MikTeX), or xindy uses system calls at some point and they give different results on Windows and Mac. – moewe Sep 02 '15 at 14:18
  • I am not able to follow the discussion on the merge rules and sort rules in the xindy tutorials. It does seem that something like that would solve the problem. – len71 Sep 02 '15 at 14:28
  • In the solution below, have you tried adding (merge-rule "Ü" "U") to the xdy file? – moewe Sep 04 '15 at 07:48

1 Answers1

3

As other people said, I get the right grouping for U and Ü with my MacTeX2015. In order to remove headings you have only to redefine the \lettergroup command inside the style file. In this case you can decide that \lettergroup is only a \par command.

% arara: xelatex
% arara: biber
% arara: xelatex: {shell : yes}
% arara: xelatex
\documentclass{memoir}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[citestyle=authoryear-comp,bibstyle=authoryear,hyperref=true,maxcitenames=3,doi=false,url=true,backend=biber,natbib=true,maxbibnames=99,uniquename=false,uniquelist=false,indexing=cite]{biblatex}

\usepackage{imakeidx}

\makeindex[program=xindy,options= -C utf8 -M indexstyle]
\usepackage[itemlayout=abshang,indentunit=10pt]{idxlayout}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{auth00a,
  author = {Author},
  title = {MyBook A},
  date = {2000}
}
@article{auth00b,
  author = {Author},
  title = {MyBook B},
  date = {2000}
}


@article{morris2008effective,
  Author =       {Morris, Saul S. and Cogill, Bruce and Uauy, Ricardo},
  Journal =      {The Lancet},
  Number =       9612,
  Pages =        {608--21},
  Title =        {Effective international action against
                  undernutrition: Why has it proven so difficult and
                  what can be done to accelerate progress?},
  Volume =       371,
  Year =         2008
}

@article{biberanak2002,
  Author =       {Biber, F. Z{\"u}mr{\"u}t and {\"U}nak, Perihan and
                  Yurt, Fatma},
  sortname =    {Biber, F. Zumrut and Unak, Perihan and Yurt, Fatma},
  Doi =          {10.1080/10256010208033316},
  Journal =      {Isotopes in Environmental and Health Studies},
  Number =       2,
  Pages =        {87--93},
  Title =        {Stability of iodine content in iodized salt},
  Volume =       38,
  Year =         2002,
  Bdsk-Url-1 =   {dx.doi.org/10.1080/10256010208033316}
}

@article{wang2014trends,
  Author =       {Wang, Dong D. and Leung, Cindy W. and Li, Yanping and
                  Ding, Eric L. and Chiuve, Stephanie E. and Hu, Frank B.
                  and Willett, Walter C.},
  Journal =      {JAMA Internal Medicine},
  Number =       10,
  Pages =        {1587--95},
  Timestamp =    {2015.02.27},
  Title =        {Trends in dietary quality among adults in the
                  {U}nited {S}tates: 1999 through 2010},
  Volume =       174,
  Year =         2014
}
\end{filecontents*}
\begin{filecontents*}{indexstyle.xdy}
(markup-index :open  "\begin{theindex}~n
 \providecommand*\lettergroupDefault[1]{}
 \providecommand*\lettergroup[1]{%
 \par}"
          :close "~n~n\end{theindex}~n"
          :tree)

(markup-locclass-list :open "\dotfill " :sep ", ")

;; delim_n <string>         ", "

(markup-locref-list   :sep ", ")

;; delim_r <string>         "--"

(markup-range :sep "--")

;; Local Variables:
;; mode: lisp
;; End:
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}
\parencite{auth00a,auth00b,wang2014trends,morris2008effective,biberanak2002}

\printindex

\end{document}

the output is:

enter image description here

  • Do you get two groups for U and Ü, or just one? I get two but want one. Could you please add an image of your output. This is very peculiar. – len71 Sep 02 '15 at 23:50
  • I knew there was someone who is able to write these .xdy files. ;-) Is there any problem with just defining \lettergroup in the actual document as \newcommand*\lettergroup[1]{} (or \newcommand*\lettergroup[1]{\par}; (I notice that the .xdy file uses \providecommand so that that definition should not be overwritten)? I think I have seen an option to lob letters together in the index. Maybe that can help here? – moewe Sep 03 '15 at 06:34
  • It is probably just a matter of (sort-rule "ü" "u")? I couldn't get (sort-rule "ü" "a") going here, but I'm not sure how to use it. – moewe Sep 03 '15 at 06:50
  • In this case there is no problem if you use \newcommand, because \lettergroup is not already defined. xindy has a lot of option, you can build lettergroups as you want, for example you can create A-C, D-F,... groups. You can chhose that the X letter shall be indexed beteween M and N. It's really powerful, if you know how to use it :-) – Francesco Endrici Sep 03 '15 at 06:52
  • I thought as much. That little trick would save us having to create a .xdy for this. Do you think you can give an example of this sort/merging maybe using some crazy example? That might help the OP to override a shoddy default if that is the problem here. – moewe Sep 03 '15 at 06:54
  • It's my plan. But I have to spend some time studying how to do it, I don't really remember how to do it. – Francesco Endrici Sep 03 '15 at 06:59
  • That is awesome. Thank you very much. ... Take your time. – moewe Sep 03 '15 at 07:04
  • I'm sure you already knew, but I just found out that (sort-rule "Ü" "A") didn't work as I expected, but (merge-rule "Ü" "A") did well. – moewe Sep 03 '15 at 07:08