4

Using LyX. I made the conversion from bibtex to biblatex today, as I think it will help get a quick response, and be better for the long-term. I am trying to take the apa format and tweak a few things. I could use some help.

This is my preamble:

\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=apa, backend=biber]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\addbibresource{C:~/refs.bib}

I want the journal, book, etc to be italicized AND bolded.

Chris J
  • 633
  • 1
  • 6
  • 16
  • LyX doesn't (yet) have built in support for biblatex, you need to select author-year style in the document settings, and some other stuff. See http://tex.stackexchange.com/questions/146159/how-do-i-make-my-bibliography-according-to-harvard-style-author-year-alphabeti/148410#148410 – Torbjørn T. Jan 11 '14 at 20:50
  • @TorbjørnT. This handles everything besides the bolded names in the references – Chris J Jan 11 '14 at 20:59
  • Perhaps you could edit your question to make that the main focus. (It is generally best to have on specific issue per question anyway, you have two somewhat different questions in your post.) The (very) general answer to customizing biblatex styles is http://tex.stackexchange.com/a/13076/586, but you can perhaps use and modify the example found under Formatting of fields (and of citation postnotes). – Torbjørn T. Jan 11 '14 at 21:10
  • @TorbjørnT. That link was very helpful, but I am just trying to add the bolding to this style and not globally. Every attempt thus far has caused LyX to crash. – Chris J Jan 11 '14 at 21:34
  • What do you mean by 'globally'? When you load a biblatex style, it is used 'globally' in that document, and thus any changes you make would be applied 'globally' to a document that uses it.... It is also difficult to provide advice on how to make 'etc.' be anything: you must list precisely which fields for which entry types need to be put in bold and italics -- which is likely goingn to require the use of \DeclareFieldFormat[<entry type>]{<format>}{<code>} where 'entry type' would be something like 'article', 'format' is 'journaltitle', and 'code' is \textbf{\emph{#1}}. – jon Jan 11 '14 at 23:21

1 Answers1

11

You can use \DeclareFieldFormat to modify how different fields are printed. The general syntax is

\DeclareFieldFormat[<entry type>]{<field>}{<formatting commands>}

<entry type> can be a single entry type, e.g. article, or a comma separated list of entry types, e.g. article,book. <field> is the field you want to change, e.g. title. <formatting commands> defines how the field should be printed, with #1 representing the field contents.

Hence, to make the title of the journal for articles, and book titles, bold and italic, you could add

\DeclareFieldFormat
  [article]
  {journaltitle}{\textbf{\textit{#1}}}
\DeclareFieldFormat
  [book]
  {title}{\textbf{\textit{#1}}}

to the LaTeX preamble, after \usepackage{biblatex}. If you want quotation marks, use \mkbibquote{#1}. biblatex also has a bunch of commands for controlling punctuation, see section 4.7.3 Adding punctuation of the manual.

Torbjørn T.
  • 206,688
  • This is close, however, I wanted the journal bolded and italicized for articles and not the title. However, for books, I want the title. I tried editing your code as follows, but it did not work for the article. \DeclareFieldFormat [article] {journal}{\mkbibquote{\textbf{\textit{#1\isdot}}}} \DeclareFieldFormat [book] {title}{\mkbibquote{\textbf{\textit{#1\isdot}}}} – Chris J Jan 11 '14 at 23:34
  • Also, can the code be modified to remove the quotation marks around the book title? – Chris J Jan 11 '14 at 23:39
  • Try journaltitle in place of journal in the first line. Then remove the \mkbibquote{} in the second line. – cfr Jan 12 '14 at 00:08
  • This code will get to the desired result, \DeclareFieldFormat [article] {journaltitle}{\textbf{\textit{#1\isdot}}} \DeclareFieldFormat [book] {title}{\textbf{\textit{#1\isdot}}} – Chris J Jan 12 '14 at 00:15
  • @ChrisJ Sorry, I obviously misunderstood you. (I'll update my answer based on your comments a bit later.) – Torbjørn T. Jan 12 '14 at 16:59