BibTeX, biblatex and biberGetting citations in ( ) instead of [ ]! Help?

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
moatox
Posts: 4
Joined: Wed Sep 30, 2009 5:23 pm

Getting citations in ( ) instead of [ ]! Help?

Post by moatox »

Hello all

I'm using a new thesis template which I came across on the Internet. Everything is great, however I'm getting my citations numbers in my text between normal brackets ( ) rather than square brackets regardless of the style used. It is working well (numbering appears between square brackets) in the bibliography list at the end but I can't get my head around fixing it within the text.

Example
Currently: As we see from (1), the method is...
Desired: As we see from [1], the method is...

Any help?
Thanks

Recommended reading 2024:

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

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

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

Getting citations in ( ) instead of [ ]! Help?

Post by Stefan Kottwitz »

Hi moatox,

welcome to the board!
If you are using natbib you could set the square option:

Code: Select all

\usepackage[square]{natbib}
Stefan
LaTeX.org admin
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Getting citations in ( ) instead of [ ]! Help?

Post by gmedina »

Hi moatox,

without natbib you will have to add something like the following to the preamble of your document:

Code: Select all

\usepackage{ifthen}
\makeatletter
\renewcommand\@cite[2]{%
  [{#1\ifthenelse{\boolean{@tempswa}}{,\nolinebreak[3] #2}{}}]}
\makeatother
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Getting citations in ( ) instead of [ ]! Help?

Post by localghost »

moatox wrote:[...] I'm using a new thesis template which I came across on the Internet. [...]
It is extremely helpful if you give a link where to find this template.


Best regards and welcome to the board
Thorsten
moatox
Posts: 4
Joined: Wed Sep 30, 2009 5:23 pm

Re: Getting citations in ( ) instead of [ ]! Help?

Post by moatox »

Hello all and thanks for your replies..

I reckon am not using natbib.. or at least am not specifying this! .. Tried both solutions but didn't work.

Gmedina's change nothing while Stephan's give a LaTeX error: Option clash for package natlib.

You can tell I don't know what am doing :)

btw, I snatched the template from here
http://www-h.eng.cam.ac.uk/help/tpl/tex ... esisStyle/


Advice?
Many thanks
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Getting citations in ( ) instead of [ ]! Help?

Post by localghost »

The second point under »Frequently Asked Questions« on the given site answers exactly your question. This sounds to me that round braces are the default setting. Hence there must be some changes at a critical place. If the problem persists, build a minimal working example (MWE) with this class.
moatox
Posts: 4
Joined: Wed Sep 30, 2009 5:23 pm

Re: Getting citations in ( ) instead of [ ]! Help?

Post by moatox »

You're right - sorry I should've seen it.

And Stephan's tip was correct, but as the package was defined in the class file, defining it again in the main file created a clash.

Cheers
M
Post Reply