I am in an incredibly frustrating situation - after weeks and weeks of editing my dissertation in Latex, the inevitable error that just doesn't seem to make any sense has surfaced. I get the error "Command \k unavailable in encoding OT1," whatever this means and it tells me the error is on line 538. I commented out that entire section where I call in the figure (lines 537-543) and compile again only to get the exact same error, for the same line. I have not touched anything near line 538 in a while, since I've been editing things later in my disseration. I've also tried commenting out half of the document, including the newest portion that I've written, and I get the same error on line 538. This error seems to have actually appeared from nowhere. Has anybody ever gotten this or know how to resolve it? Your help will be a life-saver. Thanks.

Screenshot of the error with specified line shown

  • 3
    Welcome to TeX.SX! The bottom line of your screenshot suggests the \k is in the bibliography. Why not just adding \usepackage[T1]{fontenc] to your document preamble? – egreg Sep 19 '17 at 21:58
  • Line 538 can be line 538 in any input file. – Ulrike Fischer Sep 19 '17 at 22:01
  • Thanks, I just saw both of these comments. I am a newer user to Latex so now I know that the error can be in another input file like the .bib file, and the suggestion you gave was also the fix egreg! Thanks guys! – Adam Lu Sep 19 '17 at 22:32

The error happens when LaTeX is reading line 538 in the bibliography file, probably generated by BibTeX.

The entry refers to an author named

Patrycja Dynarowicz-Łątka

(a chemist at the Jagellonian University in Kraków) whose name, in BibTeX-speak, becomes Dynarowicz-{\L}{\k{a}}tka, where you see \k.

Just add


to your document preamble.

  • Short response: this worked, thank you SO very much! Long response: I compiled the document so many times before, and that reference was used well before my new chapter I'm currently editing (it was used in the previous chapters) - so do you know why this issue just now caused Latex to error? I'm hoping I do not run into similar issues down the road. Again, your suggestion to add the package to my preamble worked, thank you very much for your help! – Adam Lu Sep 19 '17 at 22:19
  • Did you add any new packages to the preamble, or change the document fonts? If you don't tell us exactly what you changed, we are just guessing what might have happened. – alephzero Sep 19 '17 at 22:47
  • @AdamLu Probably you added the reference with the Polish name. – egreg Sep 19 '17 at 22:48
  • To clarify, I added "\usepackage[T1]{fontenc}" to my preamble and this was the solution to my problem. – Adam Lu Sep 22 '17 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.