Skip to content

Commit

Permalink
how to compile this document
Browse files Browse the repository at this point in the history
  • Loading branch information
leegao committed Apr 3, 2017
1 parent f8615f5 commit d3178c9
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,14 @@ mode. For most inline equations, this is usually a non-issue.
#### How to compile this document
Make sure that you have the `tikz` and the `xcolor` packages installed locally.


python -m readme2tex --usepackage "tikz" --usepackage "xcolor" --output README.md --branch svgs

and of course

python -m readme2tex --usepackage "tikz" --usepackage "xcolor" --output README.md --branch svgs --add-git-hook

For the `png` relative mode, use

python -m readme2tex --usepackage "tikz" --usepackage "xcolor" --output README.md --branch master --nocdn --pngtrick

<p align="center"><img alt="\begin{tikzpicture}[scale=1, line join=bevel]&#10;% \a and \b are two macros defining characteristic&#10;% dimensions of the Penrose triangle.&#9;&#9;&#10;\pgfmathsetmacro{\a}{2.5}&#10;\pgfmathsetmacro{\b}{0.9}&#10;&#10;\tikzset{%&#10; apply style/.code = {\tikzset{#1}},&#10; triangle_edges/.style = {thick,draw=black}&#10;}&#10;&#10;\foreach \theta/\facestyle in {%&#10; 0/{triangle_edges, fill = gray!50},&#10; 120/{triangle_edges, fill = gray!25},&#10; 240/{triangle_edges, fill = gray!90}%&#10;}{&#10; \begin{scope}[rotate=\theta]&#10; \draw[apply style/.expand once=\facestyle]&#10; ({-sqrt(3)/2*\a},{-0.5*\a}) --&#10; ++(-\b,0) --&#10; ({0.5*\b},{\a+3*sqrt(3)/2*\b}) -- % higher point&#9;&#10; ({sqrt(3)/2*\a+2.5*\b},{-.5*\a-sqrt(3)/2*\b}) -- % rightmost point&#10; ++({-.5*\b},-{sqrt(3)/2*\b}) -- % lower point&#10; ({0.5*\b},{\a+sqrt(3)/2*\b}) --&#10; cycle;&#10; \end{scope}&#10; }&#9;&#10;\end{tikzpicture}" src="svgs/736b20c06fb7358bf352127ccc907a53.png?invert_in_darkmode" align=middle width="414.32985pt" height="358.9905pt"/></p>
34 changes: 33 additions & 1 deletion READOTHER.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,41 @@ mode. For most inline equations, this is usually a non-issue.
#### How to compile this document
Make sure that you have the `tikz` and the `xcolor` packages installed locally.


python -m readme2tex --usepackage "tikz" --usepackage "xcolor" --output README.md --branch svgs

and of course

python -m readme2tex --usepackage "tikz" --usepackage "xcolor" --output README.md --branch svgs --add-git-hook

For the `png` relative mode, use

python -m readme2tex --usepackage "tikz" --usepackage "xcolor" --output README.md --branch master --nocdn --pngtrick

\begin{tikzpicture}[scale=1, line join=bevel]
% \a and \b are two macros defining characteristic
% dimensions of the Penrose triangle.
\pgfmathsetmacro{\a}{2.5}
\pgfmathsetmacro{\b}{0.9}

\tikzset{%
apply style/.code = {\tikzset{#1}},
triangle_edges/.style = {thick,draw=black}
}

\foreach \theta/\facestyle in {%
0/{triangle_edges, fill = gray!50},
120/{triangle_edges, fill = gray!25},
240/{triangle_edges, fill = gray!90}%
}{
\begin{scope}[rotate=\theta]
\draw[apply style/.expand once=\facestyle]
({-sqrt(3)/2*\a},{-0.5*\a}) --
++(-\b,0) --
({0.5*\b},{\a+3*sqrt(3)/2*\b}) -- % higher point
({sqrt(3)/2*\a+2.5*\b},{-.5*\a-sqrt(3)/2*\b}) -- % rightmost point
++({-.5*\b},-{sqrt(3)/2*\b}) -- % lower point
({0.5*\b},{\a+sqrt(3)/2*\b}) --
cycle;
\end{scope}
}
\end{tikzpicture}
Binary file added svgs/736b20c06fb7358bf352127ccc907a53.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions svgs/736b20c06fb7358bf352127ccc907a53.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d3178c9

Please sign in to comment.