GeneralSection heading style for References

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Section heading style for References

Post by curiouslearn »

Hi,

I want to change the section heading style for the "References" section. I want the word "References" appear in the center, bold, and font size 12pt (the same font size that I am using for the rest of my document).

The default style of section heading in the article class that is induced by the command \bibliography{filename.bib} is larger than the 12pt font and is not centered.

Is there an easy way to change the section heading style for the References section or suppress the heading so that I can manually typeset the heading?

Thanks very much.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Section heading style for References

Post by curiouslearn »

From searching the web, I learnt the following way of suppressing the section title of the bibliography section, and then used my own custom style.

Command

Code: Select all

\renewcommand{\refname}{}

gets rid of the section title name.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Section heading style for References

Post by Stefan Kottwitz »

Hi,

with the command above you would still get some vertical space. You could disable \section* temporarily:

Code: Select all

{\def\section*#1{}
\bibliography...
}
Stefan
LaTeX.org admin
curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Re: Section heading style for References

Post by curiouslearn »

Thanks very much Stefan. You are right. The vertical space was still present when I tried the solution in my post. I used \vspace to reduce that vertical space. However, your solution is better. Thanks.
TritonMan
Posts: 8
Joined: Tue Jun 01, 2010 1:58 am

Section heading style for References

Post by TritonMan »

I know this thread is old, but I think I have a more robust solution for anyone who
might still be trying to do this:

Code: Select all

\renewcommand\bibsection{\subsection{\refname}}
You can replace \subsection with whatever section type you like, which will keep it nicely in line with the style of the rest of your doc. It worked nicely for a project report I had to do a while ago - I remember I had trouble finding anything documented about it then!
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Section heading style for References

Post by gmedina »

TritonMan wrote:I know this thread is old, but I think I have a more robust solution for anyone who
might still be trying to do this:

Code: Select all

\renewcommand\bibsection{\subsection{\refname}}
You can replace \subsection with whatever section type you like, which will keep it nicely in line with the style of the rest of your doc. It worked nicely for a project report I had to do a while ago - I remember I had trouble finding anything documented about it then!
Please explain what exactly do you mean by "more robust" The line of code you just posted produces the error
! LaTeX Error: \bibsection undefined.
with the standard classes (book, report, article) and with the KOMA_Script document classes (scrbook, scrreprt); the cause of the error is simple: \bibsection is not defined for those classes.

In fact, your line only compiles with the memoir document class.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
TritonMan
Posts: 8
Joined: Tue Jun 01, 2010 1:58 am

Section heading style for References

Post by TritonMan »

Well, I just used a line like that in my thesis, which is based on the report class, and it compiles with no errors or warnings. I'm using the natbib package, which may define the \bibsection macro regardless of document class.

The line of code from my thesis is:

Code: Select all

\renewcommand\bibsection{\chapter*{\refname}}
I mean it is more robust than adding negative lengths in your document, because if you do that then surely you have to keep an eye on how the layout changes if you change font size and the like, whereas this command makes it just the same as a regular title.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Section heading style for References

Post by localghost »

TritonMan wrote:[...] I'm using the natbib package, which may define the \bibsection macro regardless of document class. [...]
So it is. See the natbib manual (Section 2.12 - Other formatting options, p. 15f). But this is an essential information to be given together with your solution. Nobody knows at first sight where this command comes from.


Best regards
Thorsten
Post Reply