Citing and referencing (and a bit Zotero) http://tinyurl.com/ifibib BibLaTeX EndNote January 16th 2015 *) Why cite and refer - 1 • To give credit • To assure your readers of the accuracy of your facts • To document your foundation and show on which other works your own work is based *) Partly based on Turabian. A manual for writers.2007 Why cite and refer - 2 • To avoid accusations of plagiarism and cheating – If you use texts, photos, graphs, images, ideas made by others, you must cite them with references • To help readers extend your work What should you cite and refer? • avoid web pages • try to cite the primary source • peer-reviewed texts – journal articles – books – chapters/parts of books – conference papers – technical reports – definitions from encyclopedias How to cite and refer • The citation should point to a description (a reference) that contains enough information to locate the source (the document or cited information) • A quotation should be separated from your own text – by typographical means like ”quotation marks”, – by separate paragraphs with closer margins, – by giving the text in italics. • Paraphrasing the source does not free you from citing. Four different styles Zotero www.Zotero.org • Zotero is a Firefox add-on for reference managing and a stand-alone program (connecting to Chrome, Safari, Opera) • Interprets and fetches references on the current page in your browser • Organizes references and documents in libraries and groups • The library or group may be put in the Zotero cloud and used from wherever you are online • Collaborate with other people • Export data to other tools (BibLaTeX, EndNote,) Zotero in Firefox Syncing your Zotero-data Sync preferences Syncing manually Groups : sharing references BibLaTeX BibTeX/bibtex BibLaTeX/biber • Some differences between BibTeX and BibLaTeX – BibLaTeX/biber supports UTF-8, BibTeX ASCII – BibLaTeX has a broader range of reference information fields – BibLaTeX is easier to customize • Emacs supports BibTeX fields • The reference databases provide BibTeX fields • The BibLaTeX /biber handles BibTeX-data (but not the other way round) Reference information fields • author / editor • title / subtitle / booktitle / journaltitle • edition • volume • issue • number • pages • location • publisher • year / date • ... Document types and mandatory fields • article (journal article) – author, title, journaltitle, year|date • book / inbook – author, title, year|date / +booktitle • collection / incollection – editor, title, year|date / +author, booktitle • proceedings / inproceedings – editor, title, year|date / +author, booktitle • thesis – author, title, type, institution, year|date • online – author/editor, title, year|date, url • ... LaTeX/BibLaTeX The bib-file (library.bib) The TeX-file @book{henrik, Author = {Henrik Ibsen}, Title = {A doll’s house}, … } \documentclass[…]{…} \usepackage[backend=biber]{biblatex} \addbibresource{library.bib} \begin{document} … Some text and then a citation.\cite{nordahl} more text and a new citation \cite{henrik} … @book{nordahl, Author = {Nordahl Grieg}, Title = {The world must still be young}, … } The bib file must reside in the same folder as the TeX-file or in the folder ~/texmf/bibtex/bib/ \printbibliography \end{document} Journal article @Article{, author = title = journal = year = OPTkey = OPTvolume = OPTnumber = OPTpages = OPTmonth = OPTnote = OPTannote = } {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {} @Article{knuth1974, author = {Donald E. Knuth}, title = {Computer programming as an art}, journal = {Communications of the ACM}, year = {1974}, OPTkey = {}, OPTvolume = {17}, OPTnumber = {12}, OPTpages = {667--673}, OPTmonth = {December}, OPTnote = {}, OPTannote = {} } @Book{, ALTauthor = ALTeditor = title = publisher = year = OPTkey = OPTvolume = OPTnumber = OPTseries = OPTaddress = OPTedition = OPTmonth = OPTnote = OPTannote = } {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {} Book @Book{Dahl1992, author = title = publisher = year = } {Ole-Johan Dahl}, {Verifiable programming}, {Prentice Hall}, {1992}, Chapter in a book Conference paper @Proceedings{key2, @Proceedings{hopl78, title title == {History {},of programming languages}, year year == {1978},{}, editor editor == {Wexelblat, {}, Richard L.}, publisher publisher == {} {ACM} }} @InProceedings{key1, author = {}, @InProceedings{simula, = {}, Kristen and Dahl, Ole-Johan}, author title = {Nygaard, crossref ={key2} title = {The development of the SIMULA languages}, \cite{simula} } = pages {439--480}, crossref ={hopl78} \cite{hopl78} } LaTeX/BibTeX-editors • Kile editor (LaTeX / BibLaTeX) – http://kile-sourceforge.net • VIM-LaTeX for VIM – http://vim-latex.sourceforge.net/ • AUCTeX for Emacs – https://www.gnu.org/software/auctex/index.html • TeXworks – TeX GUI for all plattforms – http://www.tug.org/texworks • JabRef -Bib(La)TeX-editor for all platforms – http://jabref.sourceforge.net/ Emacs macros - abbreviations • @string{atch={ACM Transactions on Computer-Human Interactions}} – journaltitle = atch, • @string{dek={Donald Erwin Knuth}} – author=dek, • @string{apa={American {P}sychological {A}ssociation}} – publisher=apa, • a macro must appear before the first reference using it in the bib file • advice: put all your macros at the top of your bib file or in a separate file (which then must be loaded first): • \ addbibresource{macros.bib} • \ addbibresource{library.bib} or • \bibliography{macros, library} Fetch BibTeX references from databases - ACM Fetch BibTeX references from databases - IEEE A complete example: numeric style The tex-file (example.tex) \documentclass[11pt,english,a4paper]{article} \usepackage{babel,csquotes} \usepackage[backend=biber,% citestyle=numeric,% bibstyle=numeric% ]{biblatex} \addbibresource{library.bib} \begin{document} \section*{Introduction} Donald E. Knuth has written a book about digital typography\cite{knuth}. \printbibliography \end{document} The bib-file (library.bib) @Book{knuth, author = {Donald E. Knuth}, title = {Digital typography}, publisher = {CLSI publications}, year = 1999} LaTeX/biber processing ltx example.tex numeric numeric-comp numeric alphabetic alphabetic authoryear authoryear authoryear-comp authortitle authortitle ... ... alphabetic \documentclass[11pt,english,a4paper]{article} \usepackage{babel,csquotes} \usepackage[backend=biber,% citestyle=alphabetic,% bibstyle=alphabetic% ]{biblatex} \addbibresource{library.bib} \begin{document} \section*{Introduction} Donald E. Knuth has written a book about digital typography\cite{knuth}. \printbibliography \end{document} authoryear \documentclass[11pt,english,a4paper]{article} \usepackage{babel,csquotes} \usepackage[backend=biber,% citestyle=authoryear,% bibstyle=authoryear% ]{biblatex} \addbibresource{library.bib} \begin{document} \section*{Introduction} Donald E. Knuth has written a book about digital typography\parencite{knuth}. typography\cite{knuth}. \printbibliography \end{document} authortitle \documentclass[11pt,english,a4paper]{article} \usepackage{babel,csquotes} \usepackage[backend=biber,% citestyle=authortitle,% bibstyle=authortitle% ]{biblatex} \addbibresource{library.bib} \begin{document} \section*{Introduction} Donald E. Knuth has written a book about digital typography\parencite{knuth}. typography\cite{knuth}. \printbibliography \end{document} Do not mix the styles citestyle=numeric,bibstyle=alphabetic citestyle=alphabetic,bibstyle=numeric Style \documentclass[11pt,english,a4paper]{article} \usepackage{babel,csquotes} \usepackage[backend=biber,% style= ]{biblatex} \addbibresource{library.bib} numeric alphabetic authoryear authortitle ... Related entries \documentclass[11pt,english,a4paper]{article} \usepackage{babel,csquotes} \usepackage[backend=biber,% citestyle=authortitle,% bibstyle=authortitle% ]{biblatex} \addbibresource{library.bib} \begin{document} \section*{Introduction} Donald E. Knuth has written a book about digital typography\parencite{knuth}. \printbibliography \end{document} @Book{knuth, author = {Donald E. Knuth}, title = {Digital typography}, publisher = {CLSI publications}, related = {knuth1974}, relatedstring= {See also }, Year = 1999 } ... @Article{knuth1974, author = {Donald E. Knuth}, title = {Computer programming as an art}, journal = {Communications of the ACM}, year = 1974, volume = 17, number = 12, pages = {667--673}, month = {December} } \cite • • • • • \begin{document} \section*{Introduction} Donald E. Knuth has written a book about digital typography\footcite[][is not the only one]{knuth}. \cite[<prenote>][<postnote>]{<key>} \parencite[<prenote>][<postnote>]{<key>} \footcite[<prenote>][<postnote>]{<key>} \smartcite[<prenote>][<postnote>]{<key>} \supercite{<key>} \printbibliography \end{document} \cite - 2 • • • • \citeauthor [<prenote>][<postnote>]{<key>} \citetitle [<prenote>][<postnote>]{<key>} \citeyear [<prenote>][<postnote>]{<key>} \citeurl [<prenote>][<postnote>]{<key>} Example: Sorting references \documentclass[11pt,english,a4paper]{article} \usepackage{babel,csquotes} \usepackage[backend=biber,% style=numeric,% nty (name, title year) sorting=...,% nyt ]{biblatex} ynt \addbibresource{library.bib} none debug ... Selection of style implies sorting order. You should balance the style and the sorting order Sorting citations \documentclass[11pt,english,a4paper]{article} \usepackage{babel,csquotes} \usepackage[backend=biber,% style=numeric,% sortcites=true,% [8,3,1,7,2] [1,2,3,7,8] ]{biblatex} \addbibresource{library.bib} \usepackage[backend=biber,% style=numeric-comp,% ]{biblatex} [8,3,1,7,2] [1-3,7,8] addbibresource[<options>]{resource} • • • • • • • \documentclass[11pt,english,a4paper]{article} ... \addbibresource{library1.bib} \addbibresource{library2.bib} \addbibresource[location=remote]{http:// ...} \addbibresource[datatype=bibtex]{<file name>} \addbibresource[datatype=ris]{<file name>} • (\bibliography{library1,library2}) • \begin{document} Multiple bibliographies – 1 in the end of each chapter \begin{document} \chapter{...} \begin{refsection} ... \printbibliography \end{refsection} \chapter{...} \begin{refsection} ... \printbibliography \end{refsection} \end{document} Multiple bibliographies – 2 in the end, subdivided by chapters \begin{document} option overrides header is asthe defined TheThis header used by this the command value by of a \chapter{...} bibliography. The value of It subbibliography might global variable: bibliography. might be defined by \begin{refsection} be defined as such: ... \defbibheading{bibliography}[\bibname]{% \defbibheading{subbibliography}{% \end{refsection} \chapter*{#1}% \section*{References for Chapter % \markboth{#1}{#1}} \chapter{...} \ref{refsection:\therefsection}}} \begin{refsection} ... \end{refsection} \printbibheading \printbibliography[section=1,heading=subbibliography] \printbibliography[section=2,heading=subbibliography] \end{document} \printbibliography[<key=value,...>] • section=<number> / heading=<name> • title=<text> • prenote=<name1> – \defbibnote{<name1>}{<text>} • postnote=<name2> • type=<entrytype> – type=books • nottype=<entrytype> – nottype=online • keyword=<keyword> • notkeyword=<keyword> • ... BibLaTeX documents • BibLaTeX Manual http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf • Dag Langmyhr/Knut Hegna: Local guide to BibLaTeX http://dag.at.ifi.uio.no/latex-links/biblatex-guide.pdf • Knut Hegna: BibLaTeX - Course notes http://tinyurl.com/ifibib (next week) • LaTeX/Bibliography management http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management • LaTeX-books in the library BibLaTeX hands-on courses autumn 2015 • In Norwegian – Onsdag – Torsdag 26.aug / 16:15 – 19:00 27.aug / 16:15 – 19:00 • In English – Friday Aug 28th / 12:15 – 15:00 Sign up via http://tinyurl.com/ifibib RefTeX for Emacs RefTeX RefTeX-2 RefTeX-meny RefTex-søk RefTeX-treffliste RefTeX-cite From Zotero to BibLaTeX Exporting from Zotero to BibLaTeX Export problems • LaTeX commands in Zotero are not preserved – Ex: \newline {\textbackslash}newline • No book/inbook logic exists • Synchronizing bib file and Zotero: – Zotero is the source – A change in the bib-file must either be copied to Zotero or be repeated with every following Zotero-to-bib export • Identifiers/keys consistent from one export to the next? – A hack version of the export algorithm lets you define your own identifiers/keys Flexibility \printbibheading \printbibheading[heading=myheadername] In the preamble: \defbibheading{<name>}[<title>]{<code>} <name> is a text string ("myheadername") <title> is a value passed to the <code> <code> is valid LaTeX coding Example: \defbibheading{myheadername}[My references]% {\section*{#1}% \addcontentsline{toc}{section}{#1}}