summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/beautybook/stys/Beautybook-birkar.sty
blob: 605d71877cfb64a584504a61160ee71136e6f592 (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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{stys/Beautybook-birkar}[2022/05/21,v1.0]
\usepackage{anyfontsize} 
\usepackage[dvipsnames,svgnames,x11names,table]{xcolor}% Driver-independent color extensions
\usepackage{tikz}
\usetikzlibrary{intersections, positioning, fit, backgrounds, shapes, fadings,
decorations.pathmorphing, graphs, quotes, angles, calc, through, backgrounds} 
\usepackage{graphicx} 
\usetikzlibrary{calc,fadings,patterns}
\usepackage{adjustbox} 

% Define the layers to be used in document.
% *****************************************************
\pgfdeclarelayer{background} 
\pgfdeclarelayer{foreground} 
\pgfdeclarelayer{top} 
\pgfdeclarelayer{bottom} 
\pgfsetlayers{bottom,background,main,foreground,top}
\definecolor{RED}{RGB}{220, 41, 26}
\definecolor{arc color}{HTML}{546E7A}

\tikzfading[name=fade right,
                    right color =transparent!100,
                    left color=transparent!0]
\tikzfading[name=fade left,
                    left color =transparent!100,
                    right color=transparent!50]
\tikzfading[name=fade up,
                    top color =transparent!100,
                    bottom color=transparent!50]
\tikzfading[name=fade down,
                    bottom color =transparent!100,
                    top color=transparent!50]
\makeatletter
\newcommand*\makecover{
    %% Use the Tikz library positioning and clear the page header and footer
    \usetikzlibrary{positioning}
    \thispagestyle{empty}
    \begin{tikzpicture}[remember picture,overlay]
        \begin{pgfonlayer}{bottom}
            \fill[coverfgcolor]         
            (current page.north west) rectangle (current page.south east);
            \fill[RED]
            ([shift={(2.05cm,0)}]current page.north west) rectangle ([shift={(2.35cm,-6cm)}]current page.north west);
            \fill[coverfgcolor!80,opacity=0.5]
            ([shift={(0,-2cm)}]current page.north west) arc (90:-90:.3\paperheight) --cycle;
            \fill[coverfgcolor!80,opacity=0.5]
            ([shift={(0,-4cm)}]current page.north east) arc (90:270:.2\paperheight) --cycle;
            \fill[coverfgcolor!80] 
            (current page.north west) rectangle ([shift={(2cm,0)}]current page.south west);
            \begin{scope}[opacity=0.8]
            \coordinate (triangleA) at ([shift={(1cm,-1cm)}]current page.north);
            \coordinate (triangleB) at ([shift={(-.85\linewidth,-.46\paperheight)}]triangleA);
            \coordinate (triangleC) at ([shift={(.52\linewidth,-.46\paperheight)}]triangleA);
            \draw[name path=triangle,very thick,coverfgcolor!70!white] 
            (triangleA)--(triangleB)--(triangleC)--cycle;
            \draw[name path=circle,very thick,coverfgcolor!70!white]
            ([shift={(-1.6cm,-7.3cm)}]triangleA) coordinate (O) circle(6cm);
            %标注每个交点坐标
            \fill [name intersections={of=triangle and circle, name=i, total=\t}]
            [coverbar,opacity=0.5, every node/.style={above left, white, opacity=1}]
            \foreach \s in {1,...,\t}{(i-\s) circle (1em) node {}};
            \draw[name path=l,very thick,coverfgcolor!70!white] (i-1) -- (triangleC);
            \draw[very thick,coverfgcolor!70!white] (i-6) -- (triangleB);
            \draw[name path=l2,very thick,coverfgcolor!70!white] (i-4) -- (triangleA);
            \fill[name intersections={of=l and circle,name=j,total=\l}]
            [coverbar,opacity=0.5, every node/.style={above left, white, opacity=1}]
            \foreach \c in {1,...,\l}{(j-\c) circle (1em) node {}};

            \fill[name intersections={of=l2 and l,name=jj,total=\ll}]
            [coverbar,opacity=0.5, every node/.style={above left, white, opacity=1}]
            \foreach \cc in {1,...,\ll}{(jj-\cc) circle (1em) node {}};
            \end{scope}
        \end{pgfonlayer}
        \begin{pgfonlayer}{foreground}
            \fill[coverbar,opacity=.5]
        ([yshift=2\outermarginwidth]current page.west) rectangle ([xshift=\outermarginwidth,yshift=-.2\outermarginwidth]current page.west); 
        \end{pgfonlayer}
        \shade[left color=coverfgcolor,right color=coverfgcolor!60,opacity=.3]
        ([xshift=\outermarginwidth,yshift=2\outermarginwidth]current page.west) rectangle (current page.south east); 
        \node[anchor=south] at ([xshift=.3\outermarginwidth,yshift=-.4\covershift]current page.north) {%
        \parbox{.8\paperwidth}{
        \filright
        \color{white}\fontsize{20}{23}\selectfont\@bookseries}
        }; 
        \node[ anchor=south] at ([xshift=.3\outermarginwidth,yshift=-.57\paperheight]current page.north)
    {\parbox{.8\paperwidth}{%
            \raggedright%
 {\renewcommand\baselinestretch{1.1}\selectfont           \color{white}\bfseries\fontsize{40}{40}\selectfont\@title\\[0.5ex]
            \color{white}\fontsize{30}{30}\selectfont
            \ifdefvoid{\@subtitle}{}{\@subtitle}\par}
        }};
    \node[anchor=west,font=\fontsize{23}{23}\selectfont,text=white] at ([xshift=1.8\outermarginwidth,yshift=-.6\covershift]current page.west) {\@edition};
    \node[anchor=west,font=\Huge,text=white] at ([xshift=1.8\outermarginwidth,yshift=\covershift]current page.west) {\@author};
    \node[left,text=white,font=\rmfamily\Large,] at
    ([shift={(-1cm,2cm)}]current page.south east)  %
    {\raisebox{-1.1cm}{\includegraphics[width=0.2\linewidth]{\@presslogo}}\hspace*{-3.5ex}\begin{varwidth}{.4\textwidth}\tikz\draw[white,line width=1.25pt] (0,0)--++(0,1cm);\,\raisebox{.25cm}{\@pressname} \end{varwidth}};%
    \end{tikzpicture}%
    \newpage
}
\makeatother

\endinput