Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using a jabref generated bibliography in lyx according to the following instructions:

http://ubuntuforums.org/showthread.php?t=477632

It works well, except for one type of error which I cannot figure out.

LaTeX Error: Command \itshape invalid in math mode.

Lyx file

I've created a minimum working example below with a one line lyx file and a 1 entry bibliography. Do you know how I can fix this error?

#LyX 1.6.5 created this file. For more info see http://www.lyx.org/
\lyxformat 345
\begin_document
\begin_header
\textclass article
\use_default_options true
\language english
\inputencoding auto
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100

\graphics default
\paperfontsize default
\use_hyperref false
\papersize default
\use_geometry false
\use_amsmath 1
\use_esint 1
\cite_engine basic
\use_bibtopic false
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\author "" 
\end_header

\begin_body

\begin_layout Standard
test of bibliography
\begin_inset CommandInset citation
LatexCommand cite
key "Hardy2007"

\end_inset


\end_layout

\begin_layout Standard
\begin_inset CommandInset bibtex
LatexCommand bibtex
bibfiles "mwe"
options "plain"

\end_inset


\end_layout

\end_body
\end_document

bibTex file

% This file was created with JabRef 2.5.
% Encoding: ISO8859_1

@ARTICLE{Hardy2007,
  author = {Robert G Hardy and Carolina Vicente-Dueñas and Ines González-Herrero
 and Catriona Anderson and Teresa Flores and Sharon Hughes and Chris
 Tselepis and James A Ross and Isidro Sánchez-García},
  title = {Snail family transcription factors are implicated in thyroid carcinogenesis.},
  journal = {Am J Pathol},
  year = {2007},
  volume = {171},
  pages = {1037--1046},
  number = {3},
  month = {Sep},
  abstract = {E-Cadherin (CDH1) expression is reduced in thyroid carcinomas by primarily
 unknown mechanisms. In several tissues, SNAIL (SNAI1) and SLUG (SNAI2)
 induce epithelial-mesenchymal transition by altering target gene
 transcription, including CDH1 repression, but these transcription
 factors have not been studied in thyroid carcinoma. Recently, our
 group has provided direct evidence that ectopic SNAI1 expression
 induces epithelial and mesenchymal mouse tumors. SNAI1, SNAI2, and
 CDH1 expression were analyzed in thyroid-derived cell lines and samples
 of human follicular and papillary thyroid carcinoma by reverse transcriptase-polymerase
 chain reaction, Western blotting, and immunohistochemistry. The effect
 of SNAI1 expression on CDH1 transcription was analyzed by reverse
 transcriptase-polymerase chain reaction and Western blotting in ori-3
 cells. Thyroid carcinoma development was analyzed in CombitTA-Snail
 mice, in which SNAI1 levels are up-regulated. SNAI1 and SNAI2 were
 not expressed in cells derived from normal thyroid tissue, or in
 normal human thyroid samples, but were highly expressed in cell lines
 derived from thyroid carcinomas, in human thyroid carcinoma samples,
 and their metastases. SNAI1 expression in ori-3 cells repressed CDH1
 transcription. Combi-TA mice developed papillary thyroid carcinomas,
 the incidence of which was increased by concomitant radiotherapy.
 In conclusion, SNAI1 and SNAI2 are ectopically expressed in thyroid
 carcinomas, and aberrant expression in mice is associated with papillary
 carcinoma development.},
  doi = {10.2353/ajpath.2007.061211},
  institution = {Tissue Injury and Repair Group, Centre for Regenerative Medicine,
 University of Edinburgh, Division of Clinical and Surgical Sciences,
 Room FU501, Chancellors Bldg, 49 Little France Crescent, Edinburgh
 EH16 4SB, UK. r.hardy@ed.ac.uk},
  keywords = {Animals; Cadherins, genetics/metabolism; Carcinoma, metabolism/pathology;
 Cell Line, Tumor; Humans; Mice; Thyroid Neoplasms, metabolism/pathology;
 Transcription Factors, genetics/metabolism},
  language = {eng},
  medline-pst = {ppublish},
  pii = {171/3/1037},
  pmid = {17724139},
  timestamp = {2010.11.04},
  url = {http://dx.doi.org/10.2353/ajpath.2007.061211}
}

UPDATE:

Another biblographic file that is trickier to get working is:

bibTex file

@Book{IbnTaymiyya1970,
author = {Ibn Taymiyyah, Aḥmad ibn ʿAbd al{-}Halīm},
title = {Naqḍ al{-}manṭiq},
shorttitle = {Naqḍ al-manṭiq},
editor = {Ḥamzah, Aḥmad},
publisher = {Maktabat a{l-}Sunnah},
address = {Cairo},
year = {1970},
sortname = {IbnTaymiyyaNaqdalmantiq},
keywords = { Logic, Medieval}} 
share|improve this question
    
That is an odd error, since as far as I can tell, there is no \itshape nor any math mode in the MWE... –  Seamus Nov 11 '10 at 14:51
2  
Also no idea, but try clearing your all your auxiliary files, and compile the document generated by LyX directly on the command line with pdflatex. –  Juan A. Navarro Nov 11 '10 at 22:46
    
I think it is an odd error as well. Clearing auxiliary files seems like a prudent step. I am still quite new to these issues, but as far I can tell, unlike when compiling in Kile, I do not see any auxiliary files generated when compiling in Lyx. –  denilw Nov 12 '10 at 19:38
    
@denilw: Lyx manages its own directory for intermediate files. –  Charles Stewart Nov 12 '10 at 22:36
2  
@denilw/@Charles: and LyX deletes the directory for intermediate files when it is closed, so that restarting LyX should be sufficient in order to clear the auxiliary files. –  domwass Nov 15 '10 at 12:23

2 Answers 2

up vote 5 down vote accepted

I've noticed two things:

  1. The encoding of your document is latin9 (View > View Source > Complete Source), but
  2. The entries in your .bib file are written in UTF-8 fashion, which BibTeX doesn't support.

So, try writing accented characters in your .bib the usual way, e.g. González > Gonz{\'{a}}lez etc.

Also, check LyX wiki for useful tips regarding usage of BibTeX.

share|improve this answer
    
+1 thank you this is helpful –  denilw Nov 19 '10 at 6:06
    
@denilw, just keep in mind that making both files, .tex and .bib, use UTF-8 wouldn't necessary solve the problem (though it may seem that everything is fine). Philipp Lehman once pointed out that "In contrast to what a lot of users think, it is not and has never been possible to use UTF-8 in bib files. Neither traditional Bibtex nor bibtex8 support multibyte encodings such as UTF-8. If it seems to work with some files, it only does so by chance." (see bit.ly/a1wpSv) –  Meho R. Nov 19 '10 at 10:33
    
Thanks that is another good point @Meho R.. The bibliographic entry in the link you sent me did indeed fail for utf8 encoding. However when \usepackage[utf8x]{inputenc} was used it worked. Do you know of any bibliographic entries that would not work using utf8x? I would like to avoid manually LaTeX encoding all my bibliographic entries. –  denilw Nov 19 '10 at 17:55
    
The trickier biblographic entry is now included in the question. –  denilw Nov 19 '10 at 18:05

As @Meho R. pointed out the problem seems to be the encoding. This can be fixed by:

  1. Changing the UTF-8 characters to escaped latex. This can be done by using konwert utf8-tex plus an extra command to add the braces.

  2. An easier way than changing your encoding all the time is to export the Lyx file to LaTeX and replace the command for the encoding \usepackage[latin9]{inputenc} with \usepackage[utf8x]{inputenc} and then import back to Lyx. I don't know of a way that works to change this without going through LaTeX.

share|improve this answer
    
Examples of characters that don't seem to work with \usepackage[utf8x]{inputenc} are ş and î. –  denilw Dec 20 '10 at 21:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.