diff options
author | Holden Rohrer <hdawg7797@yahoo.com> | 2019-08-02 11:57:17 -0400 |
---|---|---|
committer | Holden Rohrer <hdawg7797@yahoo.com> | 2019-08-02 11:57:17 -0400 |
commit | 6253f5563c1688c8cd6cb09a6669796e983bc869 (patch) | |
tree | e5a9d502ef0dfa9751d709d31dda391f3b413400 /citations.tex | |
parent | aad153f208ccc6261b32569b29ffedd404491064 (diff) |
working alphabetization
Diffstat (limited to 'citations.tex')
-rw-r--r-- | citations.tex | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/citations.tex b/citations.tex index 12ea915..11428ad 100644 --- a/citations.tex +++ b/citations.tex @@ -1,8 +1,8 @@ \long\edef\citations{} \long\def\newcitation#1#2{% - \long\edef\citations{{#2}%allows alphabetization by including sanitized relevant data - \hangafter=-1 \hangindent=0.5in%hanging indents must be inserted every paragraph - \citations\par #1}% + \long\edef\citations{\citations{#2}%allows alphabetization by including sanitized relevant data + \hangafter=-1 \hangindent=0.5in\relax%hanging indents must be inserted every paragraph + #1\par}% } \def\cite#1{%the actual citation request made by users \def\cltitle{}\def\clcontain{}%"clean" data intended for alphabetization in bibliography @@ -12,12 +12,12 @@ \def\@last{}\def\@namedisp{}\def\name##1##2{\def\@last{##1}\def\@namedisp{\ifx\@title\empty ##2.\fi}}%takes a last name and how names ought display, allowing multiple authors \def\@title{}\def\title##1{\def\@title{``##1.''}\def\cltitle{##1}}%individual source like chapter or webpage \def\@contain{}\def\contain##1{\def\@contain{ {\twelveit ##1}\ifx\@title\empty .\else, by \@namedisp \comma \fi}\def\clcontain{##1}}%container (book contains chapter) - \def\@contrib{}\def\contrib##1{\def\@contrib{ ##1\comma}}%other contributors with roles - \def\@version{}\def\version##1{\def\@version{ ##1\comma}}%version, if notable or unique - \def\@relnums{}\def\relnums##1{\def\@relnums{ ##1\comma}}%relevant numbers like journal issue or volume number - \def\@publish{}\def\publish##1{\def\@publish{ ##1\comma}}%publisher - \def\@pubdate{}\def\pubdate##1{\def\@pubdate{ ##1\comma}}%publication date - \def\@locator{}\def\locator##1{\def\@locator{ ##1}}%page numbers or web address + \def\@contrib{}\def\contrib##1{\def\@contrib{\ ##1\comma}}%other contributors with roles + \def\@version{}\def\version##1{\def\@version{\ ##1\comma}}%version, if notable or unique + \def\@relnums{}\def\relnums##1{\def\@relnums{\ ##1\comma}}%relevant numbers like journal issue or volume number + \def\@publish{}\def\publish##1{\def\@publish{\ ##1\comma}}%publisher + \def\@pubdate{}\def\pubdate##1{\def\@pubdate{\ ##1\comma}}%publication date + \def\@locator{}\def\locator##1{\def\@locator{\ ##1}}%page numbers or web address \def\@pagenum{}\def\pagenum##1{\def\@pagenum{##1}}%page number, as relevant to inline citations \countdef\commas=11\count11=0% #1% @@ -28,7 +28,7 @@ \ifx\@pubdate\empty \else \advance \commas by 1\fi% \ifx\@locator\empty \else \advance \commas by 1\fi% \def\comma{\advance\commas by -1 \noexpand\ifnum\noexpand\commas>0 ,\noexpand\fi}% - \ifnewcite\newcitation{\@namedisp \@title \@contain \@contrib \@version \@relnums \@publish \@pubdate \@locator.}\fi{\@namedisp\cltitle\clcontain}\fi% + \ifnewcite\newcitation{\@namedisp \@title \@contain \@contrib \@version \@relnums \@publish \@pubdate \@locator.}{\@namedisp\cltitle\clcontain}\fi% (\ifnameinline \ifx\@last\empty \@title @@ -41,13 +41,13 @@ \long\def\biblio{ %generates a bibliography \vfil \eject %prints all previous pages and starts bibliography \line{\hfil Works Cited \hfil}% - %%Alphabetization +%%Alphabetization \immediate\openout0=sort.tex% - \immediate\write0{\citations}% - \immediate\closeout0 + \immediate\write0{\unexpanded\expandafter{\citations}}% + \immediate\closeout0% \immediate\write18{python3 sort.py}%sort sort.tex alphabetically by the first group (also remove first group) - \immediate\openin0=sort.tex - \immediate\read0 to \data - \immediate\data - \immediate\closein0 + \immediate\openin0=sort.tex% + \immediate\read0 to \data% + \immediate\data% + \immediate\closein0% } |