summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/achemso/natmove.sty
blob: 30c9e98995cdcb8de1c6b757ac1578766bea14a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
%%
%% This is file `natmove.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% natmove.dtx  (with options: `package')
%%  ----------------------------------------------------------------
%%  natmove --- Automatic citation moving with natbib
%%  Maintained by Joseph Wright
%%  E-mail: joseph.wright@morningstar2.co.uk
%%  Released under the LaTeX Project Public License v1.3c or later
%%  See http://www.latex-project.org/lppl.txt
%%  ----------------------------------------------------------------
%% 
\NeedsTeXFormat{LaTeX2e}
\def\nmv@id$#1: #2.#3 #4 #5-#6-#7 #8 #9${%
  #5/#6/#7\space v1.0\space}
\ProvidesPackage{natmove}
  [\nmv@id$Id: natmove.dtx 29 2008-08-22 07:47:26Z joseph $
   Automatic citation moving with natbib]
\begingroup
  \catcode`\Q=3
  \long\gdef\nmv@ifmtarg#1{%
    \nmv@xifmtarg#1QQ\@secondoftwo\@firstoftwo\@nil}
  \long\gdef\nmv@xifmtarg#1#2Q#3#4#5\@nil{#4}
\endgroup
\newif\ifnmv@cite
\newcommand*{\nmv@citex}{%
  \ifnmv@cite
    \expandafter\nmv@citex@
  \else
    \expandafter\nmv@natcitex
  \fi}
\def\nmv@citex@[#1][#2]#3{%
  \leavevmode
  \skip@\lastskip
  \unskip
  \begingroup
    \def\nmv@arg{[#1][#2]{#3}}%
    \newcommand*{\nmv@citex@end}{%
        \expandafter\nmv@natcitex\nmv@arg
      \endgroup}%
    \global\nmv@citefalse
    \nmv@citex@getnext\relax}
\newcommand*{\nmv@citex@getnext}[1]{%
  \futurelet\nmv@citex@next\nmv@citex@punct}
\newcommand*{\nmv@citex@punct}{%
  \let\nmv@citex@loop\nmv@citex@end
  \ifx.\nmv@citex@next\@empty
    \ifnum\spacefactor<\nmv@citex@sfac\else
      \let\nmv@citex@next\relax
      \let\nmv@citex@loop\nmv@citex@getnext
    \fi
  \fi
  \expandafter\nmv@citex@pnct\natmovechars\@empty
  \nmv@citex@loop}
\def\nmv@citex@pnct#1#2\@empty{%
  \ifx\nmv@citex@next#1\@empty
    #1%
    \let\nmv@citex@loop\nmv@citex@getnext
  \fi
  \ifx\@empty#2\@empty\else
    \expandafter\nmv@citex@pnct#2\@empty
  \fi}
\mathchardef\nmv@citex@sfac3000
\expandafter\renewcommand\expandafter*\expandafter{\expandafter%
  \frenchspacing\expandafter}\expandafter{%
  \frenchspacing
  \mathchardef\nmv@citex@sfac1001
  \sfcode`\.\nmv@citex@sfac
  \sfcode`\?\nmv@citex@sfac
  \sfcode`\!\nmv@citex@sfac}
\ifnum\sfcode`\.=\@m
  \frenchspacing
\fi
\newcommand*{\nmv@activate}{%
  \let\nmv@natcitex\@citex
  \let\@citex\nmv@citex
  \let\nmv@cite\cite
  \renewcommand*{\cite}[2][]{%
    \nmv@ifmtarg{##1}
      {\nmv@citetrue
       \nmv@cite{##2}}
      {\nmv@citefalse
       \nmv@cite[##1]{##2}}}}
\AtBeginDocument{
  \@ifpackageloaded{natbib}
    {\ifNAT@super
      \nmv@activate
     \else
      \nmv@notactivate
     \fi}
    {\PackageWarning{natmove}
       {The natbib package has not been loaded}}}
\newcommand*{\nmv@notactivate}{}
\newcommand*{\natmovechars}{.,;:}
\endinput
%%
%% End of file `natmove.sty'.