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 make dictionary style pagemarks using biblatex. Consider the following example:

\documentclass{memoir}
\usepackage[sorting=nyt,style=ieee-alphabetic,backend=biber]{biblatex}
\begin{filecontents}{\jobname.bib}
@inbook{IEEEexample:incollectionwithseries,
  author        = "J. B. Anderson and K. Tepe",
  title         = "Properties of the Tailbiting {BCJR} Decoder",
  booktitle     = "Codes, Systems and Graphical Models",
  series        = "{IMA} Volumes in Mathematics and Its Applications",
  publisher     = "Springer-Verlag",
  location      = "New York",
  year          = "2000"  
}

@book{IEEEexample:inbookpagesnote,
  author        = "B. K. Bul",
  title         = "Theory Principles and Design of Magnetic Circuits",
  publisher     = "Energia Press",
  loction       = "Moscow",
  year          = "1964",
  pages         = "464",
  note          = "(in Russian)"
}

@book{IEEEexample:bookwitheditor,
  editor        = "J. C. Candy and G. C. Temes",
  title         = "Oversampling Delta-Sigma Data Converters Theory,
                   Design and Simulation",
  publisher     = "{IEEE} Press.",
  location      = "New York",
  year          = "1992"
}

@article{IEEEexample:articlelargepages,
  author        = "A. Castaldini and A. Cavallini and B. Fraboni
                   and P. Fernandez and J. Piqueras",
  title         = "Midgap Traps Related to Compensation Processes in
                   {CdTe} Alloys",
  journaltitle  = "Phys. Rev. B.",
  volume        = "56",
  number        = "23",
  year          = "1997",
  pages         = "14897-14900"
}

@article{IEEEexample:TBPmisc,
  author        = "M. Coates and A. Hero and R. Nowak and B. Yu",
  title         = "Internet Tomography",
  journaltitle  = "IEEE J. Selected Areas Commun.",
  month         = 05,
  year          = "2002",
  note          = "to be published"
}

@book{IEEEexample:book_typical,
  author        = "B. D. Cullity",
  title         = "Introduction to Magnetic Materials",
  publisher     = "Addison--Wesley",
  location      = "Reading, MA",
  year          = "1972"
}

@inbook{IEEEexample:incollectionmanyauthors,
  author        = "R. M. A. Dawson and Z. Shen and D. A. Furst and
                   S. Connor and J. Hsu and M. G. Kane and R. G. Stewart and
                   A. Ipri and C. N. King and P. J. Green and R. T. Flegal
                   and S. Pearson and W. A. Barrow and E. Dickey and K. Ping
                   and C. W. Tang and S. Van. Slyke and
                   F. Chen and J. Shi and J. C. Sturm and M. H. Lu",
  title         = "Design of an Improved Pixel for a Polysilicon 
                   Active-Matrix Organic {LED} Display",
  booktitle     = "{SID} Tech. Dig.",
  volume        = "29",
  year          = "1998",
  pages         = "11-14"
}

@inproceedings{IEEEexample:presentedatconf,
  author        = "S. G. Finn and M. M{\'e}dard and R. A. Barry",
  title         = "A Novel Approach to Automatic Protection Switching
                   Using Trees",
  eventtitle    = "{IEEE} International Conference on Communications",
  location      = "Montreal, Que., Canada",
  year          = "1997"
}

@manual{IEEEexample:motmanual,
  title         = "{FLEXChip} Signal Processor ({MC68175/D})",
  organization  = "Motorola",
  year          = "1996"
}

@inbook{IEEEexample:incollection_chpp,
  author        = "P. Hedelin and P. Knagenhjelm and M. Skoglund",
  editor        = "W. B. Kleijn and K. K. Paliwal",
  title         = "Theory for Transmission of Vector Quantization Data",
  booktitle     = "Speech Coding and Synthesis",
  publisher     = "Elsevier Science",
  location      = "Amsterdam, The Netherlands",
  year          = "1995",
  chapter       = "10",
  pages         = "347-396"
}

@patent{IEEEexample:jppat,
  author        = "U. Hideki",
  title         = "Quadrature Modulation Circuit",
  type          = "patentjp",
  number        = "152932/92",
  year          = "1992-05-20"
}

@periodical{IEEEexample:periodical,
  title         = "IEEE Personal Commun. Mag., Special Issue on 
                  Wireless {ATM}",
  volume        = "3",
  year          = "1996-08",
}

@misc{IEEEexample:standard,
  title         = "Wireless {LAN} Medium Access Control {(MAC)} and 
                   Physical Layer {(PHY)} Specification",
  howpublished  = "{IEEE} Std. 802.11",
  year          = "1997"
}

@online{IEEEexample:electronhowinfo,
  author        = "V. Jacobson",
  title         = "Modified {TCP} Congestion Avoidance Algorithm",
  howpublished  = "end2end-interest mailing list",
  url           = "ftp://ftp.isi.edu/end2end/end2end-interest-1990.mail",
  year          = "1990-04"
}


@report{IEEEexample:techrep,
  author        = "R. Jain and K. K. Ramakrishnan and D. M. Chiu",
  title         = "Congestion Avoidance in Computer Networks with a 
                   Connectionless Network Layer",
  institution   = "Digital Equipment Corporation",
  location      = "MA",
  number        = "DEC-TR-506",
  year          = "1987-08",
  type          = "techreport"
}

@article{IEEEexample:TBParticle,
  author        = "N. Kahale and R. Urbanke",
  title         = "On the Minimum Distance of Parallel and Serially
                   Concatenated Codes",
  journaltitle  = "IEEE Trans. Inf. Theory",
  note          = "submitted for publication"
}

@report{IEEEexample:techrepstdsub,
  author        = "S. Kandala",
  title         = "Changes to {A}nnex {D}",
  institution   = "{IEEE} 802.11 {TGe}",
  number        = "02/680r0",
  year          = "2002-10",
  type          = "techreport"
}

@thesis{IEEEexample:masterstype,
  author        = "A. Karnik",
  title         = "Performance of {TCP} Congestion Control with Rate
                   Feedback: {TCP/ABR} and Rate Adaptive {TCP/IP}",
  institution   = "Indian Institute of Science",
  type          = "M. Eng. thesis",
  location      = "Bangalore, India",
  year          = "1999-01"
}

@patent{IEEEexample:frenchpatreq,
  author        = "F. Kowalik and M. Isard",
  title         = "Estimateur d'un D{\'e}faut de Fonctionnement 
                   d'un Modulateur en Quadrature et {\'E}tage de Modulation
                   l'Utilisant",
  language      = "french",
  type          = "French Patent Request",
  number        = "9500261",
  year          = "1995-01-11"
}

@thesis{IEEEexample:phdurl,
  author        = "Q. Li",
  title         = "Delay Characterization and Performance Control of
                   Wide-area Networks",
  institution   = "Univ. of Delaware",
  location      = "Newark, NJ",
  type          = "phdthesis",
  year          = "2000-05",
  url           = "http://www.ece.udel.edu/~qli"
}

@thesis{IEEEexample:masters,
  author        = "Nin C. Loh",
  title         = "High-Resolution Micromachined Interferometric
                   Accelerometer",
  institution   = "Massachusetts Institute of Technology",
  location      = "Cambridge, MA",
  type          = "mathesis",
  year          = "1992"
}

@online{IEEEexample:electronorgadd,
  author        = "D. H. Lorenz and A. Orda",
  title         = "Optimal Partition of {QoS} Requirements on Unicast
                   Paths and Multicast Trees",
  institution   = "Dept. Elect. Eng., Technion",
  location      = "Haifa, Israel",
  url           = "ftp://ftp.technion.ac.il/pub/supported/ee/Network/lor.mopq98.ps",
  year          = "1998-07"
}

@book{IEEEexample:book,
  author        = "S. M. Metev and V. P. Veiko",
  editor        = "Osgood, Jr., R. M.",
  title         = "Laser Assisted Microtechnology",
  edition       = "2",
  publisher     = "Springer-Verlag",
  location      = "Berlin, Germany",
  year          = "1998"
}

@report{IEEEexample:techreptypeii,
  author        = "D. Middleton and A. D. Spaulding",
  title         = "A Tutorial Review of Elements of Weak Signal Detection
                   in Non-{G}aussian {EMI} Environments",
  institution   = "National Telecommunications and Information
                   Administration ({NTIA}), U.S. Dept. of Commerce",
  type          = "NTIA Report",
  number        = "86-194",
  year          = "1986-05"
}

@inproceedings{IEEEexample:confwithpapertype,
  author        = "B. Mikkelsen and G. Raybon and R.-J. Essiambre and
                   K. Dreyer and Y. Su. and L. E. Nelson and J. E. Johnson
                   and G. Shtengel and A. Bond and D. G. Moodie and
                   A. D. Ellis",
  title         = "160 {Gbit/s} Single-channel Transmission Over 300 km 
                   Nonzero-dispersion Fiber With Semiconductor Based
                   Transmitter and Demultiplexer",
  booktitle     = "Proc. {ECOC}'99",
  location      = "Nice, France",
  year          = "1999",
  pages         = "28-29"
}

@article{IEEEexample:articledualmonths,
  author        = "Y. Okada and K. Dejima and T. Ohishi",
  title         = "Analysis and Comparison of {PM} Synchronous Motor and
                   Induction Motor Type Magnetic Bearings",
  journaltitle  = "IEEE Trans. Ind. Appl.",
  volume        = "31",
  year          = "1995-09/1995-10",
  pages         = "1047-1053"
}

@unpublished{IEEEexample:unpublished,
  author        = "T. J. Ott and N. Aggarwal",
  title         = "{TCP} over {ATM}: {ABR} or {UBR}",
  howpublished  = "Unpublished"
}

@report{IEEEexample:techreptype,
  author        = "J. Padhye and V. Firoiu and D. Towsley",
  title         = "A Stochastic Model of {TCP} {R}eno Congestion Avoidance
                   and Control",
  institution   = "Univ. of Massachusetts",
  location      = "Amherst, MA",
  type          = "CMPSCI Tech. Rep.",
  number        = "99-02",
  year          = "1999",
}

@book{IEEEexample:inbook,
  author        = "H. E. Rose",
  title         = "A Course in Number Theory",
  publisher     = "Oxford Univ. Press",
  location      = "New York",
  year          = "1988",
  chapter       = "3"
}

@patent{IEEEexample:uspat,
  author        = "Ronald E. Sorace and Victor S. Reinhardt and
                   Steven A. Vaughn",
  holder        = "Hughes Aircraft Company",
  location      = "Los Angeles, CA",
  title         = "High-Speed Digital-to-{RF} Converter",
  type          = "patentus",
  number        = "5668842",
  yearfiled     = "1995-02-28",
  year          = "1997-09-16",
}

@inbook{IEEEexample:incollection,
  author        = "W. V. Sorin",
  editor        = "D. Derickson",
  title         = "Optical Reflectometry for Component Characterization",
  booktitle     = "Fiber Optic Test and Measurement",
  publisher     = "Prentice--Hall",
  location      = "Englewood Cliffs, NJ",
  year          = "1998"
}

@online{IEEEexample:electronhowinfo2,
  author        = "V. Valloppillil and K. W. Ross",
  title         = "Cache Array Routing Protocol v1.1",
  howpublished  = "Internet draft",
  url           = "http://ds1.internic.net/internet-drafts/draft-vinod-carp-v1-03.txt",
  year          = "1998"
}

@inproceedings{IEEEexample:confwithpaper,
  author        = "M. Wegmuller and J. P. von der Weid and P. Oberson
                   and N. Gisin",
  title         = "High Resolution Fiber Distributed Measurements With
                   Coherent {OFDR}",
  booktitle     = "Proc. {ECOC}'00",
  year          = "2000",
  location      = "Munich, Germany",
  pages         = "109"
}

@inproceedings{IEEEexample:confwithvolume,
  author        = "M. Yajnik and S. B. Moon and J. Kurose and D. Towsley",
  title         = "Measurement and Modeling of the Temporal Dependence in
                   Packet Loss",
  booktitle     = "Proc. {IEEE} {INFOCOM}'99",
  volume        = "1",
  location      = "New York",
  year          = "1999-03",
  pages         = "345-352"
}

@inproceedings{IEEEexample:confwithadddays,
  author        = "M. S. Yee and L. Hanzo",
  title         = "Radial Basis Function Decision Feedback Equaliser
                   Assisted Burst-by-burst Adaptive Modulation",
  booktitle     = "Proc. {IEEE} Globecom '99",
  address       = "Rio de Janeiro, Brazil",
  year          = "1999-12-05/1999-12-09",
  pages         = "2183-2187"
}
\end{filecontents}

\addbibresource{\jobname.bib}
\nocite{*}

\pagestyle{ruled}

\clearplainmark{bib}

\begin{document}
\printbibliography[heading=bibintoc]
\end{document}

Now i want a header containing the label (IEEE bib label) of the first entry on the page and of the last entry on the page eg. [HKS95] -- [MV98] (from the example). Traditionaly you can implement this using the technique for marking index entries:

\newcommand*{\dictionarymark}{%
  \ifthenelse{\equal{\leftmark}{\rightmark}}
    {\rightmark}
    {\rightmark -- \leftmark}}

\makeevenhead{ruled}{\scshape Bibliography}{}{\dictionarymark}
\makeoddhead{ruled}{\dictionarymark}{}{\scshape Bibliography}

and at each entry you add a call to \markboth{}{}. Now my question is: how can you implement this behaviour in biblatex? More specifically how can I add a call to markboth for each entry in the bibliography containing the current label.

share|improve this question

2 Answers 2

up vote 8 down vote accepted

This is greatly indebted to jon's answer.

Here's the result:

dictionary headings

I hope that is what was expected. The code uses two things from the extramarks package which I wasn't even aware of before reading jon's answer. In particular it uses \topxmark which the documentation notes 'probably is not of much use'.

In addition, it uses a new command \newmark to store the previous value of the bibitem label. It then uses this to set one of the marks for the next bibitem. This is almost enough. The only label it now gets wrong is the label for the last bibitem on the very last page. (jon's answer got this right.) There may be a neater way of doing this but, in the end, I tested to see if I was on the last page. Note that this will need to be adjusted if the final page of the bibliography does not get the label LastPage from the lastpage package. I'm really bad with numbers in TeX so the way I finally found to test the numbers, which uses refcount, is probably not that great either.

Anyway, no doubt something better can be devised but this seems to work for at least the MWE in the question:

\documentclass{memoir}
\usepackage[sorting=nyt,style=ieee-alphabetic,backend=biber]{biblatex}
\begin{filecontents}{\jobname.bib}
@inbook{IEEEexample:incollectionwithseries,
  author        = "J. B. Anderson and K. Tepe",
  title         = "Properties of the Tailbiting {BCJR} Decoder",
  booktitle     = "Codes, Systems and Graphical Models",
  series        = "{IMA} Volumes in Mathematics and Its Applications",
  publisher     = "Springer-Verlag",
  location      = "New York",
  year          = "2000"
}

@book{IEEEexample:inbookpagesnote,
  author        = "B. K. Bul",
  title         = "Theory Principles and Design of Magnetic Circuits",
  publisher     = "Energia Press",
  loction       = "Moscow",
  year          = "1964",
  pages         = "464",
  note          = "(in Russian)"
}

@book{IEEEexample:bookwitheditor,
  editor        = "J. C. Candy and G. C. Temes",
  title         = "Oversampling Delta-Sigma Data Converters Theory,
                   Design and Simulation",
  publisher     = "{IEEE} Press.",
  location      = "New York",
  year          = "1992"
}

@article{IEEEexample:articlelargepages,
  author        = "A. Castaldini and A. Cavallini and B. Fraboni
                   and P. Fernandez and J. Piqueras",
  title         = "Midgap Traps Related to Compensation Processes in
                   {CdTe} Alloys",
  journaltitle  = "Phys. Rev. B.",
  volume        = "56",
  number        = "23",
  year          = "1997",
  pages         = "14897-14900"
}

@article{IEEEexample:TBPmisc,
  author        = "M. Coates and A. Hero and R. Nowak and B. Yu",
  title         = "Internet Tomography",
  journaltitle  = "IEEE J. Selected Areas Commun.",
  month         = 05,
  year          = "2002",
  note          = "to be published"
}

@book{IEEEexample:book_typical,
  author        = "B. D. Cullity",
  title         = "Introduction to Magnetic Materials",
  publisher     = "Addison--Wesley",
  location      = "Reading, MA",
  year          = "1972"
}

@inbook{IEEEexample:incollectionmanyauthors,
  author        = "R. M. A. Dawson and Z. Shen and D. A. Furst and
                   S. Connor and J. Hsu and M. G. Kane and R. G. Stewart and
                   A. Ipri and C. N. King and P. J. Green and R. T. Flegal
                   and S. Pearson and W. A. Barrow and E. Dickey and K. Ping
                   and C. W. Tang and S. Van. Slyke and
                   F. Chen and J. Shi and J. C. Sturm and M. H. Lu",
  title         = "Design of an Improved Pixel for a Polysilicon
                   Active-Matrix Organic {LED} Display",
  booktitle     = "{SID} Tech. Dig.",
  volume        = "29",
  year          = "1998",
  pages         = "11-14"
}

@inproceedings{IEEEexample:presentedatconf,
  author        = "S. G. Finn and M. M{\'e}dard and R. A. Barry",
  title         = "A Novel Approach to Automatic Protection Switching
                   Using Trees",
  eventtitle    = "{IEEE} International Conference on Communications",
  location      = "Montreal, Que., Canada",
  year          = "1997"
}

@manual{IEEEexample:motmanual,
  title         = "{FLEXChip} Signal Processor ({MC68175/D})",
  organization  = "Motorola",
  year          = "1996"
}

@inbook{IEEEexample:incollection_chpp,
  author        = "P. Hedelin and P. Knagenhjelm and M. Skoglund",
  editor        = "W. B. Kleijn and K. K. Paliwal",
  title         = "Theory for Transmission of Vector Quantization Data",
  booktitle     = "Speech Coding and Synthesis",
  publisher     = "Elsevier Science",
  location      = "Amsterdam, The Netherlands",
  year          = "1995",
  chapter       = "10",
  pages         = "347-396"
}

@patent{IEEEexample:jppat,
  author        = "U. Hideki",
  title         = "Quadrature Modulation Circuit",
  type          = "patentjp",
  number        = "152932/92",
  year          = "1992-05-20"
}

@periodical{IEEEexample:periodical,
  title         = "IEEE Personal Commun. Mag., Special Issue on
                  Wireless {ATM}",
  volume        = "3",
  year          = "1996-08",
}

@misc{IEEEexample:standard,
  title         = "Wireless {LAN} Medium Access Control {(MAC)} and
                   Physical Layer {(PHY)} Specification",
  howpublished  = "{IEEE} Std. 802.11",
  year          = "1997"
}

@online{IEEEexample:electronhowinfo,
  author        = "V. Jacobson",
  title         = "Modified {TCP} Congestion Avoidance Algorithm",
  howpublished  = "end2end-interest mailing list",
  url           = "ftp://ftp.isi.edu/end2end/end2end-interest-1990.mail",
  year          = "1990-04"
}


@report{IEEEexample:techrep,
  author        = "R. Jain and K. K. Ramakrishnan and D. M. Chiu",
  title         = "Congestion Avoidance in Computer Networks with a
                   Connectionless Network Layer",
  institution   = "Digital Equipment Corporation",
  location      = "MA",
  number        = "DEC-TR-506",
  year          = "1987-08",
  type          = "techreport"
}

@article{IEEEexample:TBParticle,
  author        = "N. Kahale and R. Urbanke",
  title         = "On the Minimum Distance of Parallel and Serially
                   Concatenated Codes",
  journaltitle  = "IEEE Trans. Inf. Theory",
  note          = "submitted for publication"
}

@report{IEEEexample:techrepstdsub,
  author        = "S. Kandala",
  title         = "Changes to {A}nnex {D}",
  institution   = "{IEEE} 802.11 {TGe}",
  number        = "02/680r0",
  year          = "2002-10",
  type          = "techreport"
}

@thesis{IEEEexample:masterstype,
  author        = "A. Karnik",
  title         = "Performance of {TCP} Congestion Control with Rate
                   Feedback: {TCP/ABR} and Rate Adaptive {TCP/IP}",
  institution   = "Indian Institute of Science",
  type          = "M. Eng. thesis",
  location      = "Bangalore, India",
  year          = "1999-01"
}

@patent{IEEEexample:frenchpatreq,
  author        = "F. Kowalik and M. Isard",
  title         = "Estimateur d'un D{\'e}faut de Fonctionnement
                   d'un Modulateur en Quadrature et {\'E}tage de Modulation
                   l'Utilisant",
  language      = "french",
  type          = "French Patent Request",
  number        = "9500261",
  year          = "1995-01-11"
}

@thesis{IEEEexample:phdurl,
  author        = "Q. Li",
  title         = "Delay Characterization and Performance Control of
                   Wide-area Networks",
  institution   = "Univ. of Delaware",
  location      = "Newark, NJ",
  type          = "phdthesis",
  year          = "2000-05",
  url           = "http://www.ece.udel.edu/~qli"
}

@thesis{IEEEexample:masters,
  author        = "Nin C. Loh",
  title         = "High-Resolution Micromachined Interferometric
                   Accelerometer",
  institution   = "Massachusetts Institute of Technology",
  location      = "Cambridge, MA",
  type          = "mathesis",
  year          = "1992"
}

@online{IEEEexample:electronorgadd,
  author        = "D. H. Lorenz and A. Orda",
  title         = "Optimal Partition of {QoS} Requirements on Unicast
                   Paths and Multicast Trees",
  institution   = "Dept. Elect. Eng., Technion",
  location      = "Haifa, Israel",
  url           = "ftp://ftp.technion.ac.il/pub/supported/ee/Network/lor.mopq98.ps",
  year          = "1998-07"
}

@book{IEEEexample:book,
  author        = "S. M. Metev and V. P. Veiko",
  editor        = "Osgood, Jr., R. M.",
  title         = "Laser Assisted Microtechnology",
  edition       = "2",
  publisher     = "Springer-Verlag",
  location      = "Berlin, Germany",
  year          = "1998"
}

@report{IEEEexample:techreptypeii,
  author        = "D. Middleton and A. D. Spaulding",
  title         = "A Tutorial Review of Elements of Weak Signal Detection
                   in Non-{G}aussian {EMI} Environments",
  institution   = "National Telecommunications and Information
                   Administration ({NTIA}), U.S. Dept. of Commerce",
  type          = "NTIA Report",
  number        = "86-194",
  year          = "1986-05"
}

@inproceedings{IEEEexample:confwithpapertype,
  author        = "B. Mikkelsen and G. Raybon and R.-J. Essiambre and
                   K. Dreyer and Y. Su. and L. E. Nelson and J. E. Johnson
                   and G. Shtengel and A. Bond and D. G. Moodie and
                   A. D. Ellis",
  title         = "160 {Gbit/s} Single-channel Transmission Over 300 km
                   Nonzero-dispersion Fiber With Semiconductor Based
                   Transmitter and Demultiplexer",
  booktitle     = "Proc. {ECOC}'99",
  location      = "Nice, France",
  year          = "1999",
  pages         = "28-29"
}

@article{IEEEexample:articledualmonths,
  author        = "Y. Okada and K. Dejima and T. Ohishi",
  title         = "Analysis and Comparison of {PM} Synchronous Motor and
                   Induction Motor Type Magnetic Bearings",
  journaltitle  = "IEEE Trans. Ind. Appl.",
  volume        = "31",
  year          = "1995-09/1995-10",
  pages         = "1047-1053"
}

@unpublished{IEEEexample:unpublished,
  author        = "T. J. Ott and N. Aggarwal",
  title         = "{TCP} over {ATM}: {ABR} or {UBR}",
  howpublished  = "Unpublished"
}

@report{IEEEexample:techreptype,
  author        = "J. Padhye and V. Firoiu and D. Towsley",
  title         = "A Stochastic Model of {TCP} {R}eno Congestion Avoidance
                   and Control",
  institution   = "Univ. of Massachusetts",
  location      = "Amherst, MA",
  type          = "CMPSCI Tech. Rep.",
  number        = "99-02",
  year          = "1999",
}

@book{IEEEexample:inbook,
  author        = "H. E. Rose",
  title         = "A Course in Number Theory",
  publisher     = "Oxford Univ. Press",
  location      = "New York",
  year          = "1988",
  chapter       = "3"
}

@patent{IEEEexample:uspat,
  author        = "Ronald E. Sorace and Victor S. Reinhardt and
                   Steven A. Vaughn",
  holder        = "Hughes Aircraft Company",
  location      = "Los Angeles, CA",
  title         = "High-Speed Digital-to-{RF} Converter",
  type          = "patentus",
  number        = "5668842",
  yearfiled     = "1995-02-28",
  year          = "1997-09-16",
}

@inbook{IEEEexample:incollection,
  author        = "W. V. Sorin",
  editor        = "D. Derickson",
  title         = "Optical Reflectometry for Component Characterization",
  booktitle     = "Fiber Optic Test and Measurement",
  publisher     = "Prentice--Hall",
  location      = "Englewood Cliffs, NJ",
  year          = "1998"
}

@online{IEEEexample:electronhowinfo2,
  author        = "V. Valloppillil and K. W. Ross",
  title         = "Cache Array Routing Protocol v1.1",
  howpublished  = "Internet draft",
  url           = "http://ds1.internic.net/internet-drafts/draft-vinod-carp-v1-03.txt",
  year          = "1998"
}

@inproceedings{IEEEexample:confwithpaper,
  author        = "M. Wegmuller and J. P. von der Weid and P. Oberson
                   and N. Gisin",
  title         = "High Resolution Fiber Distributed Measurements With
                   Coherent {OFDR}",
  booktitle     = "Proc. {ECOC}'00",
  year          = "2000",
  location      = "Munich, Germany",
  pages         = "109"
}

@inproceedings{IEEEexample:confwithvolume,
  author        = "M. Yajnik and S. B. Moon and J. Kurose and D. Towsley",
  title         = "Measurement and Modeling of the Temporal Dependence in
                   Packet Loss",
  booktitle     = "Proc. {IEEE} {INFOCOM}'99",
  volume        = "1",
  location      = "New York",
  year          = "1999-03",
  pages         = "345-352"
}

@inproceedings{IEEEexample:confwithadddays,
  author        = "M. S. Yee and L. Hanzo",
  title         = "Radial Basis Function Decision Feedback Equaliser
                   Assisted Burst-by-burst Adaptive Modulation",
  booktitle     = "Proc. {IEEE} Globecom '99",
  address       = "Rio de Janeiro, Brazil",
  year          = "1999-12-05/1999-12-09",
  pages         = "2183-2187"
}
\end{filecontents}

\addbibresource{\jobname.bib}
\nocite{*}

\clearplainmark{bib}

\usepackage{extramarks,lastpage,refcount}

\setrefcountdefault{-1}

\newcommand*{\newlastright}{\relax}
\def\newmark{\relax}
\AtEveryBibitem{%
  \markboth{\thefield{labelalpha}}{\thefield{labelalpha}}%
  \extramarks{\thefield{labelalpha}}{\newmark}% <-- an improvement
  \xdef\newmark{\thefield{labelalpha}}%
}

\newcommand{\dictionarymark}{%
% is the test necessary? when will \leftmark and \rightmark be equal..?
  \ifdefequal{\leftmark}{\rightmark}{\rightmark}{%
    \ifnum \value{page} = \getpagerefnumber{LastPage}
        \topxmark\ -- \newmark
      \else
        \topxmark\ -- \lastrightxmark
      \fi}}

\makeevenhead{ruled}{\scshape Bibliography}{}{\dictionarymark}
\makeoddhead{ruled}{\dictionarymark}{}{\scshape Bibliography}
\pagestyle{ruled}

\begin{document}

\printbibliography[heading=bibintoc]

\end{document}
share|improve this answer

This is difficult to do automatically. Getting the correct 'last' mark on the page is frustratingly difficult. The package extramarks can get you close (given your example file):

\usepackage{extramarks}  
\AtEveryBibitem{%        
  \markboth{\thefield{labelalpha}}{\thefield{labelalpha}}%        
  \extramarks{\thefield{labelalpha}}{\thefield{labelalpha}}% <-- an improvement 
}

\newcommand{\dictionarymark}{% 
% is the test necessary? when will \leftmark and \rightmark be equal..?
  \ifdefequal{\leftmark}{\rightmark}{\rightmark}{\firstrightxmark\ -- \lastrightxmark}}    

\makepagestyle{dict}
\makeevenhead{dict}{Bibliography}{}{\dictionarymark}
\makeoddhead{dict}{\dictionarymark}{}{Bibliography} 
\pagestyle{dict}

The use of the extramarks helps, but syncing things up with the way pages are broken is difficult...

share|improve this answer
    
This doesn't work for me. Could you post the full code? Maybe I'm putting it in the wrong place. Basically, I get [2nd label on this page] - [1st label on next page] except on the last page where I get [2nd label] - [last label]. So neither label is correct. fancyhdr claims this is 'easy' but I tried their code to no avail. (I changed the class to book etc. to test.) –  cfr Feb 6 at 0:57
    
@cfr -- I should have left uncommented the \markboth: that gives you the correct entry for the \firstrightxmark. However, your observation is essentially my point: it is very difficult to get the correct 'mark'/'marks' read at the right time. The same problem can be seen sometimes in biblatex bibliographies where the -------. used for marking the same author should not be used at the top of a page; sometimes it nevertheless is. (The reason I posted only a snippet is to stress that this is not a complete answer.) –  jon Feb 6 at 1:08
    
Thanks. I knew you said that. Just I figured you expected the other part of the labelling to work else it would be weird to only point out the problem with the other! –  cfr Feb 6 at 1:10
    
@cfr -- YOu're absolutely right to point it out the inconsistency! Due to my own frustration with this problem, which was compounded because of another time I unsuccessfully looked into this issue, I forgot to undo one of my experiments with \markboth... –  jon Feb 6 at 1:13
    
My answer is essentially a tweaked version of yours. If you would rather tidy it up and edit yours, let me know and I will delete mine. I don't feel it is fair to essentially steal your work, add a couple of things and then post it but I thought it would be a shame for it not to be posted at all because it does seem to work. (Although I suspect it is quite fragile.) –  cfr Feb 6 at 3:40

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.