From d8cb849ab4ef0f9e845441a7ded26675b5437efe Mon Sep 17 00:00:00 2001 From: Iipin <52832022+Iipin@users.noreply.github.com> Date: Sat, 21 Dec 2019 18:47:08 +0100 Subject: [PATCH] Add examples --- .gitignore | 3 +++ .travis.yml | 25 +++++++++++++++++++++++++ examples.tex | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 examples.tex diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d0dc24e --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.log +*.pdf +*.aux diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..a70d6c6 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,25 @@ +dist: bionic +language: minimal +branches: + only: + - master +before_install: +- sudo apt-get update +- sudo apt-get install -y texlive-latex-base texlive-latex-extra +jobs: + include: + - stage: build + script: + - pdflatex examples.tex +before_deploy: +- git tag -f ${TRAVIS_BRANCH}-latest +deploy: + provider: releases + api_key: + secure: WbLA7p9Zpb373ACBLESDJpdgq7BNarjt/TdJ9j0Dx88wwNmUFkLZ0LUUahHimuPLy4CP2Cnw1VeavSbP6JZLxWBbRn3iPqDVVDsXAAPMOy+HpBoVkLrYP1ZH2Hw4PfH0ga5hN/OGIc3Riq5VhARItJ+X8nD0AMqxRH+nAZWjXEb2frKc365xBYRdniNgQJSuUjThdBoNIRFvgJEIMWfYmNc2UFbQ831jhqbxpdhHVZWP6HARyZi8D6nOUgJsfFXo7USXcp1CvdYDser9xFSdPa0rnJVWxKQKSbi+SGvAkglOgjhaMkrAg1usIJHss4gckLOT587AokQcoKHw04ovEdHBL4gNM46SlHoSfUu0nlR+G5uCdJ+CuITUtqQaJoU+5rVia2s3ZrSCn7tvMrWCpM+7LJBUnmVP0ddjdTRL+ov4uvtIL3+qWWGtuIjLNAsOjGuBRnK5Vk/CSdp3NmIrNc/X4ELAhrRYQaivq1zxdTv6SFuw37uliesRFXLjsnCKhck+fo4Nk9T819yB6Pcm/PbI0RcEUJqw1lzFfyr8Vqtio/l8QJbXYwraObYFlTGEOYTJtciDNP/fR87tlQEN4Ijb1wtcQA8W5coxUH+uINbsa9dSLoq7/yQsRuhqbjLKcSL1SVCZ2FhT+3f+7vxy1Cz8TZOH0BdqfBI3upcxkW8= + file: examples.pdf + on: + repo: riichi/tikz-riichi + all_branches: true + skip_cleanup: true + overwrite: true diff --git a/examples.tex b/examples.tex new file mode 100644 index 0000000..ca792a6 --- /dev/null +++ b/examples.tex @@ -0,0 +1,33 @@ +\documentclass[a4paper]{article} +\usepackage[utf8]{inputenc} +\usepackage{mahjong-hand} +\usepackage[margin=1in]{geometry} +\usepackage{adjustbox} +\usepackage{setspace} +\setlength{\parindent}{0pt} +\begin{document} +\onehalfspacing +\section*{All tiles} + \DrawHand{m0123456789}{2em}\\ + \DrawHand{m0*1*2*3*4*5*6*7*8*9*}{2em}\\ + \DrawHand{p0123456789}{2em}\\ + \DrawHand{p0*1*2*3*4*5*6*7*8*9*}{2em}\\ + \DrawHand{s0123456789}{2em}\\ + \DrawHand{s0*1*2*3*4*5*6*7*8*9*}{2em}\\ + \DrawHand{z1234567~?}{2em}\\ + \DrawHand{z1*2*3*4*5*6*7*~?*}{2em}\\ +\section*{Other examples} + Inline pinfu: + \DrawHand{p123345567s4478~9}{1.5em} + + Big pinfu: + \begin{center} + \DrawHand{p123345567s4478~9}{3em} + \end{center} + + We can wrap \texttt{\textbackslash DrawCommand} with \texttt{adjustbox} (from package \texttt{adjustbox}) to push inline hand's baseline a bit lower: + + Like this: \adjustbox{margin*=0ex -0.5ex 0ex 0ex}{\DrawHand{p123345567s4478~9}{1.5em}} + + Or like this: \adjustbox{margin*=0ex -1ex 0ex 0ex}{\DrawHand{p123345567s4478~9}{1.5em}} +\end{document}