From c61a1d1756e84066908af422288ae3772e14c0b6 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Mon, 15 Jul 2019 15:26:10 +0200 Subject: split off common elements this makes it easier to add new guides in the same style without needing to repeat the whole preamble. --- Makefile | 16 +++++++ blocking/Makefile | 18 +------- blocking/blocking.tex | 106 +--------------------------------------------- blocking/custom.css | 115 -------------------------------------------------- custom.css | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++ legals.tex | 8 ++++ preamble.tex | 96 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 239 insertions(+), 235 deletions(-) create mode 100644 Makefile delete mode 100644 blocking/custom.css create mode 100644 custom.css create mode 100644 legals.tex create mode 100644 preamble.tex diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ff1e6d3 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +all: pdf html + +pdf: + mkdir -p build + pdflatex -output-directory build $(NAME).tex + pdflatex -output-directory build $(NAME).tex + +html: + mkdir -p html + make4ht -d html $(NAME).tex + make4ht -d html $(NAME).tex + cat ../custom.css >> html/$(NAME).css + rm $(NAME).4ct $(NAME).4tc $(NAME).aux $(NAME).dvi $(NAME).idv $(NAME).lg $(NAME).log $(NAME).tmp $(NAME).xref $(NAME).css $(NAME).html + + +.PHONY: all pdf html diff --git a/blocking/Makefile b/blocking/Makefile index da7326f..c8f94b0 100644 --- a/blocking/Makefile +++ b/blocking/Makefile @@ -1,16 +1,2 @@ -all: pdf html - -pdf: - mkdir -p build - pdflatex -output-directory build blocking.tex - pdflatex -output-directory build blocking.tex - -html: - mkdir -p html - make4ht -d html blocking.tex - make4ht -d html blocking.tex - cat custom.css >> html/blocking.css - rm blocking.4ct blocking.4tc blocking.aux blocking.dvi blocking.idv blocking.lg blocking.log blocking.tmp blocking.xref blocking.css blocking.html - - -.PHONY: all pdf html +NAME=blocking +include ../Makefile diff --git a/blocking/blocking.tex b/blocking/blocking.tex index 6098dd1..6be1e53 100644 --- a/blocking/blocking.tex +++ b/blocking/blocking.tex @@ -1,101 +1,6 @@ \documentclass[a4paper]{article} -\usepackage[top=2cm,bottom=2cm,left=2cm,right=2cm]{geometry} -\usepackage{hyperref} -\usepackage{ccicons} -\usepackage{graphicx} -\usepackage{csquotes} -\usepackage[many]{tcolorbox} -\usepackage{xcolor} - - -\setlength{\parskip}{1em} - -% Macros to differentiate between HTML and PDF output -\makeatletter -\@ifpackageloaded{tex4ht} - {\let\iftexforht\iftrue} - {\let\iftexforht\iffalse} -\@ifpackageloaded{tex4ht} - {\let\iftexforhtTF\@firstoftwo} - {\let\iftexforhtTF\@secondoftwo} -\makeatother - -% Problem with ligatures, so don't load font in HTML output -\iftexforht -\else -\usepackage[urw-garamond]{mathdesign} -\usepackage[T1]{fontenc} -\fi - - -\iftexforht -\newenvironment{infobox}[1][]{ - \HCode{

} - \textbf{#1}: -}{ - \HCode{

} -} -\newenvironment{triviabox}{ - \HCode{

} - \textbf{Trivia}: -}{ - \HCode{

} -} -\else -\newtcolorbox{infobox}[1][]{ - breakable, - title=#1, - colback=white, - colbacktitle=white, - coltitle=black, - fonttitle=\bfseries, - bottomrule=0pt, - toprule=0pt, - leftrule=3pt, - rightrule=3pt, - titlerule=0pt, - arc=0pt, - outer arc=0pt, - colframe=black, -} -\newtcolorbox{triviabox}{ - breakable, - title=Trivia, - colback=white, - colbacktitle=white, - coltitle=black, - fonttitle=\bfseries, - bottomrule=0pt, - toprule=0pt, - leftrule=3pt, - rightrule=3pt, - titlerule=0pt, - arc=0pt, - outer arc=0pt, - colframe=blue, -} -\fi - - -\newcommand{\youtube}[2]{ - \iftexforhtTF{ - \begin{figure} - \HCode{ - - } - \caption{#2} - \end{figure} - }{ - (\includegraphics[height=0.7\baselineskip]{images/yt_logo} \href{https://youtube.com/watch?v=#1}{#2}) - } -} - - -\newcommand{\skill}[3]{\emph{#3} (#1 #2)} -\newcommand{\uskill}[1]{\emph{#1}} -\newcommand{\trait}[1]{\emph{#1}} -\newcommand{\gwtskills}{(Picture source: \url{http://en.gw2skills.net})} +\input{../preamble.tex} % Metadata \title{Triple Trouble Eggblocking Guide} @@ -107,14 +12,7 @@ \maketitle -\iftexforhtTF{}{\ccbysa} -This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit \url{http://creativecommons.org/licenses/by-sa/4.0/}. - -Content obtained from Guild Wars 2, its web sites, manuals and guides, concept art and renderings, press and fansite kits, and other such copyrighted material, may also be used in this document. All rights, title and interest in and to such content remains with ArenaNet or NCsoft, as applicable, and such content is not licensed pursuant to CC-BY-SA. - -\textbf{Warning:} We do not take any warranty or responsibility for failures or wrong information in this document. -As Guild Wars 2 is an actively developed online game, certain game updates can make parts of this document outdated. -Make sure that you have the latest version, especially if you are viewing this in a static format, such as a PDF. +\input{../legals.tex} \begin{abstract} I never thought I'd use \LaTeX to write Triple Trouble Blocking Guides of all things, but here we go. diff --git a/blocking/custom.css b/blocking/custom.css deleted file mode 100644 index db5d227..0000000 --- a/blocking/custom.css +++ /dev/null @@ -1,115 +0,0 @@ -/* see https://github.com/huyng/latex-simple-css */ -body { - /* Serif options */ - /*font-family: "Times New Roman", Times, serif;*/ - /*font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif */ - - /*Sans Serif options */ - /*font-family: "Helvetica", Arial, Freesans, clean, sans-serif;*/ - font-family: "Helvetica Neue", Arial, Freesans, clean, sans-serif; - /*font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;*/ - /*font-family: "Trebuchet MS", Helvetica, sans-serif;*/ - /*font-family: Verdana, Geneva, sans-serif;*/ - /*font-family: Tahoma, Geneva, sans-serif;*/ - /*font-family: Baskerville, 'Times New Roman', Times, serif;*/ - - - padding:1em; - font-size: 14px; - font-weight:300; - line-height: 20px; - margin:10em; - max-width:42em; - background:#fefefe; - color:#333; -} - -h1, h2, h3, h4, h5, h6 { - font-weight: bold; - margin: 2em 0px 15px 0px; -} - -h1 { - color: #000; - font-size: 2em; -} - -h2 { - font-size: 2em; -} - -h3 { - font-size: 1.6em; -} - -h4 { - font-size: 1.3em; -} - -h5 { - font-size: 1em; -} - -h6 { - color: #777777; - background-color: inherit; - font-size: 1em; -} - -hr { - height: 0.2em; - border: 0; - color: #CCCCCC; - background-color: #CCCCCC; -} - -p, blockquote, ul, ol, dl, li, table, pre { - margin: 15px 0; -} - -code, pre { - border-radius: 3px; - background-color: #F8F8F8; - color: inherit; -} - -code { - border: 1px solid #EAEAEA; - margin: 0 2px; - padding: 0 5px; -} - -pre { - border: 1px solid #CCCCCC; - line-height: 1.25em; - overflow: auto; - padding: 6px 10px; -} - -pre > code { - border: 0; - margin: 0; - padding: 0; -} - -a, a:visited { - color: #4183C4; - background-color: inherit; - text-decoration: none; -} - -img { - max-width: 100%; -} - -/* end custom css */ - -div.infobox { - border-left: 5px solid green; - border-right: 5px solid green; -} - -div.triviabox { - border-left: 5px solid blue; - border-right: 5px solid blue; -} diff --git a/custom.css b/custom.css new file mode 100644 index 0000000..db5d227 --- /dev/null +++ b/custom.css @@ -0,0 +1,115 @@ +/* see https://github.com/huyng/latex-simple-css */ +body { + /* Serif options */ + /*font-family: "Times New Roman", Times, serif;*/ + /*font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif */ + + /*Sans Serif options */ + /*font-family: "Helvetica", Arial, Freesans, clean, sans-serif;*/ + font-family: "Helvetica Neue", Arial, Freesans, clean, sans-serif; + /*font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;*/ + /*font-family: "Trebuchet MS", Helvetica, sans-serif;*/ + /*font-family: Verdana, Geneva, sans-serif;*/ + /*font-family: Tahoma, Geneva, sans-serif;*/ + /*font-family: Baskerville, 'Times New Roman', Times, serif;*/ + + + padding:1em; + font-size: 14px; + font-weight:300; + line-height: 20px; + margin:10em; + max-width:42em; + background:#fefefe; + color:#333; +} + +h1, h2, h3, h4, h5, h6 { + font-weight: bold; + margin: 2em 0px 15px 0px; +} + +h1 { + color: #000; + font-size: 2em; +} + +h2 { + font-size: 2em; +} + +h3 { + font-size: 1.6em; +} + +h4 { + font-size: 1.3em; +} + +h5 { + font-size: 1em; +} + +h6 { + color: #777777; + background-color: inherit; + font-size: 1em; +} + +hr { + height: 0.2em; + border: 0; + color: #CCCCCC; + background-color: #CCCCCC; +} + +p, blockquote, ul, ol, dl, li, table, pre { + margin: 15px 0; +} + +code, pre { + border-radius: 3px; + background-color: #F8F8F8; + color: inherit; +} + +code { + border: 1px solid #EAEAEA; + margin: 0 2px; + padding: 0 5px; +} + +pre { + border: 1px solid #CCCCCC; + line-height: 1.25em; + overflow: auto; + padding: 6px 10px; +} + +pre > code { + border: 0; + margin: 0; + padding: 0; +} + +a, a:visited { + color: #4183C4; + background-color: inherit; + text-decoration: none; +} + +img { + max-width: 100%; +} + +/* end custom css */ + +div.infobox { + border-left: 5px solid green; + border-right: 5px solid green; +} + +div.triviabox { + border-left: 5px solid blue; + border-right: 5px solid blue; +} diff --git a/legals.tex b/legals.tex new file mode 100644 index 0000000..8b06391 --- /dev/null +++ b/legals.tex @@ -0,0 +1,8 @@ +\iftexforhtTF{}{\ccbysa} +This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit \url{http://creativecommons.org/licenses/by-sa/4.0/}. + +Content obtained from Guild Wars 2, its web sites, manuals and guides, concept art and renderings, press and fansite kits, and other such copyrighted material, may also be used in this document. All rights, title and interest in and to such content remains with ArenaNet or NCsoft, as applicable, and such content is not licensed pursuant to CC-BY-SA. + +\textbf{Warning:} We do not take any warranty or responsibility for failures or wrong information in this document. +As Guild Wars 2 is an actively developed online game, certain game updates can make parts of this document outdated. +Make sure that you have the latest version, especially if you are viewing this in a static format, such as a PDF. diff --git a/preamble.tex b/preamble.tex new file mode 100644 index 0000000..a51a5ae --- /dev/null +++ b/preamble.tex @@ -0,0 +1,96 @@ +\usepackage[top=2cm,bottom=2cm,left=2cm,right=2cm]{geometry} +\usepackage{hyperref} +\usepackage{ccicons} +\usepackage{graphicx} +\usepackage{csquotes} +\usepackage[many]{tcolorbox} +\usepackage{xcolor} + + +\setlength{\parskip}{1em} + +% Macros to differentiate between HTML and PDF output +\makeatletter +\@ifpackageloaded{tex4ht} + {\let\iftexforht\iftrue} + {\let\iftexforht\iffalse} +\@ifpackageloaded{tex4ht} + {\let\iftexforhtTF\@firstoftwo} + {\let\iftexforhtTF\@secondoftwo} +\makeatother + +% Problem with ligatures, so don't load font in HTML output +\iftexforht +\else +\usepackage[urw-garamond]{mathdesign} +\usepackage[T1]{fontenc} +\fi + + +\iftexforht +\newenvironment{infobox}[1][]{ + \HCode{

} + \textbf{#1}: +}{ + \HCode{

} +} +\newenvironment{triviabox}{ + \HCode{

} + \textbf{Trivia}: +}{ + \HCode{

} +} +\else +\newtcolorbox{infobox}[1][]{ + breakable, + title=#1, + colback=white, + colbacktitle=white, + coltitle=black, + fonttitle=\bfseries, + bottomrule=0pt, + toprule=0pt, + leftrule=3pt, + rightrule=3pt, + titlerule=0pt, + arc=0pt, + outer arc=0pt, + colframe=black, +} +\newtcolorbox{triviabox}{ + breakable, + title=Trivia, + colback=white, + colbacktitle=white, + coltitle=black, + fonttitle=\bfseries, + bottomrule=0pt, + toprule=0pt, + leftrule=3pt, + rightrule=3pt, + titlerule=0pt, + arc=0pt, + outer arc=0pt, + colframe=blue, +} +\fi + + +\newcommand{\youtube}[2]{ + \iftexforhtTF{ + \begin{figure} + \HCode{ + + } + \caption{#2} + \end{figure} + }{ + (\includegraphics[height=0.7\baselineskip]{images/yt_logo} \href{https://youtube.com/watch?v=#1}{#2}) + } +} + + +\newcommand{\skill}[3]{\emph{#3} (#1 #2)} +\newcommand{\uskill}[1]{\emph{#1}} +\newcommand{\trait}[1]{\emph{#1}} +\newcommand{\gwtskills}{(Picture source: \url{http://en.gw2skills.net})} -- cgit v1.2.3