On 28-Jan-19 7:46 PM, Jürgen Spitzmüller wrote: Am Mo., 28. Jan. 2019 um 16:40 Uhr schrieb Baris Erkus <bariser...@hotmail.com<mailto:bariser...@hotmail.com>>:
I observed that if biblatex is selected for the bibliography style, the \usepackage[*options*]{biblatex} is placed right before the \begin{document}, but not after the \documentclass, where usually packages are called. Yes, because biblatex must be loaded after babel (or polyglossia), and this, in turn, must be loaded late. Thanks Jürgen. This one I understand. However, this requirement does not call for loading babel+biblatex right before the \begin{document}; they can still be placed right after other packages loaded after \documentclass. The examples on BibLaTeX, I sqw SE or other web pages loads BibLaTeX in the block after \documentclass, but late. If I want to place some code in the preamble that requires the biblatex package, then these codes appear before the \usepackage[*options*]{biblatex} line, and they do not work. For example I wanted to replace "et al.", "and", "Bibliography (title)" with their Turkish counterparts by simply placing the following code to the preamble: \DefineBibliographyStrings{english}{% references = {{Kaynaklar}}, and = {ve}, andothers ={ve diğerleri}, } but it does not work. You need to embrace such definitions in \AtBeginDocument{...}. See https://wiki.lyx.org/BibTeX/Biblatex#toc2 HTH, Jürgen It does compiling, but the replacement did not work. I think, the \AtBeginDocument{...} macro places the contents right after the \begin{document}, but not in the preamble. However, the \DefineBibliographyStrings{...} and similar BibLaTeX commands are placed in the preamble according to Section 3.9 of BibLaTeX manual. Maybe this is the reason it does not do the replacement (?). I have also tried to compile a LaTeX file where I place this block to the beginning of the document right after \begin{document} and it gives error that this has to be placed in the preamble (no LyX involved). I further tested the case on LaTeX again, where the above block wrapped with \AtBeginDocument{...} in the preamble, but before loading biblatex; it compiles, but it does not do the replacement (no LyX involved). So, is there a workaround for this in LyX, am I missing smtg? (TBH, this was not my original problem. I was trying to use BibLaTeX for a Turkish document, only to find out BibLaTeX does not have Turkish support yet :< ) Baris -- ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ Please bottom-post. Start your reply here:
%% LyX 2.3.2-2 created this file. For more info, see http://www.lyx.org/. %% Do not edit unless you really know what you are doing. \documentclass[english]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \AtBeginDocument{% \DefineBibliographyStrings{english}{% references = {{Kaynaklar}}, and = {ve}, andothers ={ve diÄerleri}, } } \usepackage{babel} \usepackage[style=authoryear,maxcitenames=2]{biblatex} \addbibresource{test.bib} \begin{document} Testing \parencite{Nagarajaiah1991} Testing \parencite{AtikAbrahamson2010} \printbibliography \end{document}
newfile1-biblatex-2.lyx
Description: newfile1-biblatex-2.lyx