{"id":2641,"date":"2025-07-18T14:46:35","date_gmt":"2025-07-18T19:46:35","guid":{"rendered":"https:\/\/biblioteca.utc.edu.ec\/?page_id=2641"},"modified":"2025-09-03T14:54:58","modified_gmt":"2025-09-03T19:54:58","slug":"generador-de-citas","status":"publish","type":"page","link":"https:\/\/biblioteca.utc.edu.ec\/?page_id=2641","title":{"rendered":"Generador de Citas"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"es\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Generador de Citas Bibliogr\u00e1ficas<\/title>\n    <style>\n        * {\n            margin: 0;\n            padding: 0;\n            box-sizing: border-box;\n        }\n\n        body {\n            font-family: Arial, sans-serif;\n            background: linear-gradient(135deg, #f0f6fc 0%, #f0f6fc 100%);\n            min-height: 100vh;\n            padding: 20px;\n        }\n\n        .container {\n            max-width: 1200px;\n            margin: 0 auto;\n        }\n\n        .header {\n            text-align: center;\n            margin-bottom: 30px;\n        }\n\n        .header h1 {\n            font-size: 2.5em;\n            color: #1976d2;\n            margin-bottom: 10px;\n        }\n\n        .header p {\n            font-size: 1.2em;\n            color: #666;\n        }\n\n        .main-content {\n            display: grid;\n            grid-template-columns: 1fr 1fr;\n            gap: 30px;\n        }\n\n        @media (max-width: 768px) {\n            .main-content {\n                grid-template-columns: 1fr;\n            }\n        }\n\n        .card {\n            background: white;\n            border-radius: 10px;\n            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n            padding: 20px;\n            margin-bottom: 20px;\n        }\n\n        .card h2 {\n            color: #1976d2;\n            margin-bottom: 15px;\n            font-size: 1.3em;\n        }\n\n        .form-group {\n            margin-bottom: 15px;\n        }\n\n        .form-group label {\n            display: block;\n            margin-bottom: 5px;\n            font-weight: bold;\n            color: #333;\n        }\n\n        .required {\n            color: #f44336;\n        }\n\n        .form-control {\n            width: 100%;\n            padding: 10px;\n            border: 2px solid #ddd;\n            border-radius: 5px;\n            font-size: 14px;\n        }\n\n        .form-control:focus {\n            border-color: #1976d2;\n            outline: none;\n        }\n\n        .form-control.error {\n            border-color: #f44336;\n        }\n\n        .form-row {\n            display: grid;\n            grid-template-columns: 1fr 1fr;\n            gap: 15px;\n        }\n\n        .form-row-3 {\n            display: grid;\n            grid-template-columns: 1fr 1fr 1fr;\n            gap: 10px;\n        }\n\n        .form-row-4 {\n            display: grid;\n            grid-template-columns: 1fr 1fr 1fr 1fr;\n            gap: 10px;\n        }\n\n        .btn {\n            background: #1976d2;\n            color: white;\n            border: none;\n            padding: 10px 20px;\n            border-radius: 5px;\n            cursor: pointer;\n            font-size: 14px;\n            margin: 5px;\n        }\n\n        .btn:hover {\n            background: #1565c0;\n        }\n\n        .btn:disabled {\n            background: #ccc;\n            cursor: not-allowed;\n        }\n\n        .btn-success {\n            background: #4caf50;\n        }\n\n        .btn-success:hover {\n            background: #45a049;\n        }\n\n        .btn-danger {\n            background: #f44336;\n        }\n\n        .btn-danger:hover {\n            background: #d32f2f;\n        }\n\n        .btn-secondary {\n            background: #757575;\n        }\n\n        .btn-secondary:hover {\n            background: #616161;\n        }\n\n        .btn-copy {\n            background: #ff9800;\n            padding: 5px 10px;\n            font-size: 12px;\n        }\n\n        .btn-copy:hover {\n            background: #f57c00;\n        }\n\n        .btn-sm {\n            padding: 5px 10px;\n            font-size: 12px;\n        }\n\n        .author-section {\n            border: 2px solid #e3f2fd;\n            border-radius: 8px;\n            padding: 15px;\n            margin-bottom: 15px;\n            background: #fafafa;\n        }\n\n        .author-header {\n            display: flex;\n            justify-content: space-between;\n            align-items: center;\n            margin-bottom: 10px;\n        }\n\n        .author-title {\n            font-weight: bold;\n            color: #1976d2;\n        }\n\n        .citation-item {\n            background: #f5f5f5;\n            border: 1px solid #ddd;\n            border-radius: 5px;\n            padding: 15px;\n            margin-bottom: 15px;\n        }\n\n        .citation-header {\n            display: flex;\n            justify-content: space-between;\n            align-items: center;\n            margin-bottom: 10px;\n        }\n\n        .citation-title {\n            font-weight: bold;\n            color: #1976d2;\n        }\n\n        .citation-category {\n            background: #e3f2fd;\n            color: #1976d2;\n            padding: 3px 8px;\n            border-radius: 15px;\n            font-size: 12px;\n        }\n\n        .citation-text {\n            background: white;\n            padding: 10px;\n            border-radius: 5px;\n            border-left: 4px solid #1976d2;\n            font-style: italic;\n            line-height: 1.5;\n        }\n\n        .hidden {\n            display: none;\n        }\n\n        .export-section {\n            background: #e8f5e8;\n            border: 2px solid #4caf50;\n        }\n\n        .export-section h2 {\n            color: #2e7d32;\n        }\n\n        .info-section {\n            background: #fff3e0;\n            border: 2px solid #ff9800;\n        }\n\n        .info-section h2 {\n            color: #f57c00;\n        }\n\n        .info-grid {\n            display: grid;\n            grid-template-columns: 1fr 1fr;\n            gap: 20px;\n            margin-top: 15px;\n        }\n\n        @media (max-width: 600px) {\n            .info-grid {\n                grid-template-columns: 1fr;\n            }\n            .form-row-4 {\n                grid-template-columns: 1fr 1fr;\n            }\n        }\n\n        .info-item h4 {\n            color: #f57c00;\n            margin-bottom: 8px;\n        }\n\n        .info-item ul {\n            list-style-type: none;\n            padding-left: 0;\n        }\n\n        .info-item li {\n            margin-bottom: 5px;\n            color: #666;\n        }\n\n        .toast {\n            position: fixed;\n            top: 20px;\n            right: 20px;\n            background: #4caf50;\n            color: white;\n            padding: 15px 20px;\n            border-radius: 5px;\n            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n            z-index: 1000;\n            transform: translateX(100%);\n            transition: transform 0.3s ease;\n        }\n\n        .toast.show {\n            transform: translateX(0);\n        }\n\n        .toast.error {\n            background: #f44336;\n        }\n\n        .error-message {\n            color: #f44336;\n            font-size: 12px;\n            margin-top: 5px;\n        }\n\n        .add-author-btn {\n            width: 100%;\n            margin-top: 10px;\n            border: 2px dashed #1976d2;\n            background: transparent;\n            color: #1976d2;\n        }\n\n        .add-author-btn:hover {\n            background: #e3f2fd;\n        }\n    <\/style>\n<\/head>\n<body>\n    <div class=\"container\">\n        <div class=\"header\">\n            <h1>Generador de Citas Bibliogr\u00e1ficas<\/h1>\n            <p>Genera citas en m\u00faltiples formatos acad\u00e9micos autom\u00e1ticamente<\/p>\n        <\/div>\n\n        <div class=\"main-content\">\n            <!-- Formulario -->\n            <div>\n                <div class=\"card\">\n                    <h2>\ud83d\udcda Informaci\u00f3n de la Fuente<\/h2>\n                    \n                    <div class=\"form-group\">\n                        <label for=\"type\">Tipo de Fuente<\/label>\n                        <select id=\"type\" class=\"form-control\">\n                            <option value=\"book\">Libro<\/option>\n                            <option value=\"journal\">Art\u00edculo de Revista<\/option>\n                            <option value=\"website\">Sitio Web<\/option>\n                            <option value=\"thesis\">Tesis<\/option>\n                        <\/select>\n                    <\/div>\n\n                    <!-- Secci\u00f3n de Autores -->\n                    <div class=\"form-group\">\n                        <label>\ud83d\udc65 Autores <span class=\"required\">*<\/span><\/label>\n                        <div id=\"authorsContainer\"><\/div>\n                        <button type=\"button\" class=\"btn add-author-btn\" onclick=\"addAuthor()\">\n                            \u2795 Agregar Autor\n                        <\/button>\n                    <\/div>\n\n                    <div class=\"form-group\">\n                        <label for=\"title\">T\u00edtulo <span class=\"required\">*<\/span><\/label>\n                        <input type=\"text\" id=\"title\" class=\"form-control\" placeholder=\"T\u00edtulo de la obra\">\n                        <div id=\"titleError\" class=\"error-message hidden\">El t\u00edtulo es obligatorio<\/div>\n                    <\/div>\n\n                    <div class=\"form-row\">\n                        <div class=\"form-group\">\n                            <label for=\"year\">A\u00f1o <span class=\"required\">*<\/span><\/label>\n                            <input type=\"text\" id=\"year\" class=\"form-control\" placeholder=\"2024\">\n                            <div id=\"yearError\" class=\"error-message hidden\">El a\u00f1o es obligatorio<\/div>\n                        <\/div>\n                        <div class=\"form-group\" id=\"editionGroup\">\n                            <label for=\"edition\">Edici\u00f3n<\/label>\n                            <input type=\"text\" id=\"edition\" class=\"form-control\" placeholder=\"2da ed.\">\n                        <\/div>\n                    <\/div>\n\n                    <!-- Campos para libros -->\n                    <div id=\"bookFields\">\n                        <div class=\"form-row\">\n                            <div class=\"form-group\">\n                                <label for=\"city\">Ciudad<\/label>\n                                <input type=\"text\" id=\"city\" class=\"form-control\" placeholder=\"Latacunga\">\n                            <\/div>\n                            <div class=\"form-group\">\n                                <label for=\"publisher\">Editorial<\/label>\n                                <input type=\"text\" id=\"publisher\" class=\"form-control\" placeholder=\"Editorial Universitaria\">\n                            <\/div>\n                        <\/div>\n                    <\/div>\n\n                    <!-- Campos para art\u00edculos -->\n                    <div id=\"journalFields\" class=\"hidden\">\n                        <div class=\"form-group\">\n                            <label for=\"journal\">Revista<\/label>\n                            <input type=\"text\" id=\"journal\" class=\"form-control\" placeholder=\"Nombre de la revista\">\n                        <\/div>\n                        <div class=\"form-row-3\">\n                            <div class=\"form-group\">\n                                <label for=\"volume\">Volumen<\/label>\n                                <input type=\"text\" id=\"volume\" class=\"form-control\" placeholder=\"15\">\n                            <\/div>\n                            <div class=\"form-group\">\n                                <label for=\"issue\">N\u00famero<\/label>\n                                <input type=\"text\" id=\"issue\" class=\"form-control\" placeholder=\"3\">\n                            <\/div>\n                            <div class=\"form-group\">\n                                <label for=\"pages\">P\u00e1ginas<\/label>\n                                <input type=\"text\" id=\"pages\" class=\"form-control\" placeholder=\"123-145\">\n                            <\/div>\n                        <\/div>\n                    <\/div>\n\n                    <!-- Campos para tesis -->\n                    <div id=\"thesisFields\" class=\"hidden\">\n                        <div class=\"form-group\">\n                            <label for=\"thesisType\">Tipo de Tesis<\/label>\n                            <select id=\"thesisType\" class=\"form-control\">\n                                <option value=\"doctoral\">Tesis Doctoral<\/option>\n                                <option value=\"master\">Tesis de Maestr\u00eda<\/option>\n                                <option value=\"bachelor\">Tesis de Grado<\/option>\n                            <\/select>\n                        <\/div>\n                        <div class=\"form-row\">\n                            <div class=\"form-group\">\n                                <label for=\"university\">Universidad<\/label>\n                                <input type=\"text\" id=\"university\" class=\"form-control\" placeholder=\"Universidad T\u00e9cnica de Cotopaxi\">\n                            <\/div>\n                            <div class=\"form-group\">\n                                <label for=\"department\">Departamento\/Facultad<\/label>\n                                <input type=\"text\" id=\"department\" class=\"form-control\" placeholder=\"Facultad de Ciencias\">\n                            <\/div>\n                        <\/div>\n                    <\/div>\n\n                    <!-- Campos para URL -->\n                    <div id=\"urlGroup\" class=\"form-group hidden\">\n                        <label for=\"url\">URL<\/label>\n                        <input type=\"url\" id=\"url\" class=\"form-control\" placeholder=\"https:\/\/ejemplo.com\">\n                    <\/div>\n\n                    <!-- Campos para fecha de acceso -->\n                    <div id=\"accessDateGroup\" class=\"form-group hidden\">\n                        <label for=\"accessDate\">Fecha de Acceso<\/label>\n                        <input type=\"text\" id=\"accessDate\" class=\"form-control\" placeholder=\"15 de enero de 2024\">\n                    <\/div>\n\n                    <!-- Campo DOI -->\n                    <div id=\"doiGroup\" class=\"form-group hidden\">\n                        <label for=\"doi\">DOI (opcional)<\/label>\n                        <input type=\"text\" id=\"doi\" class=\"form-control\" placeholder=\"10.1000\/182\">\n                    <\/div>\n                <\/div>\n            <\/div>\n\n            <!-- Citas generadas -->\n            <div>\n                <!-- Exportar RIS -->\n                <div class=\"card export-section\">\n                    <h2>\ud83d\udcbe Exportar para Gestores de Referencias<\/h2>\n                    <p>Descarga en formato RIS para importar en Zotero, Mendeley, EndNote, etc.<\/p>\n                    <button id=\"downloadRIS\" class=\"btn btn-success\" style=\"width: 100%; margin-top: 10px;\">\n                        \ud83d\udce5 Descargar archivo RIS\n                    <\/button>\n                    <div style=\"margin-top: 10px; font-size: 12px; color: #666;\">\n                        <strong>Compatible con:<\/strong> Zotero \u2022 Mendeley \u2022 EndNote \u2022 RefWorks \u2022 Papers \u2022 Citavi\n                    <\/div>\n                <\/div>\n\n                <!-- Filtros -->\n                <div class=\"card\">\n                    <h2>\ud83d\udd0d Filtrar Formatos<\/h2>\n                    <div class=\"form-group\">\n                        <label for=\"categoryFilter\">Filtrar por disciplina<\/label>\n                        <select id=\"categoryFilter\" class=\"form-control\">\n                            <option value=\"all\">Todos los formatos<\/option>\n                            <option value=\"General\">Formatos Generales<\/option>\n                            <option value=\"T\u00e9cnico\">Formatos T\u00e9cnicos<\/option>\n                            <option value=\"Regional\">Formatos Regionales<\/option>\n                            <option value=\"Medicina\">Medicina y Salud<\/option>\n                            <option value=\"Sociolog\u00eda\">Sociolog\u00eda<\/option>\n                            <option value=\"Ciencias Pol\u00edticas\">Ciencias Pol\u00edticas<\/option>\n                            <option value=\"Historia\/Literatura\">Historia y Literatura<\/option>\n                            <option value=\"Ciencias\">Ciencias Naturales<\/option>\n                            <option value=\"Antropolog\u00eda\">Antropolog\u00eda<\/option>\n                        <\/select>\n                    <\/div>\n                <\/div>\n\n                <!-- Contenedor de citas -->\n                <div id=\"citationsContainer\"><\/div>\n            <\/div>\n        <\/div>\n\n        <!-- Informaci\u00f3n adicional -->\n        <div class=\"card info-section\">\n            <h2>\u2139\ufe0f Informaci\u00f3n sobre Formatos de Cita<\/h2>\n            <div class=\"info-grid\">\n                <div class=\"info-item\">\n                    <h4>Medicina y Salud:<\/h4>\n                    <ul>\n                        <li>\u2022 AMA &#8211; American Medical Association<\/li>\n                        <li>\u2022 Vancouver &#8211; ICMJE<\/li>\n                    <\/ul>\n                <\/div>\n                <div class=\"info-item\">\n                    <h4>Ciencias Sociales:<\/h4>\n                    <ul>\n                        <li>\u2022 ASA &#8211; Sociolog\u00eda<\/li>\n                        <li>\u2022 APSA &#8211; Ciencias Pol\u00edticas<\/li>\n                        <li>\u2022 AAA &#8211; Antropolog\u00eda<\/li>\n                    <\/ul>\n                <\/div>\n                <div class=\"info-item\">\n                    <h4>Ciencias Exactas:<\/h4>\n                    <ul>\n                        <li>\u2022 IEEE &#8211; Ingenier\u00eda<\/li>\n                        <li>\u2022 CSE &#8211; Ciencias Naturales<\/li>\n                    <\/ul>\n                <\/div>\n                <div class=\"info-item\">\n                    <h4>Humanidades:<\/h4>\n                    <ul>\n                        <li>\u2022 Chicago\/Turabian &#8211; Historia\/Literatura<\/li>\n                        <li>\u2022 MLA &#8211; Literatura moderna<\/li>\n                    <\/ul>\n                <\/div>\n            <\/div>\n            <div style=\"margin-top: 20px;\">\n                <h4>Consejos para Citar Correctamente:<\/h4>\n                <ul style=\"margin-top: 10px;\">\n                    <li>Verifica siempre las normas de estilo de tu instituci\u00f3n<\/li>\n                    <li>Utiliza la informaci\u00f3n m\u00e1s completa y precisa posible<\/li>\n                    <li>Revisa la cita generada para asegurar la exactitud<\/li>\n                    <li>Descarga el archivo RIS para importar autom\u00e1ticamente<\/li>\n                    <li>El primer nombre y apellido son obligatorios para cada autor<\/li>\n                <\/ul>\n            <\/div>\n        <\/div>\n    <\/div>\n\n    <script>\n        \/\/ Estado de la aplicaci\u00f3n\n        let citationData = {\n            type: 'book',\n            authors: [],\n            title: '',\n            year: '',\n            publisher: '',\n            city: '',\n            journal: '',\n            volume: '',\n            issue: '',\n            pages: '',\n            url: '',\n            accessDate: '',\n            doi: '',\n            edition: '',\n            thesisType: 'doctoral',\n            university: '',\n            department: ''\n        };\n\n        let selectedCategory = 'all';\n        let authorCounter = 0;\n\n        \/\/ Definici\u00f3n de formatos expandida\n        const citations = [\n            {\n                format: \"APA 6ta Edici\u00f3n\",\n                category: \"General\",\n                description: \"American Psychological Association (6ta ed.)\",\n                generator: function() {\n                    const authorsStr = formatAuthorsAPA();\n                    const { year, title, publisher, city, journal, volume, issue, pages, url, doi, university, thesisType } = citationData;\n                    if (citationData.type === \"book\") {\n                        return `${authorsStr} (${year}). ${title}. ${city}: ${publisher}.`;\n                    } else if (citationData.type === \"journal\") {\n                        return `${authorsStr} (${year}). ${title}. ${journal}, ${volume}${issue ? `(${issue})` : \"\"}, ${pages}. ${doi ? `doi:${doi}` : \"\"}`;\n                    } else if (citationData.type === \"website\") {\n                        return `${authorsStr} (${year}). ${title}. Recuperado de ${url}`;\n                    } else if (citationData.type === \"thesis\") {\n                        const thesisTypeMap = { doctoral: \"Tesis doctoral\", master: \"Tesis de maestr\u00eda\", bachelor: \"Tesis de Grado\" };\n                        return `${authorsStr} (${year}). ${title} (${thesisTypeMap[thesisType]}). ${university}.`;\n                    }\n                    return \"\";\n                }\n            },\n            {\n                format: \"APA 7ma Edici\u00f3n\",\n                category: \"General\",\n                description: \"American Psychological Association (7ma ed.)\",\n                generator: function() {\n                    const authorsStr = formatAuthorsAPA();\n                    const { year, title, publisher, journal, volume, issue, pages, url, doi, university, thesisType } = citationData;\n                    if (citationData.type === \"book\") {\n                        return `${authorsStr} (${year}). ${title}. ${publisher}.`;\n                    } else if (citationData.type === \"journal\") {\n                        return `${authorsStr} (${year}). ${title}. ${journal}, ${volume}${issue ? `(${issue})` : \"\"}, ${pages}. ${doi ? `https:\/\/doi.org\/${doi}` : url}`;\n                    } else if (citationData.type === \"website\") {\n                        return `${authorsStr} (${year}). ${title}. ${url}`;\n                    } else if (citationData.type === \"thesis\") {\n                        const thesisTypeMap = { doctoral: \"Tesis doctoral\", master: \"Tesis de maestr\u00eda\", bachelor: \"Tesis de Grado\" };\n                        return `${authorsStr} (${year}). ${title} [${thesisTypeMap[thesisType]}]. ${university}.`;\n                    }\n                    return \"\";\n                }\n            },\n            {\n                format: \"Harvard\",\n                category: \"General\",\n                description: \"Sistema Harvard (Reino Unido\/Australia)\",\n                generator: function() {\n                    const authorsStr = formatAuthorsHarvard();\n                    const { title, publisher, city, year, journal, volume, issue, pages, url, university, thesisType } = citationData;\n                    if (citationData.type === \"book\") {\n                        return `${authorsStr} ${year}, ${title}, ${publisher}, ${city}.`;\n                    } else if (citationData.type === \"journal\") {\n                        return `${authorsStr} ${year}, '${title}', ${journal}, vol. ${volume}${issue ? `, no. ${issue}` : \"\"}, pp. ${pages}.`;\n                    } else if (citationData.type === \"website\") {\n                        return `${authorsStr} ${year}, ${title}, viewed ${citationData.accessDate}, <${url}>.`;\n                    } else if (citationData.type === \"thesis\") {\n                        const thesisTypeMap = { doctoral: \"PhD thesis\", master: \"Master's thesis\", bachelor: \"Bachelor's thesis\" };\n                        return `${authorsStr} ${year}, ${title}, ${thesisTypeMap[thesisType]}, ${university}.`;\n                    }\n                    return \"\";\n                }\n            },\n            {\n                format: \"Chicago (Notes-Bibliography)\",\n                category: \"Historia\/Literatura\",\n                description: \"Chicago Manual of Style (17th ed.)\",\n                generator: function() {\n                    const authorsStr = formatAuthorsChicago();\n                    const { title, publisher, city, year, journal, volume, issue, pages, university, thesisType } = citationData;\n                    if (citationData.type === \"book\") {\n                        return `${authorsStr}. ${title}. ${city}: ${publisher}, ${year}.`;\n                    } else if (citationData.type === \"journal\") {\n                        return `${authorsStr}. \"${title}.\" ${journal} ${volume}${issue ? `, no. ${issue}` : \"\"} (${year}): ${pages}.`;\n                    } else if (citationData.type === \"thesis\") {\n                        const thesisTypeMap = { doctoral: \"PhD diss.\", master: \"Master's thesis\", bachelor: \"Bachelor's thesis\" };\n                        return `${authorsStr}. \"${title}\" (${thesisTypeMap[thesisType]}, ${university}, ${year}).`;\n                    }\n                    return \"\";\n                }\n            },\n            {\n                format: \"Turabian\",\n                category: \"Historia\/Literatura\",\n                description: \"Manual for Writers (9th ed.)\",\n                generator: function() {\n                    const authorsStr = formatAuthorsTurabian();\n                    const { title, publisher, city, year, journal, volume, issue, pages, university, thesisType } = citationData;\n                    if (citationData.type === \"book\") {\n                        return `${authorsStr}. ${title}. ${city}: ${publisher}, ${year}.`;\n                    } else if (citationData.type === \"journal\") {\n                        return `${authorsStr}. \"${title}.\" ${journal} ${volume}${issue ? `, no. ${issue}` : \"\"} (${year}): ${pages}.`;\n                    } else if (citationData.type === \"thesis\") {\n                        const thesisTypeMap = { doctoral: \"PhD diss.\", master: \"MA thesis\", bachelor: \"BA thesis\" };\n                        return `${authorsStr}. \"${title}.\" ${thesisTypeMap[thesisType]}, ${university}, ${year}.`;\n                    }\n                    return \"\";\n                }\n            },\n            {\n                format: \"IEEE\",\n                category: \"T\u00e9cnico\",\n                description: \"Institute of Electrical and Electronics Engineers\",\n                generator: function() {\n                    const authorsStr = formatAuthorsIEEE();\n                    const { title, publisher, city, year, journal, volume, issue, pages, url, university, thesisType } = citationData;\n                    if (citationData.type === \"book\") {\n                        return `${authorsStr}, ${title}. ${city}: ${publisher}, ${year}.`;\n                    } else if (citationData.type === \"journal\") {\n                        return `${authorsStr}, \"${title},\" ${journal}, vol. ${volume}${issue ? `, no. ${issue}` : \"\"}, pp. ${pages}, ${year}.`;\n                    } else if (citationData.type === \"website\") {\n                        return `${authorsStr}, \"${title},\" ${year}. [En l\u00ednea]. Disponible: ${url}`;\n                    } else if (citationData.type === \"thesis\") {\n                        const thesisTypeMap = { doctoral: \"Ph.D. dissertation\", master: \"M.S. thesis\", bachelor: \"B.S. thesis\" };\n                        return `${authorsStr}, \"${title},\" ${thesisTypeMap[thesisType]}, ${university}, ${year}.`;\n                    }\n                    return \"\";\n                }\n            },\n            {\n                format: \"Vancouver\",\n                category: \"Medicina\",\n                description: \"International Committee of Medical Journal Editors\",\n                generator: function() {\n                    const authorsStr = formatAuthorsVancouver();\n                    const { title, publisher, city, year, journal, volume, issue, pages, url, university, thesisType } = citationData;\n                    if (citationData.type === \"book\") {\n                        return `${authorsStr}. ${title}. ${city}: ${publisher}; ${year}.`;\n                    } else if (citationData.type === \"journal\") {\n                        return `${authorsStr}. ${title}. ${journal}. ${year};${volume}${issue ? `(${issue})` : \"\"}:${pages}.`;\n                    } else if (citationData.type === \"website\") {\n                        return `${authorsStr}. ${title} [Internet]. ${year} [citado ${citationData.accessDate}]. Disponible en: ${url}`;\n                    } else if (citationData.type === \"thesis\") {\n                        return `${authorsStr}. ${title} [tesis]. ${city}: ${university}; ${year}.`;\n                    }\n                    return \"\";\n                }\n            },\n            {\n                format: \"MLA\",\n                category: \"General\",\n                description: \"Modern Language Association\",\n                generator: function() {\n                    const authorsStr = formatAuthorsMLA();\n                    const { title, publisher, year, journal, volume, issue, pages, url, university, thesisType } = citationData;\n                    if (citationData.type === \"book\") {\n                        return `${authorsStr}. ${title}. ${publisher}, ${year}.`;\n                    } else if (citationData.type === \"journal\") {\n                        return `${authorsStr}. \"${title}.\" ${journal}, vol. ${volume}${issue ? `, no. ${issue}` : \"\"}, ${year}, pp. ${pages}.`;\n                    } else if (citationData.type === \"website\") {\n                        return `${authorsStr}. \"${title}.\" Web. ${citationData.accessDate}. <${url}>.`;\n                    } else if (citationData.type === \"thesis\") {\n                        const thesisTypeMap = { doctoral: \"Dissertation\", master: \"Thesis\", bachelor: \"Thesis\" };\n                        return `${authorsStr}. \"${title}.\" ${thesisTypeMap[thesisType]}, ${university}, ${year}.`;\n                    }\n                    return \"\";\n                }\n            },\n            {\n                format: \"ABNT\",\n                category: \"Regional\",\n                description: \"Associa\u00e7\u00e3o Brasileira de Normas T\u00e9cnicas\",\n                generator: function() {\n                    const authorsStr = formatAuthorsABNT();\n                    const { title, publisher, city, year, journal, volume, issue, pages, url, university, thesisType } = citationData;\n                    if (citationData.type === \"book\") {\n                        return `${authorsStr}. ${title}. ${city}: ${publisher}, ${year}.`;\n                    } else if (citationData.type === \"journal\") {\n                        return `${authorsStr}. ${title}. ${journal}, ${city}, v. ${volume}${issue ? `, n. ${issue}` : \"\"}, p. ${pages}, ${year}.`;\n                    } else if (citationData.type === \"website\") {\n                        return `${authorsStr}. ${title}. Dispon\u00edvel em: <${url}>. Acesso em: ${citationData.accessDate}.`;\n                    } else if (citationData.type === \"thesis\") {\n                        const thesisTypeMap = { doctoral: \"Tese (Doutorado)\", master: \"Disserta\u00e7\u00e3o (Mestrado)\", bachelor: \"Trabalho de Conclus\u00e3o (Gradua\u00e7\u00e3o)\" };\n                        return `${authorsStr}. ${title}. ${year}. ${thesisTypeMap[thesisType]} - ${university}.`;\n                    }\n                    return \"\";\n                }\n            },\n            {\n                format: \"CSE (Name-Year)\",\n                category: \"Ciencias\",\n                description: \"Council of Science Editors\",\n                generator: function() {\n                    const authorsStr = formatAuthorsCSE();\n                    const { title, publisher, city, year, journal, volume, issue, pages, university, thesisType } = citationData;\n                    if (citationData.type === \"book\") {\n                        return `${authorsStr}. ${year}. ${title}. ${city}: ${publisher}.`;\n                    } else if (citationData.type === \"journal\") {\n                        return `${authorsStr}. ${year}. ${title}. ${journal}. ${volume}${issue ? `(${issue})` : \"\"}:${pages}.`;\n                    } else if (citationData.type === \"thesis\") {\n                        const thesisTypeMap = { doctoral: \"dissertation\", master: \"thesis\", bachelor: \"thesis\" };\n                        return `${authorsStr}. ${year}. ${title} [${thesisTypeMap[thesisType]}]. ${university}.`;\n                    }\n                    return \"\";\n                }\n            },\n            {\n                format: \"ASA\",\n                category: \"Sociolog\u00eda\",\n                description: \"American Sociological Association\",\n                generator: function() {\n                    const authorsStr = formatAuthorsASA();\n                    const { title, publisher, city, year, journal, volume, issue, pages, university, thesisType } = citationData;\n                    if (citationData.type === \"book\") {\n                        return `${authorsStr}. ${year}. ${title}. ${city}: ${publisher}.`;\n                    } else if (citationData.type === \"journal\") {\n                        return `${authorsStr}. ${year}. \"${title}.\" ${journal} ${volume}${issue ? `(${issue})` : \"\"}:${pages}.`;\n                    } else if (citationData.type === \"thesis\") {\n                        const thesisTypeMap = { doctoral: \"Ph.D. dissertation\", master: \"Master's thesis\", bachelor: \"Bachelor's thesis\" };\n                        return `${authorsStr}. ${year}. \"${title}.\" ${thesisTypeMap[thesisType]}, Department, ${university}.`;\n                    }\n                    return \"\";\n                }\n            },\n            {\n                format: \"APSA\",\n                category: \"Ciencias Pol\u00edticas\",\n                description: \"American Political Science Association\",\n                generator: function() {\n                    const authorsStr = formatAuthorsAPSA();\n                    const { title, publisher, city, year, journal, volume, issue, pages, university, thesisType } = citationData;\n                    if (citationData.type === \"book\") {\n                        return `${authorsStr}. ${year}. ${title}. ${city}: ${publisher}.`;\n                    } else if (citationData.type === \"journal\") {\n                        return `${authorsStr}. ${year}. \"${title}.\" ${journal} ${volume} (${issue}): ${pages}.`;\n                    } else if (citationData.type === \"thesis\") {\n                        const thesisTypeMap = { doctoral: \"Ph.D. diss.\", master: \"Master's thesis\", bachelor: \"Bachelor's thesis\" };\n                        return `${authorsStr}. ${year}. \"${title}.\" ${thesisTypeMap[thesisType]}, ${university}.`;\n                    }\n                    return \"\";\n                }\n            },\n            {\n                format: \"AAA\",\n                category: \"Antropolog\u00eda\",\n                description: \"American Anthropological Association\",\n                generator: function() {\n                    const authorsStr = formatAuthorsAAA();\n                    const { title, publisher, city, year, journal, volume, issue, pages, university, thesisType } = citationData;\n                    if (citationData.type === \"book\") {\n                        return `${authorsStr} ${year} ${title}. ${city}: ${publisher}.`;\n                    } else if (citationData.type === \"journal\") {\n                        return `${authorsStr} ${year} ${title}. ${journal} ${volume}${issue ? `(${issue})` : \"\"}:${pages}.`;\n                    } else if (citationData.type === \"thesis\") {\n                        const thesisTypeMap = { doctoral: \"Ph.D. dissertation\", master: \"M.A. thesis\", bachelor: \"B.A. thesis\" };\n                        return `${authorsStr} ${year} ${title}. ${thesisTypeMap[thesisType]}, ${university}.`;\n                    }\n                    return \"\";\n                }\n            },\n            {\n                format: \"AMA\",\n                category: \"Medicina\",\n                description: \"American Medical Association\",\n                generator: function() {\n                    const authorsStr = formatAuthorsAMA();\n                    const { title, publisher, city, year, journal, volume, issue, pages, university, thesisType } = citationData;\n                    if (citationData.type === \"book\") {\n                        return `${authorsStr}. ${title}. ${city}: ${publisher}; ${year}.`;\n                    } else if (citationData.type === \"journal\") {\n                        return `${authorsStr}. ${title}. ${journal}. ${year};${volume}${issue ? `(${issue})` : \"\"}:${pages}.`;\n                    } else if (citationData.type === \"thesis\") {\n                        return `${authorsStr}. ${title} [tesis]. ${city}: ${university}; ${year}.`;\n                    }\n                    return \"\";\n                }\n            }\n        ];\n\n        \/\/ Funciones para formatear autores seg\u00fan cada estilo\n        function formatAuthorsAPA() {\n            if (citationData.authors.length === 0) return \"\";\n            \n            if (citationData.authors.length === 1) {\n                const author = citationData.authors[0];\n                return `${author.lastName}, ${author.firstName.charAt(0)}.${author.middleName ? ` ${author.middleName.charAt(0)}.` : ''}`;\n            } else if (citationData.authors.length === 2) {\n                const author1 = citationData.authors[0];\n                const author2 = citationData.authors[1];\n                return `${author1.lastName}, ${author1.firstName.charAt(0)}.${author1.middleName ? ` ${author1.middleName.charAt(0)}.` : ''}, & ${author2.lastName}, ${author2.firstName.charAt(0)}.${author2.middleName ? ` ${author2.middleName.charAt(0)}.` : ''}`;\n            } else {\n                const firstAuthor = citationData.authors[0];\n                return `${firstAuthor.lastName}, ${firstAuthor.firstName.charAt(0)}.${firstAuthor.middleName ? ` ${firstAuthor.middleName.charAt(0)}.` : ''}, et al.`;\n            }\n        }\n\n        function formatAuthorsHarvard() {\n            if (citationData.authors.length === 0) return \"\";\n            \n            if (citationData.authors.length === 1) {\n                const author = citationData.authors[0];\n                return `${author.lastName}, ${author.firstName.charAt(0)}${author.middleName ? `${author.middleName.charAt(0)}` : ''}`;\n            } else if (citationData.authors.length === 2) {\n                const author1 = citationData.authors[0];\n                const author2 = citationData.authors[1];\n                return `${author1.lastName}, ${author1.firstName.charAt(0)} and ${author2.lastName}, ${author2.firstName.charAt(0)}`;\n            } else {\n                const firstAuthor = citationData.authors[0];\n                return `${firstAuthor.lastName}, ${firstAuthor.firstName.charAt(0)} et al.`;\n            }\n        }\n\n        function formatAuthorsChicago() {\n            if (citationData.authors.length === 0) return \"\";\n            \n            if (citationData.authors.length === 1) {\n                const author = citationData.authors[0];\n                return `${author.firstName}${author.middleName ? ` ${author.middleName}` : ''} ${author.lastName}${author.secondLastName ? ` ${author.secondLastName}` : ''}`;\n            } else if (citationData.authors.length === 2) {\n                const author1 = citationData.authors[0];\n                const author2 = citationData.authors[1];\n                return `${author1.firstName} ${author1.lastName} and ${author2.firstName} ${author2.lastName}`;\n            } else {\n                const firstAuthor = citationData.authors[0];\n                return `${firstAuthor.firstName} ${firstAuthor.lastName} et al.`;\n            }\n        }\n\n        function formatAuthorsTurabian() {\n            return formatAuthorsChicago(); \/\/ Turabian uses same format as Chicago\n        }\n\n        function formatAuthorsIEEE() {\n            if (citationData.authors.length === 0) return \"\";\n            \n            return citationData.authors.map(author => \n                `${author.firstName.charAt(0)}. ${author.middleName ? `${author.middleName.charAt(0)}. ` : ''}${author.lastName}`\n            ).join(', ');\n        }\n\n        function formatAuthorsVancouver() {\n            if (citationData.authors.length === 0) return \"\";\n            \n            if (citationData.authors.length <= 6) {\n                return citationData.authors.map(author => \n                    `${author.lastName} ${author.firstName.charAt(0)}${author.middleName ? `${author.middleName.charAt(0)}` : ''}`\n                ).join(', ');\n            } else {\n                const firstSix = citationData.authors.slice(0, 6).map(author => \n                    `${author.lastName} ${author.firstName.charAt(0)}${author.middleName ? `${author.middleName.charAt(0)}` : ''}`\n                ).join(', ');\n                return `${firstSix}, et al.`;\n            }\n        }\n\n        function formatAuthorsMLA() {\n            if (citationData.authors.length === 0) return \"\";\n            \n            if (citationData.authors.length === 1) {\n                const author = citationData.authors[0];\n                return `${author.lastName}, ${author.firstName}${author.middleName ? ` ${author.middleName}` : ''}`;\n            } else if (citationData.authors.length === 2) {\n                const author1 = citationData.authors[0];\n                const author2 = citationData.authors[1];\n                return `${author1.lastName}, ${author1.firstName}, and ${author2.firstName} ${author2.lastName}`;\n            } else {\n                const firstAuthor = citationData.authors[0];\n                return `${firstAuthor.lastName}, ${firstAuthor.firstName}, et al.`;\n            }\n        }\n\n        function formatAuthorsABNT() {\n            if (citationData.authors.length === 0) return \"\";\n            \n            return citationData.authors.map(author => \n                `${author.lastName.toUpperCase()}${author.secondLastName ? ` ${author.secondLastName.toUpperCase()}` : ''}, ${author.firstName}${author.middleName ? ` ${author.middleName}` : ''}`\n            ).join('; ');\n        }\n\n        function formatAuthorsCSE() {\n            if (citationData.authors.length === 0) return \"\";\n            \n            return citationData.authors.map(author => \n                `${author.lastName} ${author.firstName.charAt(0)}${author.middleName ? `${author.middleName.charAt(0)}` : ''}`\n            ).join(', ');\n        }\n\n        function formatAuthorsASA() {\n            if (citationData.authors.length === 0) return \"\";\n            \n            if (citationData.authors.length === 1) {\n                const author = citationData.authors[0];\n                return `${author.lastName}, ${author.firstName}${author.middleName ? ` ${author.middleName}` : ''}`;\n            } else if (citationData.authors.length === 2) {\n                const author1 = citationData.authors[0];\n                const author2 = citationData.authors[1];\n                return `${author1.lastName}, ${author1.firstName} and ${author2.firstName} ${author2.lastName}`;\n            } else {\n                const firstAuthor = citationData.authors[0];\n                return `${firstAuthor.lastName}, ${firstAuthor.firstName} et al.`;\n            }\n        }\n\n        function formatAuthorsAPSA() {\n            return formatAuthorsASA(); \/\/ APSA uses same format as ASA\n        }\n\n        function formatAuthorsAAA() {\n            if (citationData.authors.length === 0) return \"\";\n            \n            return citationData.authors.map(author => \n                `${author.firstName}${author.middleName ? ` ${author.middleName}` : ''} ${author.lastName}`\n            ).join(', ');\n        }\n\n        function formatAuthorsAMA() {\n            return formatAuthorsVancouver(); \/\/ AMA uses similar format to Vancouver\n        }\n\n        \/\/ Funciones para manejar autores\n        function addAuthor() {\n            authorCounter++;\n            const authorsContainer = document.getElementById('authorsContainer');\n            \n            const authorDiv = document.createElement('div');\n            authorDiv.className = 'author-section';\n            authorDiv.id = `author-${authorCounter}`;\n            \n            authorDiv.innerHTML = `\n                <div class=\"author-header\">\n                    <span class=\"author-title\">Autor ${authorCounter}<\/span>\n                    ${authorCounter > 1 ? `<button type=\"button\" class=\"btn btn-danger btn-sm\" onclick=\"removeAuthor(${authorCounter})\">\ud83d\uddd1\ufe0f Eliminar<\/button>` : ''}\n                <\/div>\n                <div class=\"form-row-4\">\n                    <div class=\"form-group\">\n                        <label for=\"firstName-${authorCounter}\">Primer Nombre <span class=\"required\">*<\/span><\/label>\n                        <input type=\"text\" id=\"firstName-${authorCounter}\" class=\"form-control\" placeholder=\"Juan\" data-author=\"${authorCounter}\" data-field=\"firstName\">\n                        <div id=\"firstNameError-${authorCounter}\" class=\"error-message hidden\">Primer nombre obligatorio<\/div>\n                    <\/div>\n                    <div class=\"form-group\">\n                        <label for=\"middleName-${authorCounter}\">Segundo Nombre<\/label>\n                        <input type=\"text\" id=\"middleName-${authorCounter}\" class=\"form-control\" placeholder=\"Carlos\" data-author=\"${authorCounter}\" data-field=\"middleName\">\n                    <\/div>\n                    <div class=\"form-group\">\n                        <label for=\"lastName-${authorCounter}\">Primer Apellido <span class=\"required\">*<\/span><\/label>\n                        <input type=\"text\" id=\"lastName-${authorCounter}\" class=\"form-control\" placeholder=\"Garc\u00eda\" data-author=\"${authorCounter}\" data-field=\"lastName\">\n                        <div id=\"lastNameError-${authorCounter}\" class=\"error-message hidden\">Primer apellido obligatorio<\/div>\n                    <\/div>\n                    <div class=\"form-group\">\n                        <label for=\"secondLastName-${authorCounter}\">Segundo Apellido<\/label>\n                        <input type=\"text\" id=\"secondLastName-${authorCounter}\" class=\"form-control\" placeholder=\"L\u00f3pez\" data-author=\"${authorCounter}\" data-field=\"secondLastName\">\n                    <\/div>\n                <\/div>\n            `;\n            \n            authorsContainer.appendChild(authorDiv);\n            \n            \/\/ Agregar el autor al array\n            citationData.authors.push({\n                id: authorCounter,\n                firstName: '',\n                middleName: '',\n                lastName: '',\n                secondLastName: ''\n            });\n            \n            \/\/ Agregar event listeners\n            addAuthorEventListeners(authorCounter);\n            \n            validateForm();\n        }\n\n        function removeAuthor(authorId) {\n            const authorDiv = document.getElementById(`author-${authorId}`);\n            if (authorDiv) {\n                authorDiv.remove();\n            }\n            \n            \/\/ Remover del array\n            citationData.authors = citationData.authors.filter(author => author.id !== authorId);\n            \n            \/\/ Renumerar autores restantes\n            renumberAuthors();\n            validateForm();\n            renderCitations();\n        }\n\n        function renumberAuthors() {\n            const authorSections = document.querySelectorAll('.author-section');\n            authorSections.forEach((section, index) => {\n                const authorTitle = section.querySelector('.author-title');\n                if (authorTitle) {\n                    authorTitle.textContent = `Autor ${index + 1}`;\n                }\n            });\n        }\n\n        function addAuthorEventListeners(authorId) {\n            const fields = ['firstName', 'middleName', 'lastName', 'secondLastName'];\n            \n            fields.forEach(field => {\n                const input = document.getElementById(`${field}-${authorId}`);\n                if (input) {\n                    input.addEventListener('input', function() {\n                        updateAuthorData(authorId, field, this.value);\n                    });\n                }\n            });\n        }\n\n        function updateAuthorData(authorId, field, value) {\n            const authorIndex = citationData.authors.findIndex(author => author.id === authorId);\n            if (authorIndex !== -1) {\n                citationData.authors[authorIndex][field] = value;\n                validateForm();\n                renderCitations();\n            }\n        }\n\n        \/\/ Funciones de validaci\u00f3n\n        function validateForm() {\n            let isValid = true;\n            \n            \/\/ Validar t\u00edtulo\n            const title = document.getElementById('title');\n            const titleError = document.getElementById('titleError');\n            if (!title.value.trim()) {\n                title.classList.add('error');\n                titleError.classList.remove('hidden');\n                isValid = false;\n            } else {\n                title.classList.remove('error');\n                titleError.classList.add('hidden');\n            }\n            \n            \/\/ Validar a\u00f1o\n            const year = document.getElementById('year');\n            const yearError = document.getElementById('yearError');\n            if (!year.value.trim()) {\n                year.classList.add('error');\n                yearError.classList.remove('hidden');\n                isValid = false;\n            } else {\n                year.classList.remove('error');\n                yearError.classList.add('hidden');\n            }\n            \n            \/\/ Validar autores\n            citationData.authors.forEach(author => {\n                const firstNameInput = document.getElementById(`firstName-${author.id}`);\n                const lastNameInput = document.getElementById(`lastName-${author.id}`);\n                const firstNameError = document.getElementById(`firstNameError-${author.id}`);\n                const lastNameError = document.getElementById(`lastNameError-${author.id}`);\n                \n                if (!author.firstName.trim()) {\n                    if (firstNameInput) firstNameInput.classList.add('error');\n                    if (firstNameError) firstNameError.classList.remove('hidden');\n                    isValid = false;\n                } else {\n                    if (firstNameInput) firstNameInput.classList.remove('error');\n                    if (firstNameError) firstNameError.classList.add('hidden');\n                }\n                \n                if (!author.lastName.trim()) {\n                    if (lastNameInput) lastNameInput.classList.add('error');\n                    if (lastNameError) lastNameError.classList.remove('hidden');\n                    isValid = false;\n                } else {\n                    if (lastNameInput) lastNameInput.classList.remove('error');\n                    if (lastNameError) lastNameError.classList.add('hidden');\n                }\n            });\n            \n            \/\/ Actualizar estado del bot\u00f3n RIS\n            const downloadBtn = document.getElementById('downloadRIS');\n            downloadBtn.disabled = !isValid || citationData.authors.length === 0;\n            \n            return isValid;\n        }\n\n        \/\/ Funciones de utilidad\n        function showToast(message, isError = false) {\n            const toast = document.createElement('div');\n            toast.className = 'toast' + (isError ? ' error' : '');\n            toast.textContent = message;\n            document.body.appendChild(toast);\n            \n            setTimeout(() => toast.classList.add('show'), 100);\n            setTimeout(() => {\n                toast.classList.remove('show');\n                setTimeout(() => document.body.removeChild(toast), 300);\n            }, 3000);\n        }\n\n        function copyToClipboard(text, format) {\n            if (navigator.clipboard) {\n                navigator.clipboard.writeText(text).then(() => {\n                    showToast(`Cita ${format} copiada al portapapeles`);\n                }).catch(() => {\n                    showToast('Error al copiar', true);\n                });\n            } else {\n                const textArea = document.createElement('textarea');\n                textArea.value = text;\n                document.body.appendChild(textArea);\n                textArea.select();\n                try {\n                    document.execCommand('copy');\n                    showToast(`Cita ${format} copiada al portapapeles`);\n                } catch (err) {\n                    showToast('Error al copiar', true);\n                }\n                document.body.removeChild(textArea);\n            }\n        }\n\n        function generateRIS() {\n            const { title, year, publisher, city, journal, volume, issue, pages, url, doi, university, thesisType } = citationData;\n            let ris = \"\";\n            \n            if (citationData.type === \"book\") {\n                ris += \"TY  - BOOK\\n\";\n            } else if (citationData.type === \"journal\") {\n                ris += \"TY  - JOUR\\n\";\n            } else if (citationData.type === \"website\") {\n                ris += \"TY  - ELEC\\n\";\n            } else if (citationData.type === \"thesis\") {\n                ris += \"TY  - THES\\n\";\n            }\n            \n            \/\/ Autores\n            citationData.authors.forEach(author => {\n                if (author.firstName && author.lastName) {\n                    ris += `AU  - ${author.lastName}${author.secondLastName ? ` ${author.secondLastName}` : ''}, ${author.firstName}${author.middleName ? ` ${author.middleName}` : ''}\\n`;\n                }\n            });\n            \n            if (title) ris += `TI  - ${title}\\n`;\n            if (year) ris += `PY  - ${year}\\n`;\n            \n            if (citationData.type === \"book\") {\n                if (publisher) ris += `PB  - ${publisher}\\n`;\n                if (city) ris += `CY  - ${city}\\n`;\n            } else if (citationData.type === \"journal\") {\n                if (journal) ris += `JO  - ${journal}\\n`;\n                if (volume) ris += `VL  - ${volume}\\n`;\n                if (issue) ris += `IS  - ${issue}\\n`;\n                if (pages) {\n                    const pageRange = pages.split(\"-\");\n                    if (pageRange.length === 2) {\n                        ris += `SP  - ${pageRange[0].trim()}\\n`;\n                        ris += `EP  - ${pageRange[1].trim()}\\n`;\n                    } else {\n                        ris += `SP  - ${pages}\\n`;\n                    }\n                }\n                if (doi) ris += `DO  - ${doi}\\n`;\n            } else if (citationData.type === \"thesis\") {\n                if (university) ris += `PB  - ${university}\\n`;\n                if (thesisType) {\n                    const thesisTypeMap = { \n                        doctoral: \"Ph.D. thesis\", \n                        master: \"Master's thesis\", \n                        bachelor: \"Bachelor's thesis\" \n                    };\n                    ris += `M3  - ${thesisTypeMap[thesisType]}\\n`;\n                }\n            }\n            \n            if (url) ris += `UR  - ${url}\\n`;\n            if (citationData.type === \"website\" && citationData.accessDate) {\n                ris += `Y2  - ${citationData.accessDate}\\n`;\n            }\n            \n            ris += \"ER  - \\n\";\n            return ris;\n        }\n\n        function downloadRIS() {\n            if (!validateForm()) {\n                showToast('Por favor completa todos los campos obligatorios', true);\n                return;\n            }\n            \n            const risContent = generateRIS();\n            const blob = new Blob([risContent], { type: 'text\/plain;charset=utf-8' });\n            const url = URL.createObjectURL(blob);\n            const link = document.createElement('a');\n            link.href = url;\n            link.download = `citation-${Date.now()}.ris`;\n            document.body.appendChild(link);\n            link.click();\n            document.body.removeChild(link);\n            URL.revokeObjectURL(url);\n            \n            showToast('Archivo RIS descargado correctamente');\n        }\n\n        function updateFormFields() {\n            const type = citationData.type;\n            const bookFields = document.getElementById('bookFields');\n            const journalFields = document.getElementById('journalFields');\n            const thesisFields = document.getElementById('thesisFields');\n            const urlGroup = document.getElementById('urlGroup');\n            const accessDateGroup = document.getElementById('accessDateGroup');\n            const doiGroup = document.getElementById('doiGroup');\n            const editionGroup = document.getElementById('editionGroup');\n            \n            \/\/ Ocultar todos los campos\n            bookFields.classList.add('hidden');\n            journalFields.classList.add('hidden');\n            thesisFields.classList.add('hidden');\n            urlGroup.classList.add('hidden');\n            accessDateGroup.classList.add('hidden');\n            doiGroup.classList.add('hidden');\n            editionGroup.classList.add('hidden');\n            \n            \/\/ Mostrar campos seg\u00fan el tipo\n            if (type === 'book') {\n                bookFields.classList.remove('hidden');\n                editionGroup.classList.remove('hidden');\n            } else if (type === 'journal') {\n                journalFields.classList.remove('hidden');\n                urlGroup.classList.remove('hidden');\n                doiGroup.classList.remove('hidden');\n            } else if (type === 'website') {\n                urlGroup.classList.remove('hidden');\n                accessDateGroup.classList.remove('hidden');\n            } else if (type === 'thesis') {\n                thesisFields.classList.remove('hidden');\n            }\n        }\n\n        function renderCitations() {\n            const container = document.getElementById('citationsContainer');\n            const filteredCitations = selectedCategory === 'all' \n                ? citations \n                : citations.filter(citation => citation.category === selectedCategory);\n            \n            container.innerHTML = '';\n            \n            filteredCitations.forEach(citation => {\n                const citationText = citation.generator();\n                const div = document.createElement('div');\n                div.className = 'citation-item';\n                div.innerHTML = `\n                    <div class=\"citation-header\">\n                        <div>\n                            <div class=\"citation-title\">${citation.format}<\/div>\n                            <div style=\"font-size: 12px; color: #666; margin-top: 3px;\">${citation.description}<\/div>\n                        <\/div>\n                        <div>\n                            <span class=\"citation-category\">${citation.category}<\/span>\n                            <button class=\"btn btn-copy\" onclick=\"copyToClipboard('${citationText.replace(\/'\/g, \"\\\\'\")}', '${citation.format}')\" ${!citationText ? 'disabled' : ''}>\n                                \ud83d\udccb Copiar\n                            <\/button>\n                        <\/div>\n                    <\/div>\n                    <div class=\"citation-text\">\n                        ${citationText || 'Completa los campos obligatorios para generar la cita'}\n                    <\/div>\n                `;\n                container.appendChild(div);\n            });\n        }\n\n        \/\/ Inicializaci\u00f3n\n        document.addEventListener('DOMContentLoaded', function() {\n            \/\/ Agregar el primer autor por defecto\n            addAuthor();\n            \n            updateFormFields();\n            renderCitations();\n            \n            \/\/ Event listeners para campos b\u00e1sicos\n            const basicFields = ['type', 'title', 'year', 'publisher', 'city', 'journal', 'volume', 'issue', 'pages', 'url', 'accessDate', 'doi', 'edition', 'thesisType', 'university', 'department'];\n            \n            basicFields.forEach(field => {\n                const element = document.getElementById(field);\n                if (element) {\n                    element.addEventListener('input', function() {\n                        citationData[field] = this.value;\n                        if (field === 'type') {\n                            updateFormFields();\n                        }\n                        validateForm();\n                        renderCitations();\n                    });\n                }\n            });\n            \n            document.getElementById('categoryFilter').addEventListener('change', function() {\n                selectedCategory = this.value;\n                renderCitations();\n            });\n            \n            document.getElementById('downloadRIS').addEventListener('click', downloadRIS);\n        });\n    <\/script>\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>Generador de Citas Bibliogr\u00e1ficas Generador de Citas Bibliogr\u00e1ficas Genera citas en m\u00faltiples formatos acad\u00e9micos autom\u00e1ticamente \ud83d\udcda Informaci\u00f3n de la Fuente [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_eb_attr":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"disabled","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-2641","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/biblioteca.utc.edu.ec\/index.php?rest_route=\/wp\/v2\/pages\/2641","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/biblioteca.utc.edu.ec\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/biblioteca.utc.edu.ec\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/biblioteca.utc.edu.ec\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/biblioteca.utc.edu.ec\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2641"}],"version-history":[{"count":17,"href":"https:\/\/biblioteca.utc.edu.ec\/index.php?rest_route=\/wp\/v2\/pages\/2641\/revisions"}],"predecessor-version":[{"id":2849,"href":"https:\/\/biblioteca.utc.edu.ec\/index.php?rest_route=\/wp\/v2\/pages\/2641\/revisions\/2849"}],"wp:attachment":[{"href":"https:\/\/biblioteca.utc.edu.ec\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}