LaTeX forum ⇒ Document Classesamsmath 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

Postby greenpatriot » Tue Aug 10, 2010 10:44 pm

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:

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Postby frabjous » Tue Aug 10, 2010 11:06 pm

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

Postby greenpatriot » Tue Aug 10, 2010 11:11 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

User avatar
Stefan Kottwitz
Site Admin
Posts: 8954
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Wed Aug 11, 2010 1:19 am

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
Site admin

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

Postby greenpatriot » Wed Aug 11, 2010 4:05 am

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.


  1. \documentclass[
  2. 12pt %
  3. ,letterpaper %
  4. ,center %
  5. ,noupper %
  6. ]{uconnthesis}
  7. \usepackage{amsmath,amssymb}
  8. \usepackage[square]{natbib}
  9. \begin{document}
  10. \abstract{I will talk about stuff here in my abstract}
  11. \title{TITLE}
  12. \author{ME}
  13. \authorspreviousdegreelong{
  14. B.S. COLLEGE\\
  15. M.S. GRAD SCHOOL
  16. }
  17. \authorspreviousdegreeshort{
  18. M.S. Th. Phys.
  19. }
  20. \date{2011}
  21.  
  22. \MajorAdvisor{ADVISOR}
  23. \AssociateAdvisorA{AA1}
  24. \AssociateAdvisorB{AA2}
  25.  
  26. \maketitle
  27. \frontmatter
  28.  
  29. \tableofcontents
  30.  
  31. \mainmatter
  32. \chapter{Good Stuff}
  33. Blah blah blah
  34. \appendix
  35. \chapter{Derivation of Good Stuff}
  36. \thebibliography
  37. \bibitem J.Q. Public, Fancy Journal \textbf{vol.} num. (date)
  38. \end{document}


Thanks again!

-NolaN

User avatar
Stefan Kottwitz
Site Admin
Posts: 8954
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Wed Aug 11, 2010 1:23 pm

natbib doesn't work perfectly with the class file. Try redefining the heading:
  1. \renewcommand*{\bibsection}{\chapter*{References}}

Stefan
Site admin

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

Postby greenpatriot » Wed Aug 11, 2010 2:18 pm

You da man, Stefan - that worked great!

Thanks!! :-D

-NolaN

bacciga
Posts: 2
Joined: Tue Mar 11, 2014 6:17 pm

Postby bacciga » Tue Mar 11, 2014 6:25 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
(4.37 KiB) Downloaded 137 times
imekoTc42014.cls
this is the class i'm using
(1.94 KiB) Downloaded 137 times

joticajulian
Posts: 1
Joined: Fri Apr 04, 2014 4:56 pm

Postby joticajulian » Fri Apr 04, 2014 5:08 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}:

  1. \renewcommand{\section}{
  2. \@startsection
  3. {section}{1}{\z@}{\baselineskip}{0.01ex}%
  4. {\centering\normalfont\normalsize\MakeUppercase}%
  5. }%
  6. \renewcommand{\thesection}{\roman{section}.}


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

Postby bacciga » Mon Apr 28, 2014 11:25 am

Thank you very much for your help...now the problem is fixed.


Return to “Document Classes”

Who is online

Users browsing this forum: No registered users and 1 guest