Nethence Newdoc Olddoc Lab Your IP BBDock  


Warning: those guides are mostly obsolete, please have a look at the new documentation.

UnixWindowsOracleObsoleteHardwareDIYMechanicsScriptsConfigs

Setting up LyX and Biblatex for use with a bibliography file database
IMPORTANT NOTE: my self-made web content manager here doesn't handle escapes very well so in the meantime, please try to guess what's missing (mostly \\r and \\a).
 
http://pbraun.nethence.com/windows/editors/lyx.html
http://pbraun.nethence.com/unix/lang/latex.html
 
Installation
Install MiKTeX, LyX, and if you with the use an external bibliography database, also install a bib file editor, for exemple JabRef or BibEdt. Jabref has an index field auto-generation feature but some of you won't use it anyway so I guess it's all a matter of taste. And there are also other bib file editors.
 
Configuration with biber and Biblatex pointing to a bib file
Change the LyX global preferences,
tools > preferences
language settings / spellchecker // spellcheck continuously
output / latex // processor: biber
 
Now create a new document and change its preferences too,
document > settings
document class // suppress default date on front page
page layout // format: A4
language // language: ...
language // quote style: ...
numbering & toc // numbering: (all to the left)
numbering & toc // list in table of contents: (one bit to the left)
float placement // uncheck use default placement
float placement // here if possible
latex preamble
here's my biblatex optimized preamble,
\usepackage[english,ngerman,frenchb]{babel}
\usepackage{csquotes}
\addto\captionsfrenchb{\renewcommand\refname{Enquête et bibliographie}}
 
\usepackage[style=verbose-trad1,dashed=false,backend=biber,autolang=other]{biblatex}
\renewcommand*{\mkbibnamelast}{\textsc}
%http://tex.stackexchange.com/questions/223909/biblatex-autolang-other-breaks-authortitle-layout/223974
\addbibresource{c:/test.bib}
\let\cite=\footcite
 
%biblatex capable
\DeclareNameAlias{sortname}{first-last}
\renewcommand{\newunitpunct}{\addcomma\space}
\renewcommand{\mkibid}{\emph}
Note. the last language specified in the babel package arguments becomes the default babel language for the current document.
Nota. babel=other is depreceted. Use autloang= instead.
Note. change the path to the bib file accordingly.
 
Dealing with a bib file within LyX
Here's an example bib file (here c:\test.bib),
@BOOK{binetmag,
title={Le Magn{\'e}tisme animal : {\'E}tudes sur l'hypnose},
publisher={l'Harmattan},
year={2006 [1887]},
author={Alfred Binet and Charles F{\'e}r{\'e}},
pages={283 pages},
langid={french}
}
@BOOK{collinscha,
title={Changing Order: Replication and Induction in Scientific Practice},
publisher={University of Chicago Press},
year={1992 [1985]},
author={Harry Collins},
edition={New Edition},
langid={english}
}
 
@BOOK{collinsoth,
title={another book title with same author},
publisher={na},
year={9999},
author={Harry Collins},
langid={english}
}
 
In the new document, include a hidden reference to the bib file for LyX enabled citations,
insert > note > comment
(inside the comment) insert > list / TOC > bibtex bibliography
databases: add your bib file e.g. c:/test.bib
(do not care about the other parameters)
and right after the comment,
Ctrl-L
  \addcontentsline{toc}{section}{Enquête et bibliographie}\printbibliography
note. addcontentsline to force the bibliography to appear into the TOC. Change 'section' to 'chapter' if you are using the book document classe (using 'article' documentclass here). Alternatively there is the tocbibind package.
 
Ready to go
Use the citation button to insert a few references into the document to check that the bib file is recognized within LyX,
(citation button)
 
Check that the bibliography system is working correctly outside LyX with Biblatex,
(view button or Ctrl-R)
 
Check the latex code of your document,
file > export > latex (plain)
Note. it should start with a document class that specifies the A4 paper format (a4paper) and the default -- not babel -- document language (e.g. french).
Note. the fontenc package with T1 argument should be enabled for latin9 (todo, what about utf8?)
 
Further formatting
For a thesis you may have to place the title, author,
(carriage return may be forced doing Ctrl-Enter)
and eventually address/comments on the first page alone, then,
Ctrl-L \thispagestyle{empty}\pagebreak
note. \thispagestyle empty to avoid the page number at the bottom.
note. \pagebreak instead of \newpage to that the lines automaticly propagate through the page.
 
Then after the TOC,
Ctrl-L \cleardoublepage
or insert > formatting > clear double page
note. \cleardoublepage to handle paper's front and back side so the text doesn't begins right after the TOC.
 
Create numbered sections (numbers won't appear anyway) using the upper left test layout dialog.
 
Before new sections, use \newpage,
Ctrl-L \newpage
or insert > formatting > new page
 
At last before the bibliography (\printbibliography) preceded by the hidden LyX feature in a comment,
Ctrl-L \cleardoublepage
or insert > formatting > clear double page
 
Generating samples with TeXworks
To switch to biber you will need a custom script,
pdflatex+biber.bat
containing,
miktex-pdftex.exe -synctex=1 -undump=pdflatex "%1"
biber.exe "%2"
miktex-pdftex.exe -synctex=1 -undump=pdflatex "%1"
or,
miktex-pdftex.exe -synctex=1 -undump=pdflatex "%1"
biber.exe "%1.bcf"
miktex-pdftex.exe -synctex=1 -undump=pdflatex "%1"
 
References
LaTeX and LyX, tips and tricks: http://www.dedoimedo.com/computers/latex-lyx-tips.html
LyX Tips for Thesis Writing: http://longair.net/blog/2009/11/11/lyx-tips-for-thesis-writing/
FAQ / TOC: http://wiki.lyx.org/FAQ/TOC
Utiliser LyX: http://math.pc.vh.free.fr/edsci/lyx/util.htm
 

(obsolete, see the new doc)