diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/longdivision')
-rw-r--r-- | Master/texmf-dist/doc/latex/longdivision/README | 22 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/longdivision/README.md | 53 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/longdivision/longdivision_example.pdf | bin | 25806 -> 0 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/longdivision/longdivision_example.tex | 40 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/longdivision/longdivision_manual.pdf | bin | 0 -> 135922 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/longdivision/longdivision_manual.tex | 166 |
6 files changed, 219 insertions, 62 deletions
diff --git a/Master/texmf-dist/doc/latex/longdivision/README b/Master/texmf-dist/doc/latex/longdivision/README deleted file mode 100644 index 912b22da786..00000000000 --- a/Master/texmf-dist/doc/latex/longdivision/README +++ /dev/null @@ -1,22 +0,0 @@ -Package: longdivision.sty version 1.0 -Author: Hood Chatham -Email: hood@mit.edu -Date: 2017-02-05 -Files: - longdivision.sty - longdivision_example.tex - longdivision_example.pdf - README - -License: All files have the Latex Project Public License. - - -Does long division. The dividend must be a positive decimal number and the divisor must be a positive integer. Correctly handles repeating decimals, putting a bar over the repeated part of the decimal. Handles dividends up to 20 digits long gracefully (though the typeset result will take up about a page) and dividends between 20 and 60 digits long slightly less gracefully. - -Defines macros \longdivision and \intlongdivision. Each takes two arguments, a dividend and divisor. \longdivision keeps dividing until the remainder is zero, or it encounters a repeated remainder. \longdivision stops when the dividend stops (though the dividend doesn't have to be an integer). - -\longdivision also has an optional argument "max_extra_digits". If max_extra_digits is 0, the behavior is like \intlongdivision, whereas if max_extra_digits is greater than 60, the behavior is the same as \longdivision without the optional argument. In general, \longdivision won't add more than "max_extra_digits" It might be prudent to use this optional argument if you are computing, say, 1/97 which has a 96 digit period (\longdivision will stop anyways to avoid overfull boxes, but the result might not be ideal). - -\intlongdivision behaves similarly to the \longdiv command defined in longdiv.tex, though I think \intlongdivision looks better, and it can handle much larger dividends and divisors (the dividend is only constrained by the size of the page, and the divisor can be up to 8 digits long). - -Please email me if you discover any bugs or have any feature requests.
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/longdivision/README.md b/Master/texmf-dist/doc/latex/longdivision/README.md new file mode 100644 index 00000000000..e459c12ca8f --- /dev/null +++ b/Master/texmf-dist/doc/latex/longdivision/README.md @@ -0,0 +1,53 @@ +longdivision v1.1.0 +======================== +Author: Hood Chatham +Email: hood@mit.edu +Date: 2019-03-24 +Description: +License: All files have the Latex Project Public License. +Files: + longdivision.sty + longdivision_manual.tex + longdivision_manual.pdf + README.md + + +Does the long division algorithm and typesets the results. The dividend must +be a positive decimal number and the divisor must be a positive integer. +Correctly handles repeating decimals, putting a bar over the repeated part of +the decimal. Handles dividends up to 20 digits long gracefully (though the +typeset result will take up about a page) and dividends between 20 and 60 +digits long slightly less gracefully. + +Defines macros \longdivision and \intlongdivision. Each takes two arguments, +a dividend and divisor. \longdivision keeps dividing until the remainder is +zero, or it encounters a repeated remainder. \longdivision stops when the +dividend stops (though the dividend doesn't have to be an integer). + +\intlongdivision behaves similarly to the \longdiv command defined in +longdiv.tex, though I think \intlongdivision looks better, and it can handle +much larger dividends and divisors (the dividend is only constrained by the +size of the page, and the divisor can be up to 8 digits long). + +See the package manual for more information. + +Email me at hood@mit.edu to submit bug reports, request new features, etc. +The current development copy is hosted at https://github.com/hoodmane/longdivision. + + +Changelog: +========== + +## [1.1.0] (2018-10-08) +### Fixed: +- If the "\longdivision" command is in math mode, the numbers are typeset in math mode too (reported by Yu-Tsiang Tai). +- The "\longdivision" command now can handle macros as arguments (as suggested by Mike Jenck). + +### Added: +- Multiple typesetting styles +- Multiple styles for indicating a repeating decimal +- Typesetting partial long division (as suggested by Cameron McLeman). + + +## [1.0.0] (2017-02-05) + diff --git a/Master/texmf-dist/doc/latex/longdivision/longdivision_example.pdf b/Master/texmf-dist/doc/latex/longdivision/longdivision_example.pdf Binary files differdeleted file mode 100644 index 4a86843526f..00000000000 --- a/Master/texmf-dist/doc/latex/longdivision/longdivision_example.pdf +++ /dev/null diff --git a/Master/texmf-dist/doc/latex/longdivision/longdivision_example.tex b/Master/texmf-dist/doc/latex/longdivision/longdivision_example.tex deleted file mode 100644 index ee092c84150..00000000000 --- a/Master/texmf-dist/doc/latex/longdivision/longdivision_example.tex +++ /dev/null @@ -1,40 +0,0 @@ -\documentclass{article} -\usepackage{longdivision} - -\begin{document} - -\longdivision{72344}{7} -% -\qquad\qquad\qquad -% -\longdivision[2]{72344}{7} -% -\qquad\qquad\qquad -% -\intlongdivision{72344}{7} - -\vskip 50pt - -\longdivision{.1}{7} \qquad\qquad\qquad \longdivision{000.1}{7} -% -\qquad\qquad\qquad -% -\intlongdivision{1}{7} % Warning : no_division_occurred - - -\longdivision[20]{1}{49} - -\longdivision{1}{49} % Warning : work_stopped_early - -\longdivision[20]{1}{97} - -\longdivision{1}{97} % Warning : work_stopped_early & division_stopped_early - -\longdivision{ 2 147 483.647 }{ 91 474 837 } % Warning : work_stopped_early & division_stopped_early - -% \longdivision{1..5}{7} % Error: dividend_invalid -% \longdivision{2147483.647}{214748367} % Error : divisor_too_large -% \longdivision{6}{1.5} % Error: divisor_not_int -% \longdivision{6}{15a} % Error: divisor_invalid - -\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/longdivision/longdivision_manual.pdf b/Master/texmf-dist/doc/latex/longdivision/longdivision_manual.pdf Binary files differnew file mode 100644 index 00000000000..64a9bee6c52 --- /dev/null +++ b/Master/texmf-dist/doc/latex/longdivision/longdivision_manual.pdf diff --git a/Master/texmf-dist/doc/latex/longdivision/longdivision_manual.tex b/Master/texmf-dist/doc/latex/longdivision/longdivision_manual.tex new file mode 100644 index 00000000000..c4f23a9fbc9 --- /dev/null +++ b/Master/texmf-dist/doc/latex/longdivision/longdivision_manual.tex @@ -0,0 +1,166 @@ +\documentclass{ltxdoc} +\def\version{Version 1.1.0} + +\usepackage[a4paper,left=2.25cm,right=2.25cm,top=2.5cm,bottom=2.5cm,nohead]{geometry} +\usepackage{longdivision} +\usepackage{tikz} +\usepackage[documentation]{tcolorbox} +\usepackage{etoolbox} +\usepackage{amssymb} +\usepackage[notmath]{sansmathfonts} + +\usepackage{hyperref} +\usepackage{hyperxmp} +\hypersetup{% + colorlinks=true, + linkcolor=blue, + filecolor=blue, + urlcolor=thered, + citecolor=blue, + pdfborder=0 0 0, +} + +\makeatletter % !!!! +\input{pgfmanual.code} % This must be exectuted when catcode of @ is letter +\makeatother % !!!! + +\include{pgfmanual-en-macros} % This must be executed when catcode of @ is other +\makeatletter + +\MakeShortVerb{\|} + +%\let\pgfmanual@verb@collect@code\pgfmanual@verb@collect +\patchcmd\pgfmanual@verb@collect{\pgfmanualprettyprintpgfkeys}{\pgfmanualprettyprintcode}{}{\error} +%\let\pgfmanual@verb@code\pgfmanual@verb + + +\patchcmd\extractkey{\hfill(\extrakeytext no value)}{}{}{\error} +\patchcmd\extractkey{\def\mykey}{\gdef\mykey}{}{\error} +\patchcmd\extractkeyequal{\hfill(\extrakeytext no default)}{}{}{\error} +\patchcmd\extractkeyequal{\def\mykey}{\gdef\mykey}{}{\error} +\patchcmd\extractinitial{no default, }{}{}{\error} +\patchcmd\extractinitial{\def\mykey}{\gdef\mykey}{}{\error} +\patchcmd\extractdefault{\def\mykey}{\gdef\mykey}{}{\error} +\patchcmd\extractdefault{#2}{{\hskip2pt}#2}{}{\error} +\patchcmd\extractequalinitial{\def\mykey}{\gdef\mykey}{}{\error} +\let\extractkey@\extractkey +\apptocmd\extractkey@{\egroup}{}{\error} +\def\extractkey{\bgroup\@ifnextchar*{\def\decompose####1\nil{}\relax\extractkey@\@gobble}{\extractkey@}} + +% Redefine decompose not to do all that fancy crap -- just print as is. Maybe we should get rid of surrounding spaces here and where we do the ref? +\def\decompose#1/\nil{% + %\index{#1@\protect\texttt{#1} key}% + %\index{\mypath#1@\protect\texttt{#1}}% + %\pgfmanualpdflabel{#1}{}% +} + +\hypersetup{ + pdftitle={The Long Division Package}, + pdfauthor={Hood Chatham}, + pdfsubject={A package for typesetting long division}, + pdfkeywords={long division,math,teaching}, + pdflicenseurl={http://www.latex-project.org/lppl/} +} + +\def\today{\the\year/\the\month/\the\day} + +\def\@maketitle{% + \null\vskip 2em + \begin{center}\let\footnote\thanks\sffamily + {\huge \@title\par}\vskip 1.5em + {\large \parbox{.33\textwidth}{\centering\@author}% + \parbox{.33\textwidth}{\centering\@date}}% + \vskip2.5em\rule{\textwidth}{.4pt}% + \end{center}\par\vskip1.5em} +\def\abstractname{} +\def\mailtoHC{\href % some PDF viewers don't like spaces: + {mailto:<hood@mit.edu>\%20Hood\%20Chatham?subject=[spectralsequences\%20package]} + {\texttt{hood@mit.edu}}} +\makeatother + +\tcbset{ + texexp/.style={ + skin = enhanced, + colframe=red!50!yellow!50!black, + colback=red!50!yellow!5!white, + coltitle=red!50!yellow!3!white, + segmentation style = solid, + fonttitle=\small\sffamily\bfseries, + fontupper=\small, + fontlower=\small}, + texexp +} +\newtcblisting{texexp}[1]{texexp,#1} +\def\longdivname{\textsc{\textsf{\textmd{longdivision}}}} +\begin{document} +\title{\longdivname} +\author{Hood Chatham\\\mailtoHC} +\date{\version\\\today} + \maketitle + +The \longdivname\ package defines two main commands: |\longdivision| and |\intlongdivision|. The usage for both is |\longdivision[|\meta{options}|]|\marg{dividend}\marg{divisor}. The difference is that |\longdivision| divides until the remainders repeat or the quotient has too many digits to fit the page, whereas |\intlongdivision| does integer division and leaves the remainder. The command |\longdivisionkeys|\marg{options} is also defined to set default options. At most 20 division steps worth of work will be displayed and at most 60 digits worth of division output will be produced. Thanks to Mike Jenck, Cameron McLeman, and Yu-Tsung Tai for emailing me with bug reports and feature requests. + +Here is an example usage: + +\begin{tcblisting}{sidebyside} +\longdivision{100}{22} +\quad +\intlongdivision{100}{22} +\end{tcblisting} + +These commands have several key-value options: + +\begin{key}{max extra digits = \meta{nonnegative integer}} +This key determines the maximum amount of ``extra'' zeroes to add to the end of the dividend in the process of division -- if the quotient has more digits before it repeats, the division will just stop. This is only an option for |\longdivision|, the command |\intlongdivision|\marg{dividend}\marg{divisor} is equivalent to |\longdivision[max extra digits=0]|\marg{dividend}\marg{divisor}. For brevity, this option has the short form where just the value is provided: |\longdivision[2]|\marg{dividend}\marg{divisor} is the same as |\longdivision[max extra digits=2]|\marg{dividend}\marg{divisor}. + +\begin{tcblisting}{} +\longdivision[max extra digits = 2]{10.0}{7} \quad +\longdivision[1]{10.0}{7} +\end{tcblisting} +\end{key} + + +\begin{key}{stage = \meta{nonnegative integer}} +This controls how many steps worth of division to do. Thanks to Cam McLeman for suggesting this feature. +\begin{tcblisting}{} +\longdivision[stage=0]{1}{7} \quad +\longdivision[stage=1]{1}{7} \quad +\longdivision[stage=2]{1}{7} \quad +\longdivision[stage=3]{1}{7} \quad +\longdivision[stage=4]{1}{7} \quad +\longdivision[stage=5]{1}{7} \quad +\longdivision[stage=6]{1}{7} +\end{tcblisting} +\end{key} + +\begin{key}{style = \meta{style}} +Control the style for typesetting the result of long division. The options are |default|, |standard|, |tikz|, or |german|. The option |default| is the same as |tikz| if \tikzname\ is loaded and otherwise is the same as |standard|. You probably should load \tikzname\ because the \tikzname\ version looks significantly better. If you use this option, you'll probably want to set the style once and for all in your preamble with |\longdivisionkeys{style=|\meta{style}|}|. +\begin{tcblisting}{} +\intlongdivision[style = tikz ]{100.0}{13} \quad +\intlongdivision[style = standard]{100.0}{13} \quad +\intlongdivision[style = german ]{100.0}{13} +\end{tcblisting} +You can define your own typesetting style by saying |\longdiv_define_style:nn|\marg{style name}\marg{code}. This can use the commands |\longdivdividend| which contains the dividend, |\longdivdivisor| which contains the divisor, |\longdivquotient| which contains the quotient, and |\longdivwork:| which contains the |division work|. For instance, a simplified version of the |german| style is: +\begin{tcblisting}{} +\longdivdefinestyle{my style}{% + \begin{tabular}{@{}l@{}} + \longdivdividend : \, \longdivdivisor \, = \longdivquotient \\ + \longdivwork + \end{tabular} +} +\longdivision[style = my style]{2}{3} +\end{tcblisting} +Send me an email if you cannot figure out how to make a style to your liking. +\end{key} + +\begin{key}{repeating decimal style = \meta{style}} +Control the way that repeating decimals are typeset. The options are |overline|, |dots|, |dots all|, |parentheses|, or |none|. The default is |overline|. The |parentheses| style creates ugly spacing problems and the |dots| style is insufficiently visible, so the |overline| style is the best. If you use this option, you'll probably want to set the style once and for all in your preamble with |\longdivisionkeys{recurring decimal style=|\meta{style}|}| |\longdivisionkeys{style=|\meta{style}|}|. Like the |style| key, this is designed to be extensible. However, the process of creating new |repeating decimal style|s is a bit involved. Send me an email if you want a new |repeating decimal style|. +\begin{tcblisting}{} +\longdivision[repeating decimal style = overline ]{5.3}{37} \quad +\longdivision[repeating decimal style = dots ]{5.3}{37} \quad +\longdivision[repeating decimal style = dots all ]{5.3}{37} \quad +\longdivision[repeating decimal style = parentheses]{5.3}{37} \quad +\longdivision[repeating decimal style = none ]{5.3}{37} +\end{tcblisting} +\end{key} +\end{document} |