ultimate-comparisons/ultimate-comparison-BASE

View on GitHub
src/app/components/output/latex-table/latex-table.component.html

Summary

Maintainability
Test Coverage
<div class="grid-content-latex">
    <pcard heading="Latex Table" class="large-paper-card">
        <div class="card-content" style="overflow: auto;"><!--
@formatter:off
-->%\usepackage&#123;calc&#125;<br/>
%\usepackage&#123;booktabs&#125;<br/>
%\usepackage&#123;url&#125;<br/>
%\usepackage&#123;hyperref&#125;<br/>
%\usepackage&#123;footnote&#125;<br/>
%\usepackage&#123;scrextend&#125;<br/>
%\usepackage&#123;amssymb&#125;<br/>
%\makesavenoteenv&#123;tabular&#125;<br/>
%\makesavenoteenv&#123;tabule&#125;<br/>
\begin&#123;tabular&#125;&#123;&#64;&#123;&#125;<!--
--><ng-template ngFor let-column [ngForOf]="columns">p&#123;\linewidth/{{columns.length}}&#125;<!--
--></ng-template>&#64;&#123;&#125;&#125;<br/>
\toprule<br/>
<!--
--><ng-template ngFor let-column [ngForOf]="columns" let-last="last" let-i="index">{{columns[i]}} <!--
    --><ng-template [ngIf]="!last">&#38; </ng-template><!--
    --><ng-template [ngIf]="last">\\<br/></ng-template><!--
--></ng-template>
\midrule<br/>
<!-- iterate over data rows
--><ng-template ngFor let-item [ngForOf]="items"><!--
    iterate over data columns
    --><ng-template ngFor let-entry [ngForOf]="item" let-last="last" let-i="index"><!--
        print url (only print the text and not the link)
        --><ng-template [ngIf]="types[i] === 'URL' && entry">{{entry.text}}</ng-template><!--

        print labels
        --><ng-template [ngIf]="types[i] === 'LABEL' || types[i] === 'REPOSITORY' && entry"><!--
            iterate over labels
            --><ng-template ngFor let-label [ngForOf]="entry?.labelArray" let-lastItem="last"><!--
                print label
                -->{{label.name}}<!--
                    tooltip
                    --><ng-template [ngIf]="label.tooltip && label.tooltip.latex && label.tooltip.latex.length > 0"><!--
                        print tooltips?
                        --><ng-template [ngIf]="showTableTooltips"><!--
                            print tooltips in footnotes
                            --><footnote *ngIf="tableTooltipsAsFootnotes && label.tooltip.latex && label.tooltip.latex.length > 0" [footnote]="label.tooltip.latex" [(footnotes)]="footnotes"></footnote><!--
                            print tooltips after labels
                            --> (<span *ngIf="!tableTooltipsAsFootnotes" [innerHtml]="label.tooltip.latex | sanitizeHtml"></span>)<!--
                        --></ng-template><!--
                    --></ng-template><!--
                    label separator --><ng-template [ngIf]="!lastItem">, </ng-template><!--
            --></ng-template><!--
        --></ng-template><!--

        print name-url
        --><ng-template [ngIf]="types[i] === 'NAME_URL'">{{entry.text}}</ng-template><!--

        print text
        --><ng-template [ngIf]="types[i] === 'TEXT' && entry">{{entry.content}}</ng-template><!--

        print rating
        --><ng-template [ngIf]="types[i] === 'RATING' && entry?.rating">{{'$' + entry.rating+'\\bigstar$'}}</ng-template><!--

        print markdown
        --><ng-template [ngIf]="types[i] === 'MARKDOWN' && entry?.latex"><!--
            --><span class="ltInline" [innerHtml]="entry?.latex | sanitizeHtml"></span><!--
        --></ng-template><!--
       --><ng-template [ngIf]="!last"> &#38; </ng-template><!--
       --><ng-template [ngIf]="last">\\<br/>
<!--   --></ng-template><!--
    --></ng-template><!--
--></ng-template>\bottomrule<br/><!--

-->
\end&#123;tabular&#125;<br/><!--

footnotes
--><ng-template [ngIf]="tableTooltipsAsFootnotes"><!--
    --><br/>\newcommand\snum&#123;0&#125;<!--
    --><ng-template ngFor let-item [ngForOf]="getFootnotes()" let-i="index"><!--
        --><br/>\footnotetext&#91;\numexpr\snum+{{i}}&#93;&#123;<!--
            --><span class="ltInline" [innerHtml]="item.text|sanitizeHtml"></span><!--
            -->\label{{('{'+item.ref+'}')}}<!--
        -->&#125;<!--
    --></ng-template><!--
--></ng-template>
    <!-- @formatter:on -->
        </div>
    </pcard>
</div>