olsak / OpTeX

OpTeX - LuaTeX format with extended Plain TeX macros
http://petr.olsak.net/optex/
35 stars 14 forks source link

[bug] "undefined control sequence" error with an "incollection" bibliography entry #44

Closed neumannjan closed 3 years ago

neumannjan commented 3 years ago

Hello,

I am continuously getting errors with the use of a BibTex .bib file generated by Zotero. I am getting an "undefined control sequence" error regardless of whether I use the simple style or the iso690 style. I do get some other error messages as well.

All of these errors appear to be related to the following @incollection entry:

@incollection{cavadas_electric_2014,
  title = {Electric {{Vehicles Charging Network Planning}}},
  booktitle = {Computer-Based {{Modelling}} and {{Optimization}} in {{Transportation}}},
  author = {Cavadas, Joana and Correia, Gon{\c c}alo and Gouveia, Jo{\~a}o},
  editor = {{de Sousa}, Jorge Freire and Rossi, Riccardo},
  year = {2014},
  pages = {85--100},
  publisher = {{Springer International Publishing}},
  address = {{Cham}},
  doi = {10.1007/978-3-319-04630-3_7},
  abstract = {In this chapter we propose a method to plan the location of charging stations for electric vehicles (EV) in a city in which the objective is to maximize the number of satisfied vehicles under a fixed budget for building the stations. We take into consideration the maximum capacity of each possible site for installing a station, in terms of the number of plugs that each one can have, and the distance from that location and each demand point, which is measured in walking time. To be able to apply these models, we develop a charging demand model for based on parking data, considering that the higher the parking time, the greater the probability of charging. We also take in consideration the relation between the demand at different points, e.g., if a vehicle can charge at home, the probability of needing to charge at work will be significantly reduced. We test our mathematical models for the case of the city of Coimbra, where there is already a network of charging stations. We first use an existing mobility survey to extract parking data and establish a demand grid, and then we apply the models that gives us the optimal location for charging stations for the entire city allowing us to compare both.},
  file = {/home/nojmy/Zotero/storage/FJ9SE6V8/Cavadas et al_2014_Electric Vehicles Charging Network Planning.pdf},
  isbn = {978-3-319-04630-3},
  keywords = {Charging demand,Charging stations planning,Electric vehicle,Mixed integer problem},
  language = {en},
  series = {Advances in {{Intelligent Systems}} and {{Computing}}}
}

The errors appear only if \cite[cavadas_electric_2014] is present somewhere. Otherwise, the compilation produces no errors, only warnings.

I noticed that both files bib-simple.opm and bib-iso690.opm seem to have incollection misspelled (see here and here). However, even if I fix the spelling in these files, I still get an "undefined control sequence" error with the aforementioned entry.

Additional info

Thank you for your help.

neumannjan commented 3 years ago

Update: It seems that the "author" field is the core of the problem - possibly the accents in the authors' names

cao- commented 3 years ago

You should use the appropriate unicode characters for the accents, or use the \oldaccents command. These commands are undefined by default in OpTeX.

neumannjan commented 3 years ago

You should use the appropriate unicode characters for the accents, or use the \oldaccents command. These commands are undefined by default in OpTeX.

Thank you!

olsak commented 3 years ago

Zotero suspects that it generates the output for ancient BibTeX system (from 1987), but we are using Unicode system. Is is useable to remove all such old habits and replace non-Unicode obscure sequences to Unicode (using a preprocessor, for example). Your line from .bib file should be

author = {Cavadas, Joana and Correia, Gonçalo and Gouveia, João},

Another worarounfd is to use {\oldaccents \usebib/s (simple) bib } but I reccommend to use first case.

Warning, the letters have to be "direct letters", no "Unicode composite letters", because they are not supported in all Unicode fonts.