projects
/
latex-mlastyle.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Simplified BibTeX in embedded bibliography
[latex-mlastyle.git]
/
mlastyle.bst
diff --git
a/mlastyle.bst
b/mlastyle.bst
index f74f8fd7f2c5931097fb5d5d23c6b0e1a72f1225..6055ac2adb4d23e2b4e34bec686741b614f01f43 100644
(file)
--- a/
mlastyle.bst
+++ b/
mlastyle.bst
@@
-40,7
+40,7
@@
ENTRY
{ author.duplicate author.shared }
{ label }
{ author.duplicate author.shared }
{ label }
-INTEGERS { output.state before.all mid.sentence after.sentence after.block after.title author.different author.last author.flast }
+INTEGERS { output.state before.all mid.sentence after.sentence after.block after.title author.different author.last author.flast
citen.used url.used
}
% Rearranged such that true values require capital letters
FUNCTION {init.consts}
% Rearranged such that true values require capital letters
FUNCTION {init.consts}
@@
-54,6
+54,9
@@
FUNCTION {init.consts}
#1 'author.last :=
#2 'author.flast :=
%#3 'author.firstlast :=
#1 'author.last :=
#2 'author.flast :=
%#3 'author.firstlast :=
+
+ #0 'citen.used :=
+ #0 'url.used :=
}
STRINGS { s t u } % Added u
}
STRINGS { s t u } % Added u
@@
-616,7
+619,7
@@
FUNCTION {format.url}
{ "There's a url but no accessdate in " cite$ * warning$ "" }
{ accessdate " " * }
if$
{ "There's a url but no accessdate in " cite$ * warning$ "" }
{ accessdate " " * }
if$
- "$<$
" * url * "
$>$" *
+ "$<$
\url{" * url * "}
$>$" *
urlpath empty$
'skip$
{ do.period " Path: " * urlpath * }
urlpath empty$
'skip$
{ do.period " Path: " * urlpath * }
@@
-639,6
+642,7
@@
FUNCTION {format.article.crossref}
%if$
pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$
"{" * crossref * "}" *
%if$
pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$
"{" * crossref * "}" *
+ citen.used #1 + 'citen.used :=
}
FUNCTION {format.crossref.editor}
}
FUNCTION {format.crossref.editor}
@@
-683,9
+687,9
@@
FUNCTION {format.book.crossref}
% }
% { format.crossref.editor * }
% if$
% }
% { format.crossref.editor * }
% if$
- %" \citeN{" * crossref * "}" *
pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$
"{" * crossref * "}" *
pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$
"{" * crossref * "}" *
+ citen.used #1 + 'citen.used :=
}
FUNCTION {format.incoll.inproc.crossref}
}
FUNCTION {format.incoll.inproc.crossref}
@@
-706,9
+710,9
@@
FUNCTION {format.incoll.inproc.crossref}
% }
% { "In " format.crossref.editor * }
% if$
% }
% { "In " format.crossref.editor * }
% if$
-% " \citeN{" * crossref * "}" *
pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$
"{" * crossref * "}" *
pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$
"{" * crossref * "}" *
+ citen.used #1 + 'citen.used :=
}
FUNCTION {cite.title}
}
FUNCTION {cite.title}
@@
-1364,6
+1368,8
@@
FUNCTION {init.vars}
FUNCTION {forward.author.dup.check}
{
FUNCTION {forward.author.dup.check}
{
+ url empty$ 'skip$ { url.used #1 + 'url.used := } if$
+ crossref empty$ 'skip$ { citen.used #1 + 'citen.used := } if$
author empty$
{ editor empty$ { organization field.or.null 'a := }{ editor 'a :=} if$}
{ author 'a := }
author empty$
{ editor empty$ { organization field.or.null 'a := }{ editor 'a :=} if$}
{ author 'a := }
@@
-1456,12
+1462,20
@@
REVERSE {reverse.author}
%ITERATE {longest.label.pass}
FUNCTION {begin.bib}
%ITERATE {longest.label.pass}
FUNCTION {begin.bib}
-{ preamble$ empty$
+{
+ citen.used
+ { "\ifx\undefined\citeN\let\citeN\cite\fi" write$ newline$ }
+ 'skip$
+ if$
+ url.used
+ { "\ifx\undefined\url\let\url\relax\fi" write$ newline$ }
+ 'skip$
+ if$
+ preamble$ empty$
'skip$
{ preamble$ write$ newline$ }
if$
"\begin{thebibliography}{\rule{.5in}{0pt}}" write$ newline$
'skip$
{ preamble$ write$ newline$ }
if$
"\begin{thebibliography}{\rule{.5in}{0pt}}" write$ newline$
- "\ifx\undefined\citeN\let\citeN\cite\fi" write$ newline$
}
EXECUTE {begin.bib}
}
EXECUTE {begin.bib}