BibTeX, biblatex and biber ⇒ Italics in book titles
Italics in book titles
Please excuse me for asking this question as there is probably an easy fix but haven't been able to find it online and have been out of using Latex for a couple of months so I am a bit rusty…
I have a number of book titles with species names in them. BibTex is automatically putting my book titles in italics, which is fine. But seeing that species names are normally italicised, when they are in a title which is already in italics one is supposed to de-italicise the species name (if that makes sense). And I have no idea how to do this!
For instance, I have:
Cranial shape variation in \textit{Homo erectus}
or
Cranial shape variation in Homo erectus
which compiles as:
Cranial shape variation in Homo erectus
But I want:
Cranial shape variation in Homo erectus
Does anyone know what to do to rectify this?
Many thanks!
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Italics in book titles
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Italics in book titles
Naturally, defining a new semantic command comes to mind for this kind of stuff. So i looked up the original definition for
\emph
and modified it to create a new command \species
. Code: Select all
\begin{filecontents}{\jobname.bib}
@book{lion2010,
author = {Laura Lion and Gabrielle Giraffe and Carl Capybara},
title = {The history of \species{Homo sapiens} and other stuff},
publisher = {publishing house},
date = {2010},
keywords = {trusted},
}
\end{filecontents}
\documentclass{article}
\usepackage[backend=biber]{biblatex}
\addbibresource{\jobname.bib}
\makeatletter
\DeclareRobustCommand\spec{\@nomath\spec \ifdim \fontdimen\@ne\font >\z@
\specinnershape \else \itshape \fi}
\newcommand\specinnershape{\upshape}%
\makeatother
\DeclareTextFontCommand{\species}{\spec}
\usepackage{xcolor}
\begin{document}
Quote: \textit{test of \species{Lalala}}
\cite{lion2010}
\printbibliography
{\renewcommand\specinnershape{\color{black!50!red}\selectfont}\itshape test \species{wombat}}
\end{document}
Italics in book titles
Sorry for this ridiculously late reply, thank you so very much for your help, that's fantastic !