A cli tool for creating custom printable flash cards. Math flash comes with a host features such changing the number of flash cards printed on a single page, changing page sizes, previewing flash cards in realtime and more. 🙃
Installing math-flash is as simple as copying and pasting this to your terminal. Assuming you have node installed on your system.
npm install -g math-flashAlternatively, you can install the package from source as follows:
git clone https://github.com/sihlecodes/math-flash
cd math-flash
npm install
npm install -g .To get started; create a new folder. Then using the following command you can generate a new flash card file with an example of the definition format.
math-flash -g chapter01.yaml
Using the following command you can start a live preview session. This will open http://localhost:3000 in your browser and allows you to view what your flash cards will look like whenever you make changes to chapter01.yaml (or whatever you called your flash card .yaml file).
math-flash --view chapter01.yaml
Finally you can export your flash cards to PDF format, ready for printing. This will create a folder called ./output/ which has a number of files / folders namely chapter01.pdf and chapter01.html (along with ./shared/) which is used to generate chapter01.pdf.
math-flash chapter01.yaml
When printing ensure that you print with the option: "Flip on long side"
Note: no matter what options you use, you must specify ${FLASH_CARD_FILE} which is just a YAML file containing flash card definitions.
Note: Cannot be used in combination with each other.
--html-onlydon't generate pdf.--pdf-onlydon't save html files used for pdf generation.-g,--generatecreate a new flash card file using the default template.
-f,--format(defaults toA4) pdf output format. (note: ignored if --html-only is used along with this option.)`-l,--landscapeexport pdf in landscape.-m,--margins(defaults to5mm) specify margins in a similar fashion to css margins but dimensions should be comma separated. (i.e.10px,5mmcorresponds to 10px top & bottom margins, 5mm left & right margins). Alternatively you can specify all 4 margins, comma separated of course :D.-c,--columns(defaults to2)-r,--rows(defaults to4)-o,--output-directory(defaults to./output/)-n,--output-name(defaults to${FLASH_CARD_FILE}) name of the resulting pdf and html files--font-size, (defaults to9pt) specified in css units`
-v,--viewlaunch a live preview in the browser-p,--port(defaults to3000)--check-interval, (defaults to100) interval for checking flash file changes (in milliseconds)
A flash card file is simply a .yaml file with the following basic definition properties.
Properties displayed on the front side of the card:
headinga heading displayed on every card.termshould be either a question or simple statement that will be explained further bydescription.aliasshould be an alias ofterm.pageshould be the page number wheretermordescriptioncan be found.
Properties displayed on the back side of the card:
descriptionshould be used to explaintermin detail.lista shorthand for generating an html ordered list. Should be specified in a yaml list format. (i.e. separate lines that start with a hyphen or have the values comma separated inside[]).listStylechanges the numbering style oflist(current styles includedecimal,roman,alpha, andbracketwhich is used in combination with one of the others to add a)instead of.after numbering).footertext that goes right after the contents oflist.
Inside flash card files, you can:
- add multiple flash card definitions in the same file by separating them using
---. - embed html tags inside properties.
- embed katex inside properties using
$(insert katex code)$(for inline katex code that is meant to be inline with other text) and$$(insert katex code)$$(which is fordisplay modekatex which allows you to write larger equations e.g. when writing sums or integrals).
heading: Abstract Algebra
---
term: Characterization of *cyclic groups generated* by an element $a\in G$ in terms of subgroups.
alias: Theorem 3.1
description: |
Let $G$ be a group and $a\in G$. Then the set $$<a>=\{a^k:k\in\Z}$$ is a subgroup of $G$. Futhermore, $<a>$ is the smallest subgroup of $G$ that contains $a$.
page: 53
---
term: Conditions for $H\sub G$ to be a <b>subgroup</b> (3-step).
alias: Proposition 2.9
page: 124
description: |
A subset $H$ of $G$ is a subgroup if and only if it satisfies the following conditions.
listStyle: roman bracket
list:
- The identity $e$ of $G$ is in $H$.
- If $h_1,h_2\in H$, then $h_1h_2\in H$
- If $h \in H$, then $h^{-1}\in H$
footer:
Footer text goes hereLicensed under the MIT License. See LICENSE.