How does one construct macros, each taking some arbitrary number of tuples inputs, that output the parameters into a designed paragraph form? Also, exist macros taking again some of the inputs, and then printing the corresponding inputs that were not entered but associated with these in the tuples substructures.
We color and text size organize and rank a descending ordered set of text entries.
\documentclass[12pt]{article}
\usepackage[top=1in,bottom=1in,left=1in,right=1in]{geometry}
\usepackage[usenames,dvipsnames]{color}
\usepackage{amsfonts,graphicx,amsmath}
\def\useful{\normalsize\color{black}}
\def\mixedquality{\footnotesize\color{Green}}
\def\useless{\footnotesize\color{blue}}
\def\nonsense{\footnotesize\color{Gray}}
Also we enumerate text entries tuples. We display the number of each entry on the left in the margin beside the entry. This is flush to the margin and hanging indented, to be easily distinguished from the other entries if there are other entries.
\setlength{\parindent}{27pt}\newcounter{pnkt}\newlength{\dlh}
\newcommand*\pnkt{%
\stepcounter{pnkt}%
\settowidth{\dlh}{\textbf{\textit{\arabic{pnkt}}}}%
\hspace*{\dimexpr-\dlh-18mm}\hangindent=9mm\noindent%
\textbf{\textit{\arabic{pnkt}}}\hspace{7mm}}
We can write for example ...
\pnkt {\useless%
\textbf{AAA1}, \textbf{BBB1}; \textbf{AAA2}, \textbf{BBB2}; \textbf{AAA3}, \textbf{BBB3}. %
\textbf{CCC}. \textit{DDD}. EEE.}
\pnkt {\mixedquality%
\textbf{AAA1}, \textbf{BBB1}; \textbf{AAA2}, \textbf{BBB2}. %
\textbf{CCC}. DDD. \textit{EEE} FFF.}
but we prefer writing this ...
\book{useless}{3}{AAA1}{BBB1}{AAA2}{BBB2}{AAA3}{BBB3}{CCC}{DDD}{EEE}
\essy{mixedquality}{2}{AAA1}{BBB1}{AAA2}{BBB2}{CCC}{DDD}{EEE}{FFF}
and so on: for arbitrary numbers of AAA and BBB parameters. This is difficult because \def and \newcommand are defined only no more than nine parameters.
Any solution to a problem like this can be adapted for any repetitive case, such as write up of a series of experiments or mathematical statements where the number of variables is itself variable but the paragraph is basically unchanged. For example, ``if AAA1 then BBB1 and if AAA2 then BBB2 and ... and if AAAn then BBB2, and in case we also suppose CCC, then we infer DDD, which is same as EEE ...'' This is isomorphic to the references problem.
We enumerated all paragraphs. So later in the text we want to write, for example, This suggestion was proved years later \ranked{3}{AAA1}{AAA2}{AAA3} to display This suggestion was proved years later [the \pnkt number of the reference corresponding to \book{rank}{3}{AAA1 ... BBB3}{CCC}{DDD}{EEE}].
We then want to write for example
... \extracted{3}{AAA1}{AAA2}{AAA3}to display... (AAA1, AAA2, AAA3 CCC)or... (AAA1, AAA2, AAA3, useful)or... (AAA1, AAA2, AAA3, DDD), all depending on how we define\rank.
EDIT 1: Bounty for this question. EDIT 2: Question is rewritten for easy printing.
\citeand\refbefore, and for many other stuff to, mostly using some variant offoreach. So depending on what you need it for, very likely you'll be re-discovering America. – yo' Jun 06 '14 at 12:31biblatexdefines a number of such cases but there arebibtexsolutions, too. – cfr Jun 06 '14 at 21:42\def\foo#1#2!#3#4#5{...}and inside that the argument which holds all the{AAA1}{BBB1}…{AAAn}{BBBn}is#2, then make some sort of “mapping” (in LaTeX3 is very easy with something like\tl_map_inline:Nnbut with two arguments) which takes two arguments each time. – Manuel Jun 08 '14 at 15:28\foo{rank}{aaa1,bbb1,aaa2,bbb2,…,aaan,bbbn}{ccc}{ddd}{eee}. Would it be acceptable? – Manuel Jun 08 '14 at 16:02