## LaTeX forum ⇒ Document Classes ⇒ amsmath conflicting with bibliography Topic is solved

Information and discussion about specific document classes and how to create your own document classes.
greenpatriot
Posts: 10
Joined: Tue Aug 10, 2010 10:27 pm

### amsmath conflicting with bibliography

Hello everyone,

I'm new to the forum and fairly new to the more involved features of LaTeX. I've written exams and papers before without any real trouble, but I am preparing to write my thesis and am having some formatting issues. My university has a "thesis template" on its webpage which I want to use, but I am having some problems with the amsmath package and the bibliography (I am using bibtex [natbib]). When I compile the code, the chapter preceding the \bibliography declaration is automatically generating an additional section titled " * " (just an asterisk!). For example, if the bibliography follows appendix B, a section "B.1 * " is generated. This section title is also appearing in the Table of Contents. When I comment out \usepackage{amsmath,amssymb}, the problem does not occur. I suspect the ams package is somehow conflicting with the university thesis class, but I'm not sure how or why - I've looked through the .cls file and can't find the source. Has anyone else ever had this problem before??

Also (somewhat related), I am trying to center the heading for my reference section by using \renewcommand{\refname}{\centering \Large \textbf{References}}, but the centering only works when \usepackage{amsmath,amssymb} is commented out. Is there a center declaration compatible with the ams package?

THANKS!!

-N
Last edited by cgnieder on Fri Jul 31, 2015 9:04 pm, edited 1 time in total.
Reason: code formatting

Tags:

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am
I’ve used natbib together with the AMS packages many times without problem. So without further information, it is difficult to guess what it could be.

You might want to read the board rules and the instructions given there about building a minimal working example. Most likely we would need access to your university's cls file to see if it's the culprit. Is it available on CTAN or elsewhere online?

What you describe is not the best way to center the "References" section heading. But what the best way would be depends on what document class you're using and other details, which is hard to know without a minimal example.

greenpatriot
Posts: 10
Joined: Tue Aug 10, 2010 10:27 pm
Thanks for the reply - the .cls file is available here:

http://www.phys.uconn.edu/computers/latex-styles-for-uconn-phd-thesis-and-prospectus

it's the 'uconnthesis.cls' file

Thanks again,

-N

Stefan Kottwitz
Posts: 9224
Joined: Mon Mar 10, 2008 9:44 pm
Hi,

I've tested the file uconnthesis_sample.tex and it's not compiling for me. Too much errors. I created my own sample file with a section, it's not centered. I can cee that centering sections has been commented out in the class file.

At least I cannot help you if you don't provide a minimal working example showing your problem. The class file is not of much help. At least I've tried. So, post some code and we shall see.

Stefan

greenpatriot
Posts: 10
Joined: Tue Aug 10, 2010 10:27 pm
Hi Stefan,

Thank you for your response. Here is a MWE which should show you the asterisk problem I initially wrote about. I noticed something as I was creating this file for you, though - I think the uconnthesis.cls is conflicting with my attempt to use bibtex. For this MWE, I removed the reference to my bibtex file and used the .cls definition for the bibliography (so that you wouldn't get an error about not having my file!). However, when I did so, I removed the \usepackage{natbib} line and I did not have the asterisk problem when I recompiled. I left the natbib line in the code so that you could see the problem I wrote about earlier. If you comment it out, the problem should go away. Although this technically solves the asterisk problem I am having, I would still prefer to use bibtex and not have to hand enter every reference. I appreciate any assistance you can offer.

\documentclass[   12pt          %    ,letterpaper  %   ,center       %   ,noupper      %   ]{uconnthesis} \usepackage{amsmath,amssymb}\usepackage[square]{natbib}\begin{document}\abstract{I will talk about stuff here in my abstract}\title{TITLE}\author{ME}\authorspreviousdegreelong{   B.S. COLLEGE\\   M.S. GRAD SCHOOL       }\authorspreviousdegreeshort{   M.S. Th. Phys.   }    \date{2011} \MajorAdvisor{ADVISOR}\AssociateAdvisorA{AA1}\AssociateAdvisorB{AA2} \maketitle\frontmatter \tableofcontents \mainmatter\chapter{Good Stuff}Blah blah blah\appendix\chapter{Derivation of Good Stuff}\thebibliography\bibitem J.Q. Public, Fancy Journal \textbf{vol.} num. (date)\end{document}

Thanks again!

-NolaN

Stefan Kottwitz
Posts: 9224
Joined: Mon Mar 10, 2008 9:44 pm
natbib doesn't work perfectly with the class file. Try redefining the heading:
\renewcommand*{\bibsection}{\chapter*{References}}

Stefan

greenpatriot
Posts: 10
Joined: Tue Aug 10, 2010 10:27 pm
You da man, Stefan - that worked great!

Thanks!!

-NolaN

bacciga
Posts: 2
Joined: Tue Mar 11, 2014 6:17 pm
Hi everyone.
i'm currently writing a paper to submit to a conference but i'm having some troubles with the custom class they have and the package amsmath.
basically the problem is exactly the same as greenpatriot. if i do not include amsmath everything works properly. as i include it, the references section starts doing something weird (asterisk section for example). this is driving me crazy because i really need amsmath package to write some equations (in particular I need align environment and the cases).

could you please take a look on it to see if you manage to find the compatibility problem?

thank you very much guys...
ps, i attached both the latex class and a main file.
Attachments
imekoTc42014_template.tex
this is an example of main using the class
imekoTc42014.cls
this is the class i'm using

joticajulian
Posts: 1
Joined: Fri Apr 04, 2014 4:56 pm
Hello bacciga,
I was working with imeko template too. To solve the problem open imekoTc42014.cls. Over there you have to put an extra '%' after ...\MakeUppercase}:


I don't understand very well why, but it is because the \@startsection can not have spaces, so this comment '%' avoids a space before the end of the redefinition. Source: http://tex.stackexchange.com/questions/145410/how-to-handle-section-with-asterisk-in-my-custom-class
Last edited by Stefan Kottwitz on Fri Apr 04, 2014 5:34 pm, edited 1 time in total.
Reason: code marked

bacciga
Posts: 2
Joined: Tue Mar 11, 2014 6:17 pm
Thank you very much for your help...now the problem is fixed.