0

I am getting following error when trying to use external bibliography library:

Package biblatex Error: Patching 'babel' package failed. \begin{document}

From what I know, this is probably caused by a bug. However, I didn't find any suitable solutions. I am using TeXstudio (Windows) and installing packages is quite difficult. Whenever I find out I need a new package, I need to install it before the document can be compiled. Basically I am installing new packages on the fly. Could it be caused by incomplete libraries? Should I reinstall TeXstudio?

This is how TeXstudio looks like on Windows: TeXstudio workspace

This is my preamble in lab01.tex (before \begin{document}):

\documentclass[12pt,twoside,a4paper]{article}
\usepackage[czech]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{float}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{attachfile}
\usepackage{subcaption}
\usepackage{cleveref}
\usepackage[document]{ragged2e}
\usepackage{textcomp}
\usepackage{gensymb}

\usepackage[
backend=biber,
style=alphabetic,
citestyle=authoryear
]{biblatex}
\addbibresource{lab01.bib}

\usepackage{siunitx}
\sisetup{
    detect-mode,
    detect-family,
    detect-inline-family=math,
    group-separator={.},
    group-minimum-digits={3},
    output-decimal-marker={,}
}

\captionsetup[subfigure]{subrefformat=simple,labelformat=simple}
\renewcommand\thesubfigure{(\alph{subfigure})}

\title{Výkonové polovodičové systémy~I \textemdash\ Laboratorní úloha č.~1\\ \large \emph{Řízený dvoupulzní usměrňovač}}
\author{Marek Poláček (POL0423)\\ VŠB \textendash\ Technická univerzita Ostrava,\\ Fakulta elektrotechniky a~informatiky.}
\date{\today}

This is content of lab01.bib:

@book{book:ZČU,
    author = {VONDRÁŠEK, František},
    title = {Výkonová elektronika},
    date = {1998},
    volume = {svazek~II},
    publisher = {Západočeská univerzita},
    location = {Plzeň},
    isbn = {80-7082-485-9},
}

@book{book:ČVUT,
    author = {PAVELKA, Jiří a~ÚČEŘOVSKÝ Zdeněk},
    title = {Výkonová elektronika},
    date = {2000},
    edition = {Vydání~2.},
    publisher = {ČVUT},
    location = {Praha},
    isbn = {80-01-02094-0},
}
Polda18
  • 31
  • See https://tex.stackexchange.com/a/529993/2388 – Ulrike Fischer Mar 26 '20 at 17:58
  • @PhelypeOleinik This solved my issue, I guess. I mean there are other errors (like missing images, etc.), but the document isn't finished yet. From what I've read from suggestion by @UlrikeFischer, the biblatex package doesn't support active hyphen (which Czech babel uses). I don't know what it will do with the bibliography when inserted into the document later, so I'll also investigate other solutions. I'll save both of the solutions for later use and if something doesn't work again, I can refer to them at that time. Thank you for your help. – Polda18 Mar 26 '20 at 19:04
  • @Polda18 No, the document will work normally. biblatex doesn't expect an active hyphen there (where it should be a normal -). The patch proposed just replaces a normal - (in a file name) by \my@hyphen, which is harmless. In the document active hyphens behave normally. – Phelype Oleinik Mar 26 '20 at 19:35
  • Note that multiple authors must always be separated with an and in the .bib file regardless of the desired output. I would also not use all caps for family names in the .bib file. If desired you can let the style handle that. So I suggest to replace author = {PAVELKA, Jiří a~ÚČEŘOVSKÝ Zdeněk}, with author = {Pavelka, Jiří and Účeřovský, Zdeněk},. The style combination style=alphabetic, citestyle=authoryear, is also a bit unusual, since the bibliography will feature alphabetic labels that are not used anywhere else in the document (citations are author-year). – moewe Mar 26 '20 at 19:41
  • @UlrikeFischer So I've looked into it, and it doesn't seem to work properly: https://ctrlv.cz/Lrir - This is what I'm using right now: \usepackage[shorthands=off,czech]{babel}. – Polda18 Mar 29 '20 at 07:47
  • It's worth of note that I'm basically a beginner to LaTeX, a lot of things just fly right past me... – Polda18 Mar 29 '20 at 07:50
  • With \usepackage[shorthands=off,czech]{babel} the preamble you posted in the question will no longer produce the error Package biblatex Error: Patching 'babel' package failed. It may well be that there are other problems you are experiencing, but you need to tell us what errors you get or how the result otherwise is not what you expect. I will not download files from third-party pages such as https://ctrlv.cz/Lrir. All the code needed to investigate your problem should be in the question. – moewe Mar 29 '20 at 09:06
  • @moewe There's no need to download any file, it is merely just a screenshot. I can't upload files to comments, and I don't think I can upload them to question eighter (apart from images). To answer your question about errors. Yes, it did get rid of the biblatex error, but there is no bibliography in the place it should be (just a section title I put there), this is what I am using right now: \usepackage[style=iso-numeric]{biblatex}. – Polda18 Mar 29 '20 at 11:33
  • Do not post error messages as image: Copy them from the .log file directly and post them as text. – moewe Mar 29 '20 at 11:35
  • @moewe And how do I enter them properly into comments? From what I know, comments do not support line breaks, or do they? Anyway:
    I found no \citation commands---while reading file lab01.aux
    I found no \bibdata command---while reading file lab01.aux
    I found no \bibstyle command---while reading file lab01.aux
    (There were 3 error messages)
    ``` No, it doesn't suppor line breaks :(
    
    – Polda18 Mar 29 '20 at 11:37
  • Ah! That message means that you run BibTeX, but for biblatex you need to run Biber: https://tex.stackexchange.com/q/63852/35864 – moewe Mar 29 '20 at 11:38
  • @moewe Okay. How can I configure TeXstudio to use biber instead? I have set biblatex as the bibliography format in the editor. https://ctrlv.cz/cTzg - don't worry, just a screenshot. – Polda18 Mar 29 '20 at 11:41
  • https://tex.stackexchange.com/q/154751/35864 (I meant to post that link before, but took the wrong link). – moewe Mar 29 '20 at 11:42
  • @moewe Okay, thank you, that solved it :) – Polda18 Mar 29 '20 at 11:46

0 Answers0