LyXBibTex Reference Formating

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
wedgen
Posts: 6
Joined: Wed Dec 02, 2015 9:35 pm

BibTex Reference Formating

Post by wedgen »

Greetings!
I'm using Lyx 2.1.4 and I have a custom class generated by my school I'm using to write my Thesis. I'm using JabRef to build my .bib (not important for this question but FYI). I'm using the built-in citation and bib creation (insert-> List/TOC ->BibTeX Bibliography) and everything works fine except I'm getting a double chapter 4:
CHAPTER 4
DISCUSSION
Talk about stuff
4.1 Challenges?
4.2 Future work?
7
CHAPTER 4
REFERENCES
excerpt from lyx file:
\begin_layout Chapter
DISCUSSION
\end_layout

\begin_layout Standard
Talk about stuff
\end_layout

\begin_layout Section
Challenges?
\end_layout

\begin_layout Section
Future work?
\end_layout

\begin_layout Standard

\end_layout

\begin_layout Standard
\begin_inset CommandInset bibtex
LatexCommand bibtex
bibfiles "thesis"
options "bibtotoc,alpha"

\end_inset


\end_layout
I've attempted to use the Bibliography backmatter from the top drop down but that doesn't seem to help much. Is there a way to format how the bibtex displays using the built-in function? I looked through the Wiki but didn't see anything relevant, unless I simply missed something.

Appreciate any thoughts, please let me know if any other files would help. Thanks!

UPDATE:
I found http://wiki.lyx.org/BibTeX/Tips#toc1 and did what it said, but it didn't work. Still has Chapter X above REFERENCE. I looked at the class and see that bibname is set right and has no reference to any "chapters".

Thanks!
Attachments
siuethesis.cls
School Thesis Class
(16.23 KiB) Downloaded 182 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Re: BibTex Reference Formating

Post by scottkosty »

If you are willing to spend the time to make a minimal example, it would be easier for someone to help. See here:
http://wiki.lyx.org/FAQ/MinimalExample
wedgen
Posts: 6
Joined: Wed Dec 02, 2015 9:35 pm

Re: BibTex Reference Formating

Post by wedgen »

Fair request. It wasn't hard I already had an example .lyx file ready just needed to add the bib stuff.
Attached a 7z which includes all the required files, I also included the original example .tex file which the lyx template was derived from (where bibtex works).
Attachments
thesis.7z
(18.2 KiB) Downloaded 127 times
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

BibTex Reference Formating

Post by Johannes_B »

Your LyX file does not compile for me, since the natbib option round is not compatible to using a non-numeric bibliography style.

Just compiling the thesis_sample, everything looks like expected.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
wedgen
Posts: 6
Joined: Wed Dec 02, 2015 9:35 pm

Re: BibTex Reference Formating

Post by wedgen »

Thanks for trying. I'm not sure about the option "round", I looked and didn't see any reference in the lyx file for round in Natbib. I have it setup for Numerical with the option Alpha (same as the thesis_example).
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

BibTex Reference Formating

Post by scottkosty »

wedgen wrote:Fair request. It wasn't hard I already had an example .lyx file ready just needed to add the bib stuff.
Actually it is hard. Did you read the link? Your example is not a minimal example.

As for the natbib round thing, your .lyx file compiled for me and I did not see a double. Along with your minimal example can you post the .pdf that you get and specify which page is the duplicate?
wedgen
Posts: 6
Joined: Wed Dec 02, 2015 9:35 pm

Re: BibTex Reference Formating

Post by wedgen »

Appreciate your reply Scottkosty, I did indeed read the link and what I provided seemed to be what I needed to produce. If I misinterpreted the intent I apologize. I felt since I was using a special class that I should include it and I removed everything from the preamble whilst still producing the error.

Please find the .pdf of the output attached.

Thanks!
Attachments
lyxthesis.pdf
(66.86 KiB) Downloaded 139 times
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Re: BibTex Reference Formating

Post by scottkosty »

I wonder if the class wants it to work that way. For example, if you have several chapters and each has a references section, then when someone is flipping through the book it is easy to know what chapter each references section goes with.
wedgen
Posts: 6
Joined: Wed Dec 02, 2015 9:35 pm

Re: BibTex Reference Formating

Post by wedgen »

I don't think so, In the .tex example there's only one REFERENCE section and it was put at the end. I've use the latex command that they use in the example but all that does it put REFERENCE on a separate page then new page chapter x REFERENCE <my references>. See attached.

I guess the big question is what is LyX putting before it lists references used. According to the FAQ it uses bibname which I renewed and didn't make a difference.
Attachments
lyxthesis2.pdf
with \renewcommand\bibname{New Bibliography Header}
(67.33 KiB) Downloaded 147 times
lyxthesis.pdf
(67.28 KiB) Downloaded 121 times
lyxthesis.lyx
with \references added
(9.07 KiB) Downloaded 171 times
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

BibTex Reference Formating

Post by scottkosty »

wedgen wrote:I don't think so, In the .tex example there's only one REFERENCE section and it was put at the end. I've use the latex command that they use in the example but all that does it put REFERENCE on a separate page then new page chapter x REFERENCE <my references>. See attached.

I guess the big question is what is LyX putting before it lists references used. According to the FAQ it uses bibname which I renewed and didn't make a difference.
This question is easy to answer. Go to File > Export > LaTeX (pdflatex). This will create a .tex file. Compare that .tex file to the other one.
Post Reply