0

PROBLEM SOLVED, SEE EDITS 2 AND 3.

so i have several files written in bulgarian that are set up to compile into one PDF however in the process of doing so, several errors popped up despite me compiling the files individually before with no issue whatsoever

first of all, when using \tableofcontents the file wounldn't build and texstudio would return errors like this instead

Command \CYRO unavailable in encoding OT1. ...C {\cyre }\IeC {\cyrm }\IeC {\cyri } }{7}{} problem is i'm not even using encoding OT1, but T2A and X2. removing talbeofcontents let the file build successfuly, however that bring us to my second issue

the font on tings like chapters, sections and certain symbols is replaced with this odd font

enter image description here

copying the text and pasting it somewhere else displays the text as saying "chapter 1" even though the text for everything should be in bulgarian

EDIT: upon further inspection, all latin characters seem to be affected, but none in cyrillic

EDIT 2: swapping the places of bulgarian and english in \usepackage corrected the font for the headers, as they display in bulgarian now and not garbled in any way. latin characters characters still appear to be messed- up though

EDIT 3: removing X2 from \usepackage[T2A, X2]{fontenc} fixed the problem with the garbled english font.

the packages i'm using are the following

\usepackage{amsmath,amssymb,latexsym}
\usepackage[T2A, X2]{fontenc}
\usepackage[cp1251]{inputenc}

\usepackage[bulgarian, english]{babel} \usepackage{mathrsfs} \usepackage{amsthm} \usepackage{subcaption} \usepackage{amsfonts} \usepackage{graphicx} \usepackage{epsfig} \bibliographystyle{plain} \usepackage[cp1251]{inputenc} \usepackage[T2A, X2]{fontenc} \usepackage[english,bulgarian]{babel}

  • This has nothing to do with texstudio. You should remove that from the title. – frabjous May 08 '22 at 16:19
  • alright then, sorry – Reddimus May 08 '22 at 16:54
  • What is the input for TOC line you show? – barbara beeton May 08 '22 at 17:03
  • i can'y say I had any input for that line, all i did was write \tableofcontents – Reddimus May 08 '22 at 19:27
  • The odd string you show is, I'm pretty sure, just a substitution of the glyphs in the Cyrillic font in the positions for "Chapter", but since it's not clear what font is being used, I can't check it. However, and probably not relevant, several packages are being loaded multiple times: inputenc, fontenc, babel, amsfonts (loaded by amssymb). The order of fontenc and inputenc may be important; I'm not sure where to check that. – barbara beeton May 09 '22 at 01:00
  • i tried reverse searching the font using font identification websites, but came back empty- handed. the font seems to be a mixture of cyrillic and english, that's for sure. anyway, i removed the repeating lines and swapped the order of fontenc and inputenc, but that didn't seem to work – Reddimus May 09 '22 at 20:49
  • fontenc and inputenc are old-style method for legacy fonts, not really needed these days, especially with Unicode fonts. Are you able to save the .tex file as utf-8, not cp1251? Code page 1251 is for Cyrillic 8-bit fonts (from before Unicode) and overlaps with latin. Can you use Noto Serif font (with fontspec), for output? (Or some other ttf/otf font with Cyrillic characters). – Cicada May 10 '22 at 07:36
  • Maybe related: For legacy fonts, https://tex.stackexchange.com/questions/204224/where-can-i-find-a-list-of-supported-fonts-in-bulgarian-along-with-examples For captions with babel, https://tex.stackexchange.com/questions/312296/non-english-caption-reference-doesnt-print-the-name do not use fontenc and inputenc: https://tex.stackexchange.com/questions/153554/command-maketitle-with-cyrillic-and-times-new-roman – Cicada May 10 '22 at 07:49
  • right, following the instructions on the last link you posted gives me the error Error: Command crashed: xelatex.exe -synctex=1 -interaction=nonstopmode "FILE-2022".tex i also used xelatex to compile it. – Reddimus May 15 '22 at 18:31
  • also i managed to fix one of the problems (see edit 2) – Reddimus May 15 '22 at 18:38
  • i'm really, really, really sorry for spamming this thread so much and wasting everyone's time, but i managed to correct my issue (see edit 3) – Reddimus May 15 '22 at 18:44

0 Answers0