Server : Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.6
System : Windows NT USER-PC 6.1 build 7601 (Windows 7 Professional Edition Service Pack 1) AMD64
User : User ( 0)
PHP Version : 7.4.6
Disable Function : NONE
Directory :  C:/xampp/php/pear/Text/Wiki/Render/Latex/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : C:/xampp/php/pear/Text/Wiki/Render/Latex/List.php
<?php


class Text_Wiki_Render_Latex_List extends Text_Wiki_Render {
    /**
     *
     * Renders a token into text matching the requested format.
     *
     * This rendering method is syntactically and semantically compliant
     * with XHTML 1.1 in that sub-lists are part of the previous list item.
     *
     * @access public
     *
     * @param array $options The "options" portion of the token (second
     * element).
     *
     * @return string The text rendered from the token options.
     *
     */

    function token($options)
    {
        // make nice variables (type, level, count)
        extract($options);

        switch ($type)
            {
            case 'bullet_list_start':
                return "\\begin{itemize}\n";

            case 'bullet_list_end':
                return "\\end{itemize}\n";

            case 'number_list_start':
                $depth = 'enumi' . str_pad('', $level, 'i');
                $enum = '\arabic';
                if (isset($format)) {
                    switch ($format) {
                        case 'a':
                            $enum = '\alph';
                            break;
                        case 'A':
                            $enum = '\Alph';
                            break;
                        case 'i':
                            $enum = '\roman';
                            break;
                        case 'I':
                            $enum = '\Roman';
                            break;
                    }
                }
                return '\renewcommand{\labelenumi}{' . $enum . '{' . $depth .
                             "}}\n\\begin{enumerate}\n";

            case 'number_list_end':
                return "\\end{enumerate}\n";

            case 'bullet_item_start':
            case 'number_item_start':
                return '\item{';

            case 'bullet_item_end':
            case 'number_item_end':
                return "}\n";

            default:
                // ignore item endings and all other types.
                // item endings are taken care of by the other types
                // depending on their place in the list.
                return '';
                break;
            }
    }
}
?>