-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpes.sty
More file actions
133 lines (117 loc) · 3.75 KB
/
pes.sty
File metadata and controls
133 lines (117 loc) · 3.75 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
%%
%% This is file `pes.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% pes.dtx (with options: `package')
%% ---------------------------------------------------------------
%% pes --- Potential energy surface diagrams
%% Maintained by Sverre Loeyland
%% Contact: https://github.com/sverl/pes
%% Released under the LaTeX Project Public License v1.3c or later
%% See https://www.latex-project.org/lppl.txt
%% ---------------------------------------------------------------
%% Copyright (C) 2018 by
%% Sverre Loeyland https://github.com/sverl/pes
%%
%% It may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License (LPPL), either version 1.3c of
%% this license or (at your option) any later version. The latest
%% version of this license is in the file:
%%
%% https://www.latex-project.org/lppl.txt
%%
%% This work is "maintained" (as per LPPL maintenance status) by
%% Sverre Loeyland.
%%
%% This work consists of the files pes.dtx and
%% makefile
%% and the derived files pes.ins,
%% pes.pdf,
%% pes.sty and
%% README.md
%% ---------------------------------------------------------------
\RequirePackage{xparse}
\ProvidesExplPackage
{pes} {2018/06/07} {1.0}
{Potential energy surface diagrams}
\RequirePackage{siunitx}
\DeclareSIUnit[number-unit-product = {}] \Hartree {Ha}
\RequirePackage{pgfplots}
\pgfplotsset{compat=1.15}
\keys_define:nn {pes} {
env .tl_set:N = \__pes_env,
env .initial:n = {figure},
width .tl_set:N = \__pes_width,
width .initial:n = {\axisdefaultwidth},
height .tl_set:N = \__pes_height,
height .initial:n = {\axisdefaultheight},
xlabel .tl_set:N = \__pes_xlabel,
xlabel .initial:n = {reaction~coordinate},
ylabel .tl_set:N = \__pes_ylabel,
ylabel .initial:n = {$E/\si{\Hartree}$},
}
\ProcessKeysOptions{pes}
\keys_define:nn {pes/env} {
env .choice:,
env / none .code:n = { \tl_set_eq:NN \__pes_env \c__pes_env_none },
env / .code:n = { \tl_set_eq:NN \__pes_env figure },
env / unknown .code:n = { \tl_set_eq:NN \__pes_env #1 },
width .tl_set:N = \__pes_width,
width .default:n = {\axisdefaultwidth},
height .tl_set:N = \__pes_height,
height .default:n = {\axisdefaultheight},
xlabel .tl_set:N = \__pes_xlabel,
xlabel .default:n = {reaction~coordinate},
ylabel .tl_set:N = \__pes_ylabel,
ylabel .default:n = {$E/\si{\Hartree}$},
caption .tl_set:N = \__pes_caption,
label .tl_set:N = \__pes_label,
zero .tl_set:N = \__pes_zero,
zero .initial:n = {0},
}
\NewDocumentEnvironment{pes}{O{}}{
\keys_set:nn {pes/env}{#1}
\tl_if_eq:NNTF \__pes_env \__pes_env_none {} {
\begin{\__pes_env}
\centering
}
\begin{tikzpicture}
\begin{axis}[width=\__pes_width,
height=\__pes_height,
axis~lines=left,
enlarge~x~limits=0.2,
enlarge~y~limits=0.2,
xlabel=\__pes_xlabel,
ylabel=\__pes_ylabel,
xmajorticks=false]
}{
\end{axis}
\end{tikzpicture}
\tl_if_empty:NF \__pes_caption {\caption{\__pes_caption}}
\tl_if_empty:NF \__pes_label {\label{\__pes_label}}
\tl_if_eq:NNTF \__pes_env \__pes_env_none {} {
\end{\__pes_env}
}
}
\tikzset{coord/.style={mark=none}}
\tikzset{level/.style={minimum~width=8mm}}
\tikzset{levelline/.style={ultra~thick}}
\tikzset{levellabel/.style={node~distance=1em}}
\NewDocumentCommand{\level}{mmmo}{
\addplot[coord]coordinates{(#2,#3-\__pes_zero)}
node(#1)[level]{}
\IfValueT{#4}{
node[graphics]{#4}
};
\draw[levelline](#1.west)--(#1.east);
\node[levellabel,below~of=#1]{#1};
}
\tikzset{edge/.style={}}
\NewDocumentCommand{\edge}{mm}{
\draw[edge](#1.east)--(#2.west);
}
\endinput
%%
%% End of file `pes.sty'.