LaTeX forum ⇒ GeneralSection heading style for References

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

Section heading style for References

Postby curiouslearn » Wed Feb 25, 2009 8:26 pm

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.

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

Postby curiouslearn » Wed Feb 25, 2009 10:57 pm

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
  1. \renewcommand{\refname}{}

gets rid of the section title name.

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

Postby Stefan Kottwitz » Sun Mar 01, 2009 1:40 am

Hi,

with the command above you would still get some vertical space. You could disable \section* temporarily:
  1. {\def\section*#1{}
  2. \bibliography...
  3. }


Stefan
Site admin

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

Postby curiouslearn » Mon Mar 02, 2009 6:13 pm

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

Postby TritonMan » Tue Jun 01, 2010 2:04 am

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:

  1. \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

Postby gmedina » Tue Jun 01, 2010 3:05 am

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:

  1. \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

Postby TritonMan » Wed Jun 02, 2010 12:21 pm

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:

  1. \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: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Thu Jun 03, 2010 7:13 pm

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
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1


Return to “General”

Who is online

Users browsing this forum: No registered users and 7 guests