Debian Codegraph @

texmf-dist/tex/latex/ptolemaicastronomy/ptolemaicastronomy.sty

raw
1 %%
2 %% This is file `ptolemaicastronomy.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% ptolemaicastronomy.dtx (with options: `package')
8 %%
9 %% ptolemaicastronomy
10 %% ==================
11 %%
12 %% Diagrams of sphere models for variably strict conditionals (Lewis
13 %% counterfactuals)
14 %%
15 %% Author: Richard Zach
16 %% E-mail: [email protected]
17 %% License: Released under the LaTeX Project Public License v1.3c or later
18 %% See: http://www.latex-project.org/lppl.txt
19 %%
20 %% David K. Lewis (Counterfactuals, Blackwell 1973) introduced a sphere
21 %% semantics for counterfactual conditionals. He jokingly referred to the
22 %% diagrams depicting such sphere models as Ptolemaic astronomy, hence
23 %% the name of this package. It has nothing to do with Ptolemy or with
24 %% astronomy, sorry.
25 %%
26 %% The macros provided in this package aid in the construction of
27 %% sphere model diagrams in the style of Lewis. The macros all make use
28 %% of TikZ.
29 %%
30 %% for documentation and source code see
31 %% https://github.com/rzach/ptolemaic-astronomy
32 %%
33 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
34 \ProvidesPackage{ptolemaicastronomy}
35 [2018/04/08 v1.00 Diagrams of sphere models for variably strict conditionals (Lewis counterfactuals)]
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50 \RequirePackage{tikz}
51
52 \tikzset{
53 sphere/.style = {dotted},
54 sphere intersection/.style = {fill=lightgray},
55 sphere layer/.style = {fill=lightgray},
56 proposition/.style={smooth,tension=1.7},
57 }
58 \pgfkeyssetvalue{/tikz/layerwidth}{.5}
59 \pgfkeyssetvalue{/tikz/innerfactor}{.4}
60 \newcommand{\sphereplot}[1]{
61 circle
62 [radius=(#1)*\pgfkeysvalueof{/tikz/layerwidth}-
63 \pgfkeysvalueof{/tikz/layerwidth}*\pgfkeysvalueof{/tikz/innerfactor}]
64 }
65 \newcommand{\spheresystem}[2][]{
66 \foreach \i in {1,...,#2}{
67 \draw[sphere,#1] \sphereplot{\i} ;
68 }
69 }
70
71 \newcommand{\spherelayer}[2][]{
72 \begin{scope}[even odd rule]
73 \fill[#1,sphere layer]
74 \sphereplot{#2-1} \sphereplot{#2} ;
75 \end{scope}
76 }
77 \newcommand{\spherefill}[2][]{
78 \fill[sphere intersection,#1]
79 \sphereplot{#2} ;
80 }
81 \newcommand{\sphereintersect}[3][]{
82 \begin{scope}[even odd rule]
83 \path[clip] #3;
84 \spherefill[#1]{#2}
85 \end{scope}
86 }
87 \newcommand{\propositionplot}[4]{
88 plot [proposition]
89 coordinates {+(#1+#3/2:#4)
90 +(#1:#2*\pgfkeysvalueof{/tikz/layerwidth}-
91 \pgfkeysvalueof{/tikz/layerwidth}*.9
92 -\pgfkeysvalueof{/tikz/layerwidth}*\pgfkeysvalueof{/tikz/innerfactor})
93 +(#1-#3/2:#4)}
94 }
95 \newcommand{\proposition}[5][]{
96 \draw[proposition,#1] \propositionplot {#2}{#3}{#4}{#5} ;
97 }
98 \newcommand{\propositionintersect}[5][]{
99 \begin{scope}
100 \path[clip] \propositionplot{#2}{#3}{#4}{#5};
101 \spherefill[#1]{#3}
102 \end{scope}
103 \draw[proposition,#1] \propositionplot{#2}{#3}{#4}{#5};
104 }
105 \newcommand{\spherepos}[4][]{
106 \begin{scope}[shift=(#2:#3*\pgfkeysvalueof{/tikz/layerwidth}-
107 \pgfkeysvalueof{/tikz/layerwidth}/2-
108 \pgfkeysvalueof{/tikz/layerwidth}*\pgfkeysvalueof{/tikz/innerfactor})]
109 \path[#1] #4 ;
110 \end{scope}
111 }
112 \endinput
113 %%
114 %% End of file `ptolemaicastronomy.sty'.