How do you force a citation to appear before a comma in LaTeX?

  • Context: LaTeX 
  • Thread starter Thread starter philip041
  • Start date Start date
  • Tags Tags
    Force Latex
Click For Summary

Discussion Overview

The discussion revolves around formatting citations in LaTeX, specifically how to position a citation before a comma in a sentence while maintaining the superscript format. The focus is on technical solutions and formatting conventions within LaTeX typesetting.

Discussion Character

  • Technical explanation

Main Points Raised

  • One participant describes a formatting issue where a citation appears after a comma instead of before it in superscript format.
  • Another participant suggests adding a space between the citation command and the comma to resolve the issue.
  • A subsequent reply notes that adding a space results in an unwanted gap between the citation and the comma.
  • Another participant proposes using a negative space command (\!) to force the comma back after the citation.
  • One participant inquires whether using an intervening pair of curly braces ({}) would be effective, referencing it as a common method for such formatting issues.
  • A later reply confirms that using the intervening curly braces successfully resolves the formatting problem.

Areas of Agreement / Disagreement

Participants express differing views on the best method to achieve the desired citation formatting, with multiple proposed solutions and no consensus on a single approach.

Contextual Notes

Participants do not address potential limitations or assumptions regarding LaTeX formatting rules or the specific citation package used.

philip041
Messages
104
Reaction score
0
I have a sentence reading:

\usepackage[superscript]{cite}

Someone said something super important\cite{someone20}, and it was super interesting.

1) Someone, science journal, 2020.

Except it actually comes out with the ^1 AFTER the comma. I want it to appear superscript to the name not a comma. How?

Cheers
 
Physics news on Phys.org
Put a space between \cite{someone20} and the comma after it.
 
cristo said:
Put a space between \cite{someone20} and the comma after it.

but when i did this there is now a space netween the citation and the comma. I want it to read

thing^ref,

not

thing^ref ,
 
philip041 said:
but when i did this there is now a space netween the citation and the comma. I want it to read

thing^ref,

not

thing^ref ,

It's presumably not designed to work like that (because the comma should be after the word, and not after the superscript citation). Try forcing the comma back with some \! between the \cite and the comma.
 
Does putting an intervening {} work? That's the usual method for these sorts of things.
 
yes that, ({}) worked, cheers
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
6K
  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
14K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 21 ·
Replies
21
Views
4K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 87 ·
3
Replies
87
Views
11K