Is there an easy way to do IEEE style reference

S

SSK

Is there an easy way to do IEEE style references in Word? If you're not
familiar with it, you put a number in square brackets [x] next to the
citation and have a list of references at the end of the document arranged by
first appearance.

So, it's basically like endnotes, but not superscript, and in square
brackets. Is there a way to make Word automatically put square brackets
around endnote numbers?
 
J

Jean-Guy Marcil

SSK was telling us:
SSK nous racontait que :
Is there an easy way to do IEEE style references in Word? If you're
not familiar with it, you put a number in square brackets [x] next to
the citation and have a list of references at the end of the document
arranged by first appearance.

So, it's basically like endnotes, but not superscript, and in square
brackets. Is there a way to make Word automatically put square
brackets around endnote numbers?

I think you need a macro. Try this:

'_______________________________________
Sub InsertFootnote()

Dim LocCursor As Range
Dim LocCursor1 As Range

Set LocCursor = Selection.Range

With ActiveDocument.Range(Start:=ActiveDocument.Content.Start, End:= _
ActiveDocument.Content.End)
With .EndnoteOptions
.Location = wdEndOfDocument
.NumberingRule = wdRestartContinuous
.StartingNumber = 1
.NumberStyle = wdNoteNumberStyleArabic
End With
.Endnotes.Add Range:=Selection.Range, Reference:=""
End With

With Selection
.HomeKey wdLine
.MoveRight wdSentence, 1, wdExtend
.Font.Superscript = False
.HomeKey wdLine
.TypeText "["
.MoveRight wdCharacter, 1
.TypeText "]"
.EndKey wdLine
End With

With LocCursor
.InsertBefore "["
.SetRange LocCursor.Start, LocCursor.End + 1
.InsertAfter "]"
.Font.Superscript = True
.SetRange LocCursor.End, LocCursor.End
End With

Set LocCursor1 = LocCursor.Duplicate
LocCursor1.SetRange LocCursor1.End, LocCursor1.End + 1

If Not LocCursor1 = " " Then
LocCursor.InsertAfter " "
LocCursor.Font.Superscript = False
End If

End Sub
'_______________________________________

Make sure you do not change the name of the macro if you want this to happen
automatically.
If you want to have the option of inserting regular footnote *and* these
special endnotes, change the macro name and call the macro explicitly when
you need an endnote (as is, whenever you do Insert > Reference... >
Footnote, my macro will be automatically called).

See
http://word.mvps.org/faqs/macrosvba/CreateAMacro.htm
for help with installing/using macros from NG.


--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
T

Tony Jollans

It's pretty difficult to do automatically - I haven't checked out Jean-Guy's
code but it's probably good.

However, you might find it easier to do as a final step before submitting
your document. While you're working create your citations as Endnotes and
when you're done do a Find and Replace: Find ^e (caret, e) and Replace with
[^&] (left bracket, caret, ampersand, right bracket) - format the
replacement as Not Superscript/Subscript - then hit Replace All.
 
J

Jean-Guy Marcil

Tony Jollans was telling us:
Tony Jollans nous racontait que :
It's pretty difficult to do automatically - I haven't checked out
Jean-Guy's code but it's probably good.

However, you might find it easier to do as a final step before
submitting your document. While you're working create your citations
as Endnotes and when you're done do a Find and Replace: Find ^e
(caret, e) and Replace with [^&] (left bracket, caret, ampersand,
right bracket) - format the replacement as Not Superscript/Subscript
- then hit Replace All.

Ah, right... I got carried away and forgot to think about other options!

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
T

Tony Jollans

No problem - I do it all the time!

I love code, but all Office programs actually have immense power without it
and I like to harness that if I can - but you can't remember it all, all the
time :)

--
Enjoy,
Tony


Jean-Guy Marcil said:
Tony Jollans was telling us:
Tony Jollans nous racontait que :
It's pretty difficult to do automatically - I haven't checked out
Jean-Guy's code but it's probably good.

However, you might find it easier to do as a final step before
submitting your document. While you're working create your citations
as Endnotes and when you're done do a Find and Replace: Find ^e
(caret, e) and Replace with [^&] (left bracket, caret, ampersand,
right bracket) - format the replacement as Not Superscript/Subscript
- then hit Replace All.

Ah, right... I got carried away and forgot to think about other options!

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top