LyXUsing Lyx, Biblatex and the APA package | Ubuntu 12.04

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
RedSquirrel
Posts: 7
Joined: Fri Aug 10, 2012 6:36 pm

Using Lyx, Biblatex and the APA package | Ubuntu 12.04

Post by RedSquirrel »

Hello everyone,

I would like to use Lyx with the biblatex-apa package for writing up my dissertation. However, I am struggling to get it to work. I have used vanilla Lyx with apacite for previous assignments, but never got inline citation to work; so I had to resort to typing references out manually. For my dissertation, I would like to get more out of Lyx and Latex. I'm only in the early stages of producing my dissertation and I'm trying to get everything working while I'm not under pressure to produce anything.

To that end I am using Ubuntu 12.04, Lyx 2.0.4 and have installed Texlive 2012 using the backports repo. In addition to this, I have also manually downloaded the latest biblatex, biblatex-apa and csquotes to a \texfm\tex\ directory in my home folder. Without this last measure, I get errors with trying to compile. I wonder therefore if something may be wrong with my texlive installation or the means by which Lyx communicates with it.

Now I can get a sample lyx file to compile to pdf, with inline references from a .bib. However, I cannot get the bibliography to appear. I have inserted the following Latex code where I would like the bibliography to appear:

Code: Select all

\begin{refsection}[/home/rfa/Downloads/biblatex/sample.bib] 
\printbibliography
\end{refsection}
I have tried using just print \printbibliography by itself, but then the file refuses to compile to pdf.

The current content of my preamble is as follows:

Code: Select all

\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage{color}
\usepackage[style=apa, backend=biber]{biblatex}
\addbibresource{/home/rfa/Downloads/biblatex/sample.bib}
\def\citet{\textcite}           
\def\citep{\parencite}
\def\citealp{\nptextcite}
I have attached my lyx test file along with my sample .bib file in case in may be of use.

In short; I am way out of my depth and will be grateful for any assistance should anyone be both willing and able to give it. Thank you for reading my post :)
Attachments
sample.bib
(6.5 KiB) Downloaded 324 times
test.lyx
(3.33 KiB) Downloaded 307 times
Last edited by Stefan Kottwitz on Mon Aug 20, 2012 6:14 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

RedSquirrel
Posts: 7
Joined: Fri Aug 10, 2012 6:36 pm

Using Lyx, Biblatex and the APA package | Ubuntu 12.04

Post by RedSquirrel »

Ok, I've run a test on my biber binary as outlined in the documentation and unfortunately it did not work.

I downloaded the test files to my home directory, then ran:

Code: Select all

biber --validate_control --convert_control test
Which then produced the following output:

Code: Select all

INFO - This is Biber 1.1
INFO - Logfile is 'test.blg'
ERROR - 'test.bcf' failed to validate against schema '/tmp/par-726661/cache-a94731f07f08c2e7258c27cbe22c0386b0220432/inc/lib/Biber/bcf.rng'
INFO - ERRORS: 1
Edit: Biber 1.2 produces the same result :cry:

Edit 2: Uploaded log file.

Edit 3: The problem is now solved!

Fixing the problem involved installing vanilla texlive (in full) and modifying the preamble to the following (please note I created a new shorter .bib file to simplify testing:

Code: Select all

\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage[style=apa, backend=biber]{biblatex}
\DeclareLanguageMapping{british}{british-apa}
\addbibresource{test.bib}
\def\citet{\textcite}           
\def\citep{\parencite}
\def\citealp{\nptextcite}
\DeclareLanguageMapping is essential otherwise the published year for entries won't appear in the bibliography. I also found that I needed to run biber via the command line in order for a bibliography to be produced in the final pdf file.
Attachments
test.log
(18.2 KiB) Downloaded 318 times
Post Reply