System: Fedora Linux 24
LyX version: 2.2.2

So, I followed the instructions here: 
https://wiki.lyx.org/BibTeX/Tips#secbib
in order to use chapterbib with LyX.
1) The script bibtexall was downloaded, chmod'ed as executable, and put in a 
directory cited by PATH
2) Went to Tools -> Preferences... -> Output -> LaTeX.  In Bibliography 
Generation: Processor: Custom - Command: bibtexall
3) Created a simple master-child structure (1 master + 2 children).
4) In the master's preamble: \usepackage{chapterbib}
5) Each child file has its own bibliography.

When I process the master with pdflatex, the following BibTeX error message 
appears: 
==============================================
This is BibTeX, Version 0.99d (TeX Live 2016/dev)
Capacity: max_strings=35307, hash_size=35307, hash_prime=30011
The top-level auxiliary file: main.aux
A level-1 auxiliary file: 2_home_rudi_temp_lyx_chapbib_c01.aux
The style file: plain.bst
A level-1 auxiliary file: 3_home_rudi_temp_lyx_chapbib_c02.aux
Illegal, another \bibstyle command---line 4 of file 
3_home_rudi_temp_lyx_chapbib_c02.aux
 : \bibstyle
 :          {plain}
I'm skipping whatever remains of this command
Illegal, another \bibdata command---line 5 of file 
3_home_rudi_temp_lyx_chapbib_c02.aux
 : \bibdata
 :         {mysample}
I'm skipping whatever remains of this command
Database file #1: mysample.bib
==============================================

I did not commit any error, LaTeXwise speaking. When I exported everything to 
pdflatex, the following sequence:

pdflatex main
bibtexall
pdflatex main
pdflatex main

produced the expected and correct PDF file.
Below, I'm attaching the files (*.lyx, *.tex, *.bib)
Any ideas?
==================(main.lyx)============================
#LyX 2.2 created this file. For more info see http://www.lyx.org/
\lyxformat 508
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass book
\begin_preamble
\usepackage{chapterbib}
\end_preamble
\use_default_options false
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "lmodern" "default"
\font_sans "lmss" "default"
\font_typewriter "lmtt" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\pdf_title "Chapterbib test 01"
\pdf_author "Rudi Gaelzer - IF/UFRGS"
\pdf_bookmarks true
\pdf_bookmarksnumbered false
\pdf_bookmarksopen false
\pdf_bookmarksopenlevel 1
\pdf_breaklinks true
\pdf_pdfborder true
\pdf_colorlinks true
\pdf_backref false
\pdf_pdfusetitle true
\pdf_quoted_options "linkcolor=blue, citecolor=blue"
\papersize a4paper
\use_geometry true
\use_package amsmath 2
\use_package amssymb 2
\use_package cancel 1
\use_package esint 0
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 0
\index Index
\shortcut idx
\color #008000
\end_index
\leftmargin 1in
\topmargin 1in
\rightmargin 0.8in
\bottommargin 1in
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Standard
This is the main file.
\end_layout

\begin_layout Standard
\begin_inset CommandInset include
LatexCommand include
filename "c01.lyx"

\end_inset


\end_layout

\begin_layout Standard
\begin_inset CommandInset include
LatexCommand include
filename "c02.lyx"

\end_inset


\end_layout

\end_body
\end_document
==================(c01.lyx)============================
#LyX 2.2 created this file. For more info see http://www.lyx.org/
\lyxformat 508
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass book
\begin_preamble
\usepackage{chapterbib}
\end_preamble
\use_default_options false
\master main.lyx
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "lmodern" "default"
\font_sans "lmss" "default"
\font_typewriter "lmtt" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\pdf_author "Rudi Gaelzer - IF/UFRGS"
\pdf_bookmarks true
\pdf_bookmarksnumbered false
\pdf_bookmarksopen false
\pdf_bookmarksopenlevel 1
\pdf_breaklinks true
\pdf_pdfborder true
\pdf_colorlinks true
\pdf_backref false
\pdf_pdfusetitle true
\pdf_quoted_options "linkcolor=blue, citecolor=blue"
\papersize a4paper
\use_geometry true
\use_package amsmath 2
\use_package amssymb 2
\use_package cancel 1
\use_package esint 0
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 0
\index Index
\shortcut idx
\color #008000
\end_index
\leftmargin 1in
\topmargin 1in
\rightmargin 0.8in
\bottommargin 1in
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Chapter
First Chapter
\end_layout

\begin_layout Standard
Some text.
 
\begin_inset CommandInset citation
LatexCommand nocite
key "small,ab94"

\end_inset


\end_layout

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

\end_inset


\end_layout

\end_body
\end_document
==================(c02.lyx)============================
#LyX 2.2 created this file. For more info see http://www.lyx.org/
\lyxformat 508
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass book
\begin_preamble
\usepackage{chapterbib}
\end_preamble
\use_default_options false
\master main.lyx
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "lmodern" "default"
\font_sans "lmss" "default"
\font_typewriter "lmtt" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\pdf_author "Rudi Gaelzer - IF/UFRGS"
\pdf_bookmarks true
\pdf_bookmarksnumbered false
\pdf_bookmarksopen false
\pdf_bookmarksopenlevel 1
\pdf_breaklinks true
\pdf_pdfborder true
\pdf_colorlinks true
\pdf_backref false
\pdf_pdfusetitle true
\pdf_quoted_options "linkcolor=blue, citecolor=blue"
\papersize a4paper
\use_geometry true
\use_package amsmath 2
\use_package amssymb 2
\use_package cancel 1
\use_package esint 0
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 0
\index Index
\shortcut idx
\color #008000
\end_index
\leftmargin 1in
\topmargin 1in
\rightmargin 0.8in
\bottommargin 1in
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Chapter
Second Chapter
\end_layout

\begin_layout Standard
Some text.
 
\begin_inset CommandInset citation
LatexCommand nocite
key "big,m85"

\end_inset


\end_layout

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

\end_inset


\end_layout

\end_body
\end_document
==================(main.tex)============================
%% LyX 2.2.2 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[oneside,english]{book}
\usepackage{lmodern}
\renewcommand{\sfdefault}{lmss}
\renewcommand{\ttdefault}{lmtt}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=0.8in}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{amsmath}
\usepackage{amssymb}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{chapterbib}

\makeatother

\usepackage{babel}
\begin{document}
This is the main file.

\include{c01}

\include{c02}
\end{document}
==================(c01.tex)============================

\chapter{First Chapter}

Some text. \nocite{small,ab94}

\bibliographystyle{plain}
\bibliography{mysample}

==================(c02.tex)============================

\chapter{Second Chapter}

Some text. \nocite{big,m85}

\bibliographystyle{plain}
\bibliography{mysample}

==================(mysample.bib)============================
%  a sample bibliography file

@article{small,
   author = {Freely, I.P.},
   title = {A small paper},
   journal = {The journal of small papers},
   year = 1997,
   volume = {-1},
   note = {to appear},
}

@article{big,
   author = {Jass, Hugh},
   title = {A big paper},
   journal = {The journal of big papers},
   year = 7991,
   volume = {MCMXCVII},
}

@article{ahu61,
   author = {Arrow, Kenneth J. and Leonid Hurwicz and Hirofumi Uzawa},
   title = {Constraint qualifications in maximization problems},
   journal = {Naval Research Logistics Quarterly},
   volume = {8},
   year = 1961,
   pages = {175-191}
}

@book{ab94,
   author = {Charalambos D. Aliprantis and Kim C. Border},
   year = {1994},
   title = {Infinite Dimensional Analysis},
   publisher = {Springer},
   address = {Berlin}
}

@incollection{m85,
   author = {Maskin, Eric S.},
   year = {1985},
   title = {The theory of implementation in {N}ash equilibrium: a survey},
   booktitle = {Social Goals and Social Organization},
   editor = {Leonid Hurwicz and David Schmeidler and Hugo Sonnenschein},
   pages = {173-204},
   publisher = {Cambridge University Press},
   address = {Cambridge}
}

@inproceedings{ah2006,
   author = {Aggarwal, Gagan and Hartline, Jason D.},
   year = {2006},
   title = {Knapsack auctions},
   booktitle = {Proceedings of the 17th Annual ACM-SIAM Symposium on Discrete 
Algorithms},
   pages = {1083-1092},
   publisher = {Association for Computing Machinery},
   address = {New York}
}

@techreport{arrow48,
   author = {Arrow, Kenneth J.},
   title = {The possibility of a universal social welfare function},
   institution = {RAND Corporation},
   year = {1948},
   number = {P-41},
   type = {Report}
}

@unpublished{FudenbergKreps1988,
   title = {A theory of learning, experimentation, and equilibrium in games},
   author = {Fudenberg, Drew and Kreps, David M.},
   year = {1988},
   note = {Unpublished paper}
}

-- 
Rudi Gaelzer
Institute of Physics
Federal University of Rio Grande do Sul
BRAZIL
Registered Linux user # 153741

Reply via email to