Lyx Bibliography Without Numbers In Spanish

Categories: Bibliography, Tips

<< | Page list | >>

Encoding

BibTeX does not support files encoded in UTF-8 (i.e., Unicode), which is nowadays the default file encoding on most OSes. The reason is that current BibTeX (v. 0.99c) was released in 1988 and thus predates the advent of unicode. Unless the long-announced BibTeX v. 1.0 or one of the many planned potential successing applications are ready, latin1 (ISO-8859-1) or another 8-bit encoding has to be used for the bib file (this does not affect the LaTeX encoding, which still can be utf8).

If you rely on UTF-8, you might try biblatex-biber, a BibTeX replacement program written in Perl. Biber can handle unicode, however, as the name indicates, it only works in conjunction with biblatex. Please look here for some instructions.

Decent bib file editors take care about the correct encoding, which usually can be set in the Preferences or Options dialog of the bib file editor. However, you might have to take care yourself about special characters. Particularly, characters not included in the bib file encoding need to be inserted via LaTeX macros. (Some editors automatically do this conversion for you, e.g. Pybliographic and BibDesk. In the latter application, you need to check "Convert accented characters to TeX when exporting or pasting BibTeX" in the "Opening and Saving" preferences.)

Existing utf8-encoded bib files can be converted by means of the command line tool recode. The following command (with an adapted bib file name) should do the trick (however, please backup your bib file before trying):

This re-encodes the file to 7-bit ASCII.
If you want another target encoding, change the syntax. For ISO-8859-15 (= latin9), the command would read:

Please check the recode man page for more options.

Some background information:

Change bibliography heading

You can change the heading of your bibliography by inserting a ERT element (Insert→TeX) right before the bibliography with the following command: \renewcommand\refname{New References Header} or \renewcommand\bibname{New Bibliography Header}, depending on whether you use an article or a report/book class.

Cf. the FAQ for a more general explanation.

Cross references vs. explicit references

BibTeX adds cross-referenced entries to the bibliography even if they are not explicitly referenced when those entries are cross-referenced by two or more citations. The -min-crossrefs option can be used to disable or customize this behavior.

As of LyX 1.4, you can customize the way bibtex is called (in Preferences→Output→LaTeX). Add the option there, e.g.

.

With LyX < 1.4, the bibtex call was hardcoded. To customize , you will have to create a shell script containing the following:

Name the script 'bibtex' and make sure it appears on the search path before the real bibtex executable.

Abbreviation of author name in text

If you want to abbreviate an author (or most likely institutional) name in the citation while having it in full form in the bibliography, the procedure depends on the citation approach.

Biblatex and jurabib have the field, which can be used for this task.

Example:

@techreport{FEMA350, author = {{Federal Emergency Management Agency (FEMA)}}, shortauthor = {FEMA}, title = {Recommended seismic design criteria for new steel moment-frame buildings}, year = 2000, number = {FEMA-350}, address = {Washington, D.C.} }

With natbib, things are more complicated. You need to define a cite alias.

  1. At the beginning of the LyX file enter as TeX code: \defcitealias{<citekey>}{<alias>}
    (e.g., for the above example: \defcitealias{FEMA350}{FEMA}
  2. At the location of the citation enter in TeX code \citealias{<key>}
    (e.g., \citealias{FEMA350} followed by a normal LyX citation reference to this item using the style that only outputs the year.

Multiple and subdivided bibliographies

Subdivided bibliographies

As of LyX 1.4, subdivided bibliographies are natively supported via the bibtopic package:

  1. Go to Layout→Document→Bibliography and select Sectioned bibliography (or Subdivided bibliography, as of LyX 2.3).
  2. Now you can just insert several Bibtex Insets (Insert→Lists&TOC→BibTeX Reference).

Note, though, that bibtopic does not support unsorted bibliographies.
See section 3.1.2 of Help→Additional Features for details.

With LyX < 1.4, you have to use TeX code as described in the bibtopic manual. N.B.: You have to call the package in the preamble with the command

\usepackage[dot]{bibtopic}

Without the dot-option, LyX won't find the auxiliary files, hence the bibliography will be empty.

Biblatex provides its own means to produce subdivided bibliographies (via keywords, filter tags, and categories). These are described on the biblatex manual, section Subdivided bibliographies

Multiple bibliographies

Multiple bibliographies will be supported as of LyX 2.3 (using, depending on the setting, either the bibtopic or chapterbib package, or biblatex):

  1. Go to Layout→Document→Bibliography and select the relevant unit from Multiple bibliographies.
  2. Now you can just insert several Bib(la)tex Insets (Insert→Lists&TOC→Bib(la)TeX Reference).

See section 3.1.2 of Help→Additional Features for details.

Up to LyX 2.2, you can produce multiple bibliographies with bibtopic, chapterbib or biblatex as follows:

  • bibtopic:
    1. Go to Layout→Document→Bibliography and select Sectioned bibliography
    2. Wrap the respective units (chapters, sections etc.) into \begin{btUnit} ... \end{btUnit} in TeX mode.
    Note that all references need to be in a , and that must not be nested. Note further that bibtopic does not support unsorted bibliographies (as mentioned above).
  • chapterbib:
    1. Add the following to Document→Settings...→Preamble:
      \usepackage{chapterbib}
      In case of sections, use \usepackage[sectionbib]{chapterbib} instead.
    2. All chapters or sections need to go to separate child documents, which are included (with not !) to a master document.
    3. You are not supposed to have a bibliography in the master file. BibTeX would yield an error in that case.
    4. Install the python wrapper script bibtexallx. It is needed because LyX does not process bibtex on all of chapterbib's auxiliary files. Place the script somewhere in the path and make sure it is executable. Then go to Tools→Preferences→Output→LaTeX and change the bibtex command from bibtex to bibtexallx (only possible as of LyX 1.4).
  • biblatex: biblatex provides its own methods both for multiple and subdivided bibliographies. If you use biblatex, you will have to use those, since biblatex is not compatible with the aforementioned packages.
    1. See this page for general instructions to use biblatex with LyX < 2.3.
    2. To get a bibliography per chapter, add the package option to the \usepackage[...]{biblatex} call in the preamble (other available values: , , ).
    3. If you do not use biber, but bibtex or bibtex8, you need to install the python wrapper script bibtexallx to let LyX process bibtex on all of biblatex's auxiliary files. Place the script somewhere in the path and make sure it is executable. Then go to Tools→Preferences→Output→LaTeX and change the bibtex command from bibtex to bibtexallx (only possible as of LyX 1.4). If you need bibtex8 instead of bibtex, adapt the script accordingly. However, it is generally advised that you use biber with biblatex.
    See the biblatex manual for details.

If the aforementioned approaches do not fit your needs, you can produce multiple bibliographies with some extra code, using the package bibunits:

  1. Add the following to Document→Settings..→Preamble:
    \usepackage{bibunits}
    \renewcommand{\@bibunitname}{\jobname.\the\@bibunitauxcnt}
  2. Wrap the respective units (chapters, sections etc.) into \begin{bibunit}[<bibstyle>] ... \end{bibunit} in TeX mode, where is your bibliography style without extension.
  3. At the place where the bibliography should occur, enter \putbib[<bibfile>] in TeX mode, where is your bibliography database without extension.
  4. In order to access the citations from the citation dialog, put a BibTeX inset in a note inset.

Also cf. this bibunits example

Creating your own style file with custom-bib

Sometimes it is necessary to change the format of the reference list. Most journals require a certain style; often there are recommendations how to style the reference list when doing a thesis.

The easiest way to accomplish this task is to use plus the latex package from the same author. You can get it in via CTAN.

Once installed, the command line "latex makebst" launches an interactive dialogue. Just keep patiently answering the questions, and you end up with a style file that should come close to your needs. Save that style file in a directory where LaTeX can find it (in your TEXMF directory in the folder ), run to update the LaTeX file database, and in LyX, hit "Rescan" in Tools→TeX Information. After that your new style file is usable in listed in the BibTeX dialog).

When this is done, use natbib (Format→Document→Bibliography→Use natbib). Insert the reference list where you want it to appear (usually at the end of the document). Then select your .bst file as Style.

Creating hyperlinks within a document

Sometimes you might want to employ, say, the numbered style and have hyperlinks from your citations in the document's body text to the appropriate reference in the bibliography. Here's how.

To create hyperlinks within your document, go to Document→Settings...→PDF options and check Enable Hyperref Support.

Make sure that you use in LyX to view the pdf output.

Simply checking this option will make all hyperlinks in your document work, including citations. However, a reader may not notice that the links in your PDF file are clickable. If you wish to color the hyperlinks to increase legibility, add something like in the Additional Options field of that dialog pane.

You can put in any of LaTeX's default colors, i.e. white, black, blue, red, green, yellow, cyan and magenta.

If you still want to do more, combine the commands with other color schemes or packages. For example, add

\usepackage{xcolor}

to the preamble. With you can access several kinds of colors, tints, shades, tones and mixes of colors.

  • results in URLs being displayed blue but only with 50 percent color intensity
  • will result in citations being displayed as a mixture of 20 percent blue and 10 percent green

Categories: Bibliography, Tips

This post discusses my experience getting APA style references in LaTeX. This includes both in-text citations and the end of document references list. It focuses on the use of the package.

Setting up a BibTeX Bibliographic Database

Regardless of what citation style you want, you need to have your references formatted in BibTeX format. JabRef is a powerful reference manager for working with a BibTeX database. Also, see my previous post for migrating an Endnote database into BibTeX format and migrating a Word Document with Endnote references into LaTeX format.

APA Style References Several options exist:

From my initial examination looks like it has more features and is more compatible with the nuances of APA style. However, is somewhat of a standard in LaTeX. Thus, using citation commands may enable easier conversion between citation styles. The remainder of this post focuses on my experience with the package.

Using apacite

For comprehensive information on using apacite, see the documentation. The following sets out some basic details:

1. Ensure that you have a BibTeX database for the document. Your document will be more portable if the database is placed in either the same folder as the LaTeX files or in a subfolder of the LaTeX files.

However, you may prefer to maintain a general Bibliographic database that can be used across documents. If you wish to have a general database, you can use absolute file references to the database. Then when you need to share the BibTeX database, copy the database into a LaTeX project folder or subfolder and change the file reference in the command .

2. Reference the apacite package in the preamble.

3. Place the bibliography in the desired location in the document (usually after the main text) using the following code:

4. To insert citations in the text has a range of commands (see "The citation commands" in the Manual). Table 1 in the manual lists some of the main commands. I find myself using the following ones most often:

  • : This inserts the author names and years in brackets. This is the standard methods. E.g., "(Anglim, 2002)".
  • : Inserts the author names in the text and years in brackets. I use this to insert the authors names in the text e.g., "Anglim (2002)".
  • : inserts just the years in brackets. This is useful when I want to include the author's names in the text in a non-standard way. E.g., I've already written "Anglim's" then citeyear will insert "(2002)".

Each command takes a BibTeX reference as an argument and can have pre- and post- text. For example:


displays as "(e.g., Ackerman, 1990)"

5. To produce the document with references included, the document typically needs to be built three times in order for all updates to occur.

Additional Challenges and Resolutions

French formatting
Problem: For some reason my document was using a French language version of apacite. This resulted in many unwanted  customisations, such as the French word for references (Références) being displayed at the start of the reference list.
Solution: I inserted the following code into the preamble to restore the English mode of :

Additional Resources

0 thoughts on “Lyx Bibliography Without Numbers In Spanish

Leave a Reply

Your email address will not be published. Required fields are marked *