I am trying to compile a bibliography that will not accept someone's name that has an ogonek in it. I am not using \k, which I need for something else, so I did \let\ogonek\k and \newcommand{\eogonek}{\ogonek{e}} because at one point BibTeX had a problem with anything beginning with \o. The .bbl file that is produced begins with
\begin{thebibliography}{{St{\}}02}
which begins the person's name (the nonsense {\} is where the e-ogonek should be), and then the bibliography won't compile because it's missing a }. I understand this is supposed to be a width parameter at the beginning, and I can replace it with another name, as well as the \bibitem which is similarly broken, but I would just like to be able to compile normally without editing the .bbl manually every time.
I do have \usepackage[T1]{fontenc} amongst various other things. This once worked on another system. I am using MacTeX at present.
EDIT: I have finally put together an MWE. Here is the .tex file:
\documentclass{article}
\usepackage[T1]{fontenc}
\let\ogonek\k
\newcommand{\eogonek}{\ogonek{e}}
\renewcommand {\k} {k}
\bibliographystyle{alphaurl}
\begin{document}
St{\ogonek{e}}pie{\'n}~\cite{stepien2002formal} showed...
\bibliography{bibshort}
\end{document}
Here is the relevant portion of the .bib file:
@article{stepien2002formal,
author = "{St{\eogonek}pie{\'n}}, Zofia",
journal = "Geom. Dedicata",
number = "1",
pages = "37--45",
publisher = "Springer",
title = "{On formality of a class of compact homogeneous spaces}",
volume = "93",
year = "2002",
doi = "10.1023/A:102031393"
}
I compile this with the path txs:///pdflatex | txs:///bibtex | txs:///pdflatex | txs:///pdflatex | txs:///view-pdf.
The resulting .bbl file is the following.
\begin{thebibliography}{{St{\}}02}
\bibitem[{St{\}}02]{stepien2002formal}
Zofia {St{\eogonek}pie{\'n}}.
\newblock {On formality of a class of compact homogeneous spaces}.
\newblock {\em Geom. Dedicata}, 93(1):37--45, 2002.
\newblock \href {http://dx.doi.org/10.1023/A:102031393}
{\path{doi:10.1023/A:102031393}}.
\end{thebibliography}
The mismatch in numbers of braces cause these errors, as recorded in the .log:
(./bib_ogonek_min.bbl)
Runaway argument?
{{St{\}}02} \par \bibitem [{St{\}}02]{stepien2002formal} Zofia {St{\eogonek \ET
C.
! File ended while scanning use of \thebibliography.
<inserted text>
\par
l.9 \bibliography{bibshort}
I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.
! LaTeX Error: \begin{thebibliography} on input line 1 ended by \end{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.10 \end{document}
Thank you for your patience.
\k“for something else” is the issue. You can't use it for something else, because you do need it in the bibliography. Never ever redefine kernel commands with short names. – egreg Dec 04 '18 at 08:38\begin{thebibliography}, but I can easily provide an example of why naively redefining\kis a very bad idea. – egreg Dec 04 '18 at 08:50title = "{On formality of a class of compact homogeneous spaces}",. In this case there is no reason for the braces since there is nothing to be protected from case change (everything but the first letter is lower-case already) and in general it is much better to only protect the specific words that need to be protected from a case change rather than the entire title because that just disables the entire case changing function of BibTeX. See also https://tex.stackexchange.com/q/10772/35864. – moewe Jan 04 '19 at 17:07title-like fields are affected. Hence onlytitlefields need brace protection. I know of no style that would apply case change to name fields (and I believe that would be a very bad idea). So you should never have to protect names with braces (except corporate names https://tex.stackexchange.com/q/10808/35864). Braces change the 'brace level', which is important for stuff like https://tex.stackexchange.com/q/57743/35864. – moewe Jan 04 '19 at 17:10<field> = {<value>},as (in my eyes preferable) syntax forfield = "<value>",. I'm talking about braces within the field value. – moewe Jan 04 '19 at 17:11title = {...}andtitle = "..."respectively. Your last comment is meant to clarify that the outermost braces around your<value>are interpreted differently than the kind of braces which protect from case change and can be overused? – jdc Jan 05 '19 at 07:14<field> = {<value>},and<field> = "<value>",. The two forms are mostly interchangeable, but there are subtle differences between the two w.r.t. the behaviour when"appears in<value>(and I strongly prefer<field> = {<value>},with braces, that's not the point of my comment, though). Whether or not you use braces there as value delimiter does not influence the brace level that does the case change. – moewe Jan 05 '19 at 07:19