2

I have one problem with this code and special characters:

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[semicolon]{natbib}
\usepackage{har2nat}

\newcommand{\avec}{\qquad \text{avec} \qquad}
\renewcommand{\harvardurl}[1]{\unpenalty\unskip\unpenalty}%remove url

\makeatletter
\let\x@bibitem\bibitem% store original \bibitem
\def\x@getfirst#1#2\endgetfirst{#1}% macro that returns the first letter/token of its argument
\def\x@bibalph{}% previous first letter, initiated to nothing
\def\bibitem[#1]{% new bibitem
  \edef\x@bibalphtest{\x@getfirst#1\endgetfirst}% get the new first letter
  \ifx\x@bibalphtest\x@bibalph\else % if the first letter changed
    \let\x@bibalph\x@bibalphtest% update
    \subsection*{\x@bibalph}% and make the \subsection
  \fi
  \x@bibitem[#1]% start the \bibitem itself
}
\makeatother

\begin{document}
\nocite{*}
\bibliographystyle{agsm}
\bibliography{libraryC2}
\end{document}

(The source of the code between \makeatletter and \makeatother is this answer.)


The code is supposed to print an unnumbered subsection-level header, consisting of a single letter (A, B, C, ...), whenever the alphabetical order changes in the bibliography. Unfortunately, the code appears to think that upper- and lowercase letters are different, and that's why there are currently 4 subgroups for the 6 references that start with the letter "V":

V - v - V - v 

enter image description here

The second problem is that the code gets tripped up if a surname starts with an "accented" character. E.g., the surname Černe gets entered as {\v C}erne for BibTeX purposes. In my bibliography, the "{\v C}erne et al" entry should be in the same group -- viz., "C" -- as the "Callon et al" and "Chae" entries. Currently, though, the code is not sophisticated enough to "realize" that {\v C} should be treated as C.

enter image description here

Question: How should the code between \makeatletter and makeatother be adjusted to make it insensitive to capitalization and to the presence of "accented" characters in the first letter of the first author's surname?


This is the file libraryC2.bib; it contains entries with authors whose surnames begin with C, D, and V. (The bib database is stored in Mendeley.)

@article{Callon1983,
  author   = "Callon, M. and Courtial, J.-P. and Turner, W. A.
              and Bauin, S.",
  doi      = "10.1177/053901883022002003",
  issn     = "0539-0184",
  journal  = "Social Science Information",
  number   = 2,
  pages    = "191--235",
  publisher= "SAGE Publications",
  title    = "From translations to problematic networks: An
              introduction to co-word analysis",
  volume   = 22,
  year     = 1983,
}

@article{Cerne2016,
  author   = "{\v C}erne, Matej and Ka{\v s}e, Robert and 
              {\v S}kerlavaj, Miha",
  doi      = "10.1016/j.scaman.2016.02.001",
  issn     = 09565221,
  journal  = "Scandinavian Journal of Management",
  keywords = "Co-citation analysis,Innovation,Non-technological
              innovation,Quantitative literature review,Social
              network analysis-island algorithm",
  number   = 2,
  pages    = "69--85",
  title    = "Non-technological innovation research: Evaluating
              the intellectual structure and prospects of an
              emerging field",
  volume   = 32,
  year     = 2016,
}

@article{Chae2012a,
  author   = "Chae, Bongsug",
  doi      = "10.1080/02642069.2010.545390",
  isbn     = "0264-2069",
  issn     = 02642069,
  journal  = "Service Industries Journal",
  keywords = "BUSINESS planning,BUSINESS service
              centers,COMPETITIVE advantage,CUSTOMER
              services,PROFESSIONAL corporations,STRATEGIC
              planning,complexity theory,knowledge-intensive
              business service,new solution development",
  number   = 1,
  pages    = "127--149",
  title    = "A framework for new solution development: an
              adaptive search perspective",
  volume   = 32,
  year     = 2012,
}

@article{DeReuver2017,
  author   = "de Reuver, Mark and Ondrus, Jan",
  doi      = "10.1016/j.telpol.2017.01.004",
  issn     = 03085961,
  journal  = "Telecommunications Policy",
  keywords = "Digital platforms,Ecosystems,Mobile
              payment,Multi-sided platforms,Secure element",
  pages    = "1--10",
  publisher    = "Elsevier",
  title    = "When technological superiority is not enough: The
              struggle to impose the {SIM} card as the {NFC}
              Secure Element for mobile payment platforms",
  year     = 2017,
}

@article{desolla1966,
  author   = "De Solla Price, D. J. and Beaver, D.",
  doi      = "10.1037/h0024051",
  issn     = "1935-990X",
  journal  = "American Psychologist",
  keywords = "COMMUNICATION \& COLLABORATION",
  number   = 11,
  pages    = "1011--1018",
  publisher    = "American Psychological Association",
  title    = "Collaboration in an invisible college",
  volume   = 21,
  year     = 1966,
}

@book{DeVaujany2015b,
  author   = "de Vaujany, Fran{\c c}ois-Xavier",
  isbn     = "978-2-7637-2655-7",
  pages    = 110,
  publisher    = "Presses Universit{\'e} Laval",
  title    = "Sociomat{\'e}rialit{\'e} et information dans les
              organisations: entre bonheur et sens?",
  year     = 2015,
}

@article{Demirkan2015a,
  author   = "Demirkan, Haluk and Spohrer, Jim",
  doi      = "10.5437/08956308X5805007",
  issn     = 08956308,
  journal  = "Research Technology Management",
  number   = 5,
  pages    = "12--15",
  title    = "T-Shaped Innovators: Identifying the Right Talent
              to Support Service Innovation",
  volume   = 58,
  year     = 2015,
}

@article{DenHertog2008,
  author   = "Den Hertog, Pim and Rubalcaba, Luis and Segers,
              Jeroen",
  journal  = "International Journal of Services Technology and
              Management",
  keywords = "R\&D and innovation,Reference,innovation
              policy.,market failures,services,systemic
              failures",
  number   = "3/4",
  pages    = "334--354",
  title    = "Is there a rationale for services {R\&D} and
              innovation policies?",
  volume   = 9,
  year     = 2008,
}

@article{Djellal2003,
  author   = "Djellal, Faridah and Gallouj, Camal and Gallouj,
              Fa{\" i}z",
  journal  = "Economies et Soci{\'e}t{\'e}s. S{\'e}rie EGS,
              Economie et gestion des services",
  pages    = "1979--1999",
  title    = "L'innovation dans les services et par les services:
              un bilan des travaux fran{\c c}ais r{\'e}cents
              (1999--2002)",
  year     = 2003,
}

@article{VandeVen1995,
  author   = "Van de Ven, A. H. and Poole, M.S.",
  doi      = "10.5465/AMR.1995.9508080329",
  isbn     = 03637425,
  issn     = "0363-7425",
  journal  = "The Acadeny of Management Review",
  number   = 3,
  pages    = "510--540",
  pmid     = 181,
  title    = "Explaining development and change",
  volume   = 20,
  year     = 1995,
}

@inproceedings{Broek2015,
  author   = "van den Broek, Tijs and van Veenstra, Anne Fleur",
  isbn     = 9783000502842,
  booktitle= "Twenty-Third European Conference on Information
              Systems (ECIS), M{\"u}nster, Germany, 2015",
  keywords = "Big Data,Data Sharing,ELSS -
              Earth,Governance,Informatics,Information
              Society,Infostructures,Inter,Life and Social
              Sciences,SP2,Strategy \& Policy 2,Urban Mobility
              \& Environment,organisational Collaborations",
  pages    = "1--12",
  title    = "Modes of governance in inter-organisational data
              collaborations",
  year     = 2015,
}

@article{VanDerAa2002,
  author   = "Van Der Aa, Wietze and Elfring, Tom",
  doi      = "10.1016/S0956-5221(00)00040-3",
  isbn     = "0956-5221",
  issn     = 09565221,
  journal  = "Scandinavian Journal of Management",
  keywords = "Client as co-producer,Multi-unit organization,New
              combinations,Organizational
              innovations,Supporting processes,Technological
              innovations",
  number   = 2,
  pages    = "155--171",
  title    = "Realizing innovation in services",
  volume   = 18,
  year     = 2002,
}

@article{Vargo2008,
  author   = "Vargo, Stephen L. and Maglio, Paul P. and Akaka,
              Melissa Archpru",
  doi      = "10.1016/j.emj.2008.04.003",
  isbn     = "0263-2373",
  issn     = 02632373,
  journal  = "European Management Journal",
  keywords = "Service science,Service system,Service-dominant
              logic,Value
              co-creation,Value-in-exchange,Value-in-use",
  mendeley-tags= "Service science,Service system,Service-dominant
              logic,Value
              co-creation,Value-in-exchange,Value-in-use",
  month    = "jun",
  number   = 3,
  pages    = "145--152",
  title    = "On value and value co-creation: A service systems
              and service logic perspective",
  volume   = 26,
  year     = 2008,
}

@article{Vergori2014,
  author   = "Vergori, Anna Serena",
  doi      = "10.1080/02642069.2013.763343",
  issn     = 02642069,
  journal  = "Service Industries Journal",
  keywords = "ASSIMILATION theory (Cognitive learning
              theory),INDUSTRIAL surveys,INNOVATION
              management,INNOVATIONS in
              business,RESEARCH,SERVICE industries --
              Research,innovation,surveys",
  number   = 2,
  pages    = "145--161",
  title    = "Measuring innovation in services: the role of
              surveys",
  volume   = 34,
  year     = 2014,
}

@article{Brocke2015,
  author   = "vom Brocke, Jan and Simons, Alexander and Riemer,
              Kai and Niehaves, Bj{\"o}rn and Plattfaut, Ralf
              and Cleven, Anne",
  isbn     = 15293181,
  issn     = 15293181,
  journal  = "Communications of the Association for Information
              Systems",
  keywords = "Dissertation Review,Information Systems,Literature
              Review,Literature Search,Systematic Literature
              Review",
  number   = 1,
  pages    = "205--224",
  pmid     = 109101530,
  title    = "Standing on the Shoulders of Giants: Challenges and
              Recommendations of Literature Search in
              Information Systems Research",
  volume   = 37,
  year     = 2015,
}
Mico
  • 506,678
VictorD
  • 31
  • Welcome to TeX.SE. I'm afraid it's not clear what your posting is about. What exactly is the problem? Incidentally, your bib file is quite a mess; sorry to have to be so blunt. For instance, there are 13 [!] repeated entries. There are a ton of entries that are missing one or more fields; in many cases, that's an indication that you're using the wrong entry type (e.g., @article instead of @book). There are 220 [!!] instances of $\backslash$n, which should almost certainly be replaced with ("space"). I think you really owe it to yourself and your readers to sort out these issues. – Mico Feb 28 '18 at 15:49
  • Thanks @Mico. I could print drop cap (a, b, c ...) when the alphabetical order changes in the bibliography. I need to group the references in large blocks instead of making several subgroups. for example the code created 5 subgroups for the references with D:
    1. D
    2. d,
    3. De vries
    4. De solla price
    5. D
    – VictorD Feb 28 '18 at 18:57
  • 1
    Did you try any of the solutions in the linked question using Biblatex/Biber? That's probably the way to go here, if you can, though it won't fix problems in the .bib itself. In any case, please provide enough bibliography entries in your question for people to reproduce without needing to tangle with dropbox, which many of us won't do. – cfr Mar 01 '18 at 01:53
  • Hello @cfr I am not trying to solve the problems of the .bib file. This is not the question. I have edit the question. I have provide enough bibliography entries. – VictorD Mar 01 '18 at 08:16
  • 2
    Thanks. I know you didn't ask about the .bib file, but the problems @Mico pointed out will prevent you from getting the correct results and will complicate your efforts to determine what is causing oddities in the output. That is, you can't expect to get sensible output if you don't feed in sensible input. That's not necessarily related to the issue you're asking about, although inconsistent mark-up of names might possibly be part of the cause, but still presumably important to you actual purposes :-). – cfr Mar 01 '18 at 17:14
  • Hello guys. I modified the post. Please, you can copy and paste the code to see the result. For example, I would like a single group of "Ds" for D, D, De Vries, De solla price, D. – VictorD Mar 01 '18 at 20:33
  • Thaks @cfr. I have modify the post. Apologize for my mistakes in english. – VictorD Mar 01 '18 at 20:36
  • @Mico I have edit the post. – VictorD Mar 01 '18 at 20:37
  • 4
    Some of the problems are the direct result of poor coding practices. E.g, writing {Van de Ven}, A. H. is just pointless and is asking for trouble. Write Van de Ven, A. H., etc and you'll be fine. It really isn't good practice to wantonly add brace groups in a bib file. – Mico Mar 01 '18 at 21:36
  • 1
    I've taken the liberty of editing your posting further, both to simplify the exposition (and the LaTeX code) and to pose the question you wish to answer much more directly. I hope you're OK with that. – Mico Mar 01 '18 at 22:27
  • 1
    Hello @Mico! Thaks a lot for your edition and corrections in latex code and question. Great! I use sharelatex with Mendeley integration for references management (I have more of 1500 references, book or articles, in pdf ou djvu format). The bib file is generated automatly by Mendeley. – VictorD Mar 02 '18 at 07:54
  • @Vied'Ord'Heureux - You're welcome. Note that I also edited the bib file, to get rid of the counterproductive pairs of curly braces. I'd say that you need to figure out how to instruct Mendeley to stop placing those counterproductive pairs of curly braces around certain surnames. If you can't figure it out, you should seriously consider ditching Mendeley entirely and finding a different software package to manage your bibliography database. – Mico Mar 02 '18 at 07:58
  • @Vied'Ord'Heureux - In case you're curious about how I formatted and pretty-printed the entries in the bib file: I use the winedt editor; from winedt.org, I downloaded a suite of macros that do all kinds of neat stuff with bib files (including pretty-printing and sorting!). With these macros, I simply never find a need to use software such as Mendeley or jabref to "manage" the contents of my own personal bib file, which I've maintained over the year and which grown to comprise several thousand entries in the meantime. Without the BibMacros suite, though, I couldn't manage as well. – Mico Mar 02 '18 at 08:44
  • 1
    @mico Thanks for the information about winedt. I am testing the software that you propose. I have report this issue to Mendeley. – VictorD Mar 02 '18 at 14:49
  • @yo' Can you help me please ? This is your code – VictorD Mar 02 '18 at 15:24
  • @sudosensei Have you found a solution for your old question about author names that have letter whit an accented character? '\IeC {\r A}' ? – VictorD Mar 02 '18 at 15:30
  • @Marco Daniel can you see this question please ? – VictorD Mar 02 '18 at 15:34

1 Answers1

0

The solution I found for Accented Characters to be alphabetised in the list correctly is through the use of the newcommand option:

For Example:

\newcommand\As[1]{\r{#1}}

Can be added into the tex script at the start of the document to define a new alphabetically correct command.

In the case above the \r{...} puts a circle accent above whichever letter that was input. Since my reference would have been \r{A}strom in the author field the alphabetical ordering would be incorrect.

Instead with the newcommand \As{...} the alphabetical order is correct.

I just used \As to meet my needs as the reference demanded but you could theoretically use any letters to represent the new command.

Warning - Check that the letters you intend to use are not already used for another command name as this could cause unexpected results. Adding more letters to the command can alleviate this problem.