From d2178bb690a6a0339aacba2618bcc1fd378a28b1 Mon Sep 17 00:00:00 2001 From: HaoZeke Date: Fri, 6 Apr 2018 03:28:06 +0530 Subject: [PATCH 01/11] make: Use standard makefile naming convention This is imperitive for usage with mmake. --- makefile => Makefile | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename makefile => Makefile (100%) diff --git a/makefile b/Makefile similarity index 100% rename from makefile rename to Makefile From af7d00eb30ec9f1f01eefd42308e5a27b77bd05c Mon Sep 17 00:00:00 2001 From: HaoZeke Date: Fri, 6 Apr 2018 03:30:14 +0530 Subject: [PATCH 02/11] template: Modify author to accept multiple lines This is especially useful for students who often need to add their roll number and other minor details. --- template.tex | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/template.tex b/template.tex index b25e9ac..d069aaf 100644 --- a/template.tex +++ b/template.tex @@ -117,6 +117,7 @@ $body$ \begin{FlushRight} + \IfFileExists{signature.pdf} { \includegraphics[height=5.5\baselineskip]{signature.pdf} \par @@ -124,7 +125,11 @@ { \vspace{5.5\baselineskip} } - $author$ + + $for(author)$ + $author$\\ + $endfor$ + \end{FlushRight} \end{document} From 69e89d5a9f1d6b14fc62a904e081021d2a5cbfdd Mon Sep 17 00:00:00 2001 From: HaoZeke Date: Fri, 6 Apr 2018 03:36:57 +0530 Subject: [PATCH 03/11] sample: Add a service number to author format --- letter.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/letter.md b/letter.md index cc53625..a0a5ea3 100644 --- a/letter.md +++ b/letter.md @@ -1,6 +1,8 @@ --- # subject: My life as a soldier -author: F. Nietzsche +author: +- F. Nietzsche +- RA16 989 587 city: Naumburg from: - Artillerieregiment, 8. Batt. From 5601bdff34845ceb7cdec590138b00ffa6dfd50e Mon Sep 17 00:00:00 2001 From: HaoZeke Date: Fri, 6 Apr 2018 03:41:38 +0530 Subject: [PATCH 04/11] template+sample+readme: Rework signature logic Allows arbitary filenames This is useful as it also allows pandoc syntax images to be in the text. --- README.md | 4 ++-- letter.md | 1 + template.tex | 18 +++++++++--------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 9b07f43..fdd050a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Why settle for MS Word when you can get the job done using your text editor? ## Dependencies -1. LaTeX with the following extra packages: `fontspec` `geometry` `ragged2e` `enumitem` `xunicode` `xltxtra` `hyperref` `polyglossia` `footmisc` (also, `datetime2` plus its language modules if you want to use a custom date, see below in the settings section) +1. LaTeX with the following extra packages: `fontspec` `geometry` `ragged2e` `enumitem` `xunicode` `xltxtra` `hyperref` `polyglossia` `footmisc` `graphicx` (also, `datetime2` plus its language modules if you want to use a custom date, see below in the settings section) 2. [Pandoc](http://pandoc.org/), the universal document converter. To install LaTeX on Mac OS X, I recommend getting the smaller version BasicTeX from [here](https://tug.org/mactex/morepackages.html) and installing the additional packages with `tlmgr` afterwards. Same goes for Linux: install `texlive-base` with your package manager and add the needed additional packages later. @@ -21,7 +21,7 @@ To install pandoc on Mac OS X, run `brew install pandoc`. To install it on Linux 2. Write your letter in markdown below. 3. Run `make` to compile the PDF. -If a file named `signature.pdf` is present in the directory, the boilerplate will automatically print it after the letter's body as a final touch. Follow [this method](http://tex.stackexchange.com/a/32940/82423) to import your own signature. +If the signature option points to a valid file (including the extension) in the directory, the boilerplate will automatically print it after the letter's body as a final touch. Follow [this method](http://tex.stackexchange.com/a/32940/82423) to import your own signature. **Note**: this template needs to be compiled with XeTeX. diff --git a/letter.md b/letter.md index a0a5ea3..39e05f1 100644 --- a/letter.md +++ b/letter.md @@ -20,6 +20,7 @@ monofont: Courier lang: english fontsize: 10pt geometry: a4paper, left=35mm, right=35mm, top=50mm, bottom=25mm +signature: signature.pdf # letterhead: true # customdate: YYYY-MM-DD --- diff --git a/template.tex b/template.tex index d069aaf..2464749 100644 --- a/template.tex +++ b/template.tex @@ -32,6 +32,10 @@ \setmainlanguage{$lang$} $endif$ +% IMAGES +%-------------------------------- +\usepackage{graphicx} + % TYPOGRAPHY %-------------------------------- \usepackage{xunicode} @@ -117,19 +121,15 @@ $body$ \begin{FlushRight} - - \IfFileExists{signature.pdf} - { - \includegraphics[height=5.5\baselineskip]{signature.pdf} \par - } - { - \vspace{5.5\baselineskip} - } + $if(signature)$ + \includegraphics[height=5.5\baselineskip]{$signature$} \par + $else$ + \vspace{5.5\baselineskip} + $endif$ $for(author)$ $author$\\ $endfor$ - \end{FlushRight} \end{document} From e509439eb1a9c054ae653c2b846708f72e994e10 Mon Sep 17 00:00:00 2001 From: HaoZeke Date: Fri, 6 Apr 2018 03:56:54 +0530 Subject: [PATCH 05/11] sample: Use an IETF language tag. --- letter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/letter.md b/letter.md index 39e05f1..5431e5d 100644 --- a/letter.md +++ b/letter.md @@ -17,7 +17,7 @@ to: mainfont: Hoefler Text altfont: Helvetica Neue monofont: Courier -lang: english +lang: en-US fontsize: 10pt geometry: a4paper, left=35mm, right=35mm, top=50mm, bottom=25mm signature: signature.pdf From c33234dc704665170119bb6faa4667e527284e87 Mon Sep 17 00:00:00 2001 From: HaoZeke Date: Fri, 6 Apr 2018 03:59:56 +0530 Subject: [PATCH 06/11] template+sample+readme: Rework letterhead logic Allows alternate filenames Also formalizes the alternate style in the form of an option. --- README.md | 2 +- letter.md | 3 ++- template.tex | 11 +++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fdd050a..9b3b45d 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Although I didn't test it, you can probably use this on Windows, too. Both [Pand ## Custom letterhead -If you have already designed your own letterhead and want to use it with this template, including it should be easy enough. Set the `letterhead` option to `true` to activate the `wallpaper` package in the template. `wallpaper` will look for a file named `letterhead.pdf` in the project root folder and print it on the PDF before compiling the document. Change the fonts to match the ones in your letterhead, adjust the margins with `geometry` and you should be all set. +If you have already designed your own letterhead and want to use it with this template, including it should be easy enough. Set the `letterhead` option to the file name (include .pdf) to activate the `wallpaper` package in the template. `wallpaper` will look for the named file in the project root folder and print it on the PDF before compiling the document. Change the fonts to match the ones in your letterhead, adjust the margins with `geometry` and you should be all set. ## Recommended readings diff --git a/letter.md b/letter.md index 5431e5d..1c6ac71 100644 --- a/letter.md +++ b/letter.md @@ -21,7 +21,8 @@ lang: en-US fontsize: 10pt geometry: a4paper, left=35mm, right=35mm, top=50mm, bottom=25mm signature: signature.pdf -# letterhead: true +# letterhead: letterhead.pdf +# letterheadAlt: letterhead-front.pdf # customdate: YYYY-MM-DD --- diff --git a/template.tex b/template.tex index 2464749..c3b63b4 100644 --- a/template.tex +++ b/template.tex @@ -19,12 +19,19 @@ \usepackage{enumitem} \setlist{nolistsep} +% Include a standard letterhead $if(letterhead)$ \usepackage{wallpaper} -% \ThisULCornerWallPaper{1}{letterhead-front.pdf} % Uncomment to include a different letterhead on the first page -\ULCornerWallPaper{1}{letterhead.pdf} +\ULCornerWallPaper{1}{$letterhead$} $endif$ +% Includes a different letterhead on the first page +$if(letterheadAlt)$ +\usepackage{wallpaper} +\ThisULCornerWallPaper{1}{$letterheadAlt$} +$endif$ + + % LANGUAGE %-------------------------------- $if(lang)$ From d3e93a26a9e39c7791e334c3d1292d6fcd711c44 Mon Sep 17 00:00:00 2001 From: HaoZeke Date: Fri, 6 Apr 2018 04:03:36 +0530 Subject: [PATCH 07/11] proj: Add a markdown license --- LICENSE.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..2e138dc --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,26 @@ +The MIT License (MIT) +===================== + +Copyright © `` `` + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the “Software”), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + From 0b98ad432ec6c95672899f97ef8368e7b509b80d Mon Sep 17 00:00:00 2001 From: HaoZeke Date: Fri, 6 Apr 2018 04:10:09 +0530 Subject: [PATCH 08/11] proj: Add a contributors file --- CONTRIBUTORS.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 CONTRIBUTORS.md diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md new file mode 100644 index 0000000..392a7b2 --- /dev/null +++ b/CONTRIBUTORS.md @@ -0,0 +1,25 @@ +# Contributors +Commits in brackets. Made with git-summary from [git extras](https://github.com/tj/git-extras). + +```bash +# Use this to update +$ git summary + +# Just to check +$ git shortlog -sn >> CONTRIBUTORS.md +``` + +project : letter-boilerplate +repo age : 2 years, 5 months +active : 31 days +commits : 79 +files : 10 +authors : +(47) zool 59.5% +(15) mrzool 19.0% +(08) HaoZeke 10.1% +(04) Mattia Tezzele 5.1% +(02) Fabrice Laporte 2.5% +(01) MT 1.3% +(01) Rafael Epplee 1.3% +(01) Sascha Hagedorn 1.3% From 0189eb9a8f69e0ba5197a3dc015ef80b062804a4 Mon Sep 17 00:00:00 2001 From: HaoZeke Date: Fri, 6 Apr 2018 04:21:23 +0530 Subject: [PATCH 09/11] template+sample+readme: Add a math option --- README.md | 2 +- letter.md | 1 + template.tex | 7 ++++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9b3b45d..d05b6b7 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Why settle for MS Word when you can get the job done using your text editor? ## Dependencies -1. LaTeX with the following extra packages: `fontspec` `geometry` `ragged2e` `enumitem` `xunicode` `xltxtra` `hyperref` `polyglossia` `footmisc` `graphicx` (also, `datetime2` plus its language modules if you want to use a custom date, see below in the settings section) +1. LaTeX with the following extra packages: `fontspec` `geometry` `ragged2e` `enumitem` `xunicode` `xltxtra` `hyperref` `polyglossia` `footmisc` `graphicx` (also, `datetime2` plus its language modules if you want to use a custom date, and `mathtools` if you need equations; see below in the settings section) 2. [Pandoc](http://pandoc.org/), the universal document converter. To install LaTeX on Mac OS X, I recommend getting the smaller version BasicTeX from [here](https://tug.org/mactex/morepackages.html) and installing the additional packages with `tlmgr` afterwards. Same goes for Linux: install `texlive-base` with your package manager and add the needed additional packages later. diff --git a/letter.md b/letter.md index 1c6ac71..a395f1d 100644 --- a/letter.md +++ b/letter.md @@ -21,6 +21,7 @@ lang: en-US fontsize: 10pt geometry: a4paper, left=35mm, right=35mm, top=50mm, bottom=25mm signature: signature.pdf +# math: true # letterhead: letterhead.pdf # letterheadAlt: letterhead-front.pdf # customdate: YYYY-MM-DD diff --git a/template.tex b/template.tex index c3b63b4..711f9f1 100644 --- a/template.tex +++ b/template.tex @@ -31,7 +31,6 @@ \ThisULCornerWallPaper{1}{$letterheadAlt$} $endif$ - % LANGUAGE %-------------------------------- $if(lang)$ @@ -43,6 +42,12 @@ %-------------------------------- \usepackage{graphicx} +% MATH +%-------------------------------- +$if(math)$ +\usepackage{mathtools} +$endif$ + % TYPOGRAPHY %-------------------------------- \usepackage{xunicode} From 84a05ea75313bee31de145c82989c3d98991a099 Mon Sep 17 00:00:00 2001 From: HaoZeke Date: Fri, 6 Apr 2018 04:25:27 +0530 Subject: [PATCH 10/11] readme: Update settings section --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index d05b6b7..3749ca2 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,9 @@ Although I didn't test it, you can probably use this on Windows, too. Both [Pand - **`lang`**: Sets the main language through the `polyglossia` package. This is important for proper hyphenation and date format. - **`geometry`**: A string that sets the margins through `geometry`. Read [this](https://www.sharelatex.com/learn/Page_size_and_margins) to learn how this package works. - **`letterhead`**: include custom letterhead in the PDF (see below). +- **`letterheadAlt`**: include alternative custom letterhead in the PDF (see below). +- **`math`**: include math equations and formatting. Read [this](https://ctan.org/pkg/mathtools?lang=en) for the docs and [this](https://www.sharelatex.com/learn/Mathematical_expressions) for a gentle introduction to TeX math. +- **`signature`**: include a signature (see below). - **`customdate`**: Allows you to specify a custom date in the format YYYY-MM-DD in case you need to pre/postdate your letter. *Caveat*: Requires `datetime2` along with its language module (ex: if `lang` is set to `german` do `tlmgr install datetime2 datetime2-german`) ## Custom letterhead From b5ff536f1d11f4739d5bd4df16bcfd14983af603 Mon Sep 17 00:00:00 2001 From: HaoZeke Date: Fri, 6 Apr 2018 04:26:24 +0530 Subject: [PATCH 11/11] contrib: Minor generic update --- CONTRIBUTORS.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 392a7b2..2154428 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -12,14 +12,15 @@ $ git shortlog -sn >> CONTRIBUTORS.md project : letter-boilerplate repo age : 2 years, 5 months active : 31 days -commits : 79 +commits : 81 files : 10 authors : -(47) zool 59.5% -(15) mrzool 19.0% -(08) HaoZeke 10.1% -(04) Mattia Tezzele 5.1% -(02) Fabrice Laporte 2.5% -(01) MT 1.3% -(01) Rafael Epplee 1.3% -(01) Sascha Hagedorn 1.3% +47 zool 58.0% +15 mrzool 18.5% +10 HaoZeke 12.3% +4 Mattia Tezzele 4.9% +2 Fabrice Laporte 2.5% +1 MT 1.2% +1 Rafael Epplee 1.2% +1 Sascha Hagedorn 1.2% +