```js import {tex2GIFT, GIFT2tex} from "tex2gift2tex";
npm install tex2gift2texjs
import {tex2GIFT, GIFT2tex} from "tex2gift2tex";
// Translate a LaTeX File into a GIFT file. LaTeX files must be formatted.
tex2GIFT(/ Filepath and filename of latex file/,/ Filepath and filename of gift file / );
// Translate a GIFT File into a LaTeX file. GIFT files must be formatted.
GIFT2tex(/ Filepath and filename of GIFT file/, / Filepath and filename of LaTeX file / );
`
LaTeX file format
To be translated into a gift file, Latex files must have at least one `\questions` environment.
Every `\question` in the environment will be turned into a single gift question.
Example
The following example has questions essay questions, true/false questions, short answer questions, numerical questions and multiple choice questions.
`tex
\documentclass{exam}
\usepackage{amsmath}
\usepackage{amsfonts}
\begin{document}
\section{Respuestas redacción}
\begin{questions}
\question Redacción 1. Sin extras.
\question Redacción 2. \underline{\hspace{3cm}}. Con un subrayado.
\question Redacción 3. \[\int_{0}^{\infty} \frac{\sin(x)}{x}\] . Con fórmula.
\question Redacción 4. \[\int_{0}^{\infty} \frac{\sin(x)}{x}\] . \underline{\hspace{3cm}}. Con subrayado y fórmula.
\end{questions}
\section{Respuestas verdadero falso}
\begin{questions}
\question VF 1. Sin extras. Respuesta al final del enunciado. \fillin[T]
\question VF 2. \fillin[F] Sin extras. Respuesta en medio del enunciado
\question \fillin[verdadero] VF 3. Sin extras. Respuesta al inicio del enunciado
\question VF 4. $ \int_{0}^{\infty} \frac{\sin(x)}{x} $ . Con fórmula. Respuesta al final del enunciado. \fillin[T]
\question VF 5. \fillin[F] $ \int_{0}^{\infty} \frac{\sin(x)}{x} $ . Con fórmula. Respuesta en medio del enunciado
\question \fillin[falso] VF 6. $ \int_{0}^{\infty} \frac{\sin(x)}{x} $ . Con fórmula. Respuesta al inicio del enunciado
\question VF 7. \underline{\hspace{3cm}}. Con un subrayado. Respuesta al final del enunciado. \fillin[True]
\question VF 8. \fillin[False] \underline{\hspace{3cm}}. Con un subrayado. Respuesta en medio del enunciado
\question \fillin[mentira] VF 9. \underline{\hspace{3cm}}. Con un subrayado. Respuesta al inicio del enunciado
\question VF 10. $ \int_{0}^{\infty} \frac{\sin(x)}{x} $ . \underline{\hspace{3cm}}. Con subrayado y fórmula. Respuesta al final del enunciado. \fillin[T]
\question VF 11. \fillin[F] $ \int_{0}^{\infty} \frac{\sin(x)}{x} $ . \underline{\hspace{3cm}}. Con subrayado y fórmula. Respuesta en medio del enunciado
\question \fillin[falso] VF 12. $ \int_{0}^{\infty} \frac{\sin(x)}{x} $ .\underline{\hspace{3cm}}. Con subrayado y fórmula. Respuesta al inicio del enunciado
\end{questions}
\section{Respuestas cortas y numéricas}
\begin{questions}
\question Corta 1. Sin extras. Respuesta al final del enunciado. \fillin[respuesta]
\question Corta 2. \fillin[respuesta] Sin extras. Respuesta en medio del enunciado
\question \fillin[respuesta] Corta 3. Sin extras. Respuesta al inicio del enunciado
\question Corta 4. $ \int_{0}^{\infty} \frac{\sin(x)}{x} $ . Con fórmula. Respuesta al final del enunciado. \fillin[respuesta]
\question Corta 5. \fillin[respuesta] $ \int_{0}^{\infty} \frac{\sin(x)}{x} $ . Con fórmula. Respuesta en medio del enunciado
\question \fillin[respuesta] Corta 6. $ \int_{0}^{\infty} \frac{\sin(x)}{x} $ . Con fórmula. Respuesta al inicio del enunciado
\question Numérica 1. Sin extras. Respuesta al final del enunciado. \fillin[3.14]
\question Numérica 2. \fillin[3.14] Sin extras. Respuesta en medio del enunciado
\question \fillin[3.14] Numérica 3. Sin extras. Respuesta al inicio del enunciado
\question Numérica 4. $ \int_{0}^{\infty} \frac{\sin(x)}{x} $ . Con fórmula. Respuesta al final del enunciado. \fillin[3.14]
\question Numérica 5. \fillin[3.14] $ \int_{0}^{\infty} \frac{\sin(x)}{x} $ . Con fórmula. Respuesta en medio del enunciado
\question \fillin[3.14] Numérica 6. $ \int_{0}^{\infty} \frac{\sin(x)}{x} $ . Con fórmula. Respuesta al inicio del enunciado
\end{questions}
\section{Respuesta tipo test}
\begin{questions}
\question Única correcta 1. Usando checkboxes. Primera correcta.
\begin{checkboxes}
\correctchoice Correcta. Sin extras.
\choice Incorrecta. $\begin{pmatrix} 1 & 0 & 1 \\ 2 & 1 & 0 \\ 3 & 1 & 0 \end{pmatrix}X=\begin{pmatrix} 6 & 4 & 2 \\ 7 & 6 & 5 \\ 10 & 8 & 6 \end{pmatrix}$. Con fórmula.
\choice Incorrecta. \underline{\hspace{3cm}}. Con subrayado
\choice Incorrecta. $ \int_{0}^{\infty} \frac{\sin(x)}{x} $ . \underline{\hspace{3cm}}. Con subrayado y fórmula.
\end{checkboxes}
\question Única correcta 2. Usando choices. Segunda correcta.
\begin{choices}
\choice Incorrecta. Sin extras.
\correctchoice Correcta. $\begin{pmatrix} 1 & 0 & 1 \\ 2 & 1 & 0 \\ 3 & 1 & 0 \end{pmatrix}X=\begin{pmatrix} 6 & 4 & 2 \\ 7 & 6 & 5 \\ 10 & 8 & 6 \end{pmatrix}$. Con fórmula.
\choice Incorrecta. \underline{\hspace{3cm}}. Con subrayado
\choice Incorrecta. $ \int_{0}^{\infty} \frac{\sin(x)}{x} $ . \underline{\hspace{3cm}}. Con subrayado y fórmula.
\end{choices}
\question Única correcta 3. Usando oneparchoices. Última correcta.
\begin{oneparchoices}
\choice Incorrecta. Sin extras.
\choice Incorrecta. $\begin{pmatrix} 1 & 0 & 1 \\ 2 & 1 & 0 \\ 3 & 1 & 0 \end{pmatrix}X=\begin{pmatrix} 6 & 4 & 2 \\ 7 & 6 & 5 \\ 10 & 8 & 6 \end{pmatrix}$. Con fórmula.
\choice Incorrecta. \underline{\hspace{3cm}}. Con subrayado
\correctchoice Correcta. $ \int_{0}^{\infty} \frac{\sin(x)}{x} $ . \underline{\hspace{3cm}}. Con subrayado y fórmula.
\end{oneparchoices}
\question Múltiples correctas 1. Usando checkboxes. Primera y segunda correcta.
\begin{checkboxes}
\correctchoice Correcta. Sin extras.
\correctchoice Correcta. $\begin{pmatrix} 1 & 0 & 1 \\ 2 & 1 & 0 \\ 3 & 1 & 0 \end{pmatrix}X=\begin{pmatrix} 6 & 4 & 2 \\ 7 & 6 & 5 \\ 10 & 8 & 6 \end{pmatrix}$. Con fórmula.
\choice Incorrecta. \underline{\hspace{3cm}}. Con subrayado
\choice Incorrecta. $ \int_{0}^{\infty} \frac{\sin(x)}{x} $ . \underline{\hspace{3cm}}. Con subrayado y fórmula.
\end{checkboxes}
\question Múltiples correctas 2. Usando choices. Tercera y última correcta.
\begin{choices}
\choice Incorrecta. Sin extras.
\choice Incorrecta. $\begin{pmatrix} 1 & 0 & 1 \\ 2 & 1 & 0 \\ 3 & 1 & 0 \end{pmatrix}X=\begin{pmatrix} 6 & 4 & 2 \\ 7 & 6 & 5 \\ 10 & 8 & 6 \end{pmatrix}$. Con fórmula.
\correctchoice Correcta. \underline{\hspace{3cm}}. Con subrayado
\correctchoice Correcta. $ \int_{0}^{\infty} \frac{\sin(x)}{x} $ . \underline{\hspace{3cm}}. Con subrayado y fórmula.
\end{choices}
\question Múltiples correctas 3. Usando oneparchoices. Primera y última correcta.
\begin{oneparchoices}
\correctchoice Correcta. Sin extras.
\choice Incorrecta. $\begin{pmatrix} 1 & 0 & 1 \\ 2 & 1 & 0 \\ 3 & 1 & 0 \end{pmatrix}X=\begin{pmatrix} 6 & 4 & 2 \\ 7 & 6 & 5 \\ 10 & 8 & 6 \end{pmatrix}$. Con fórmula.
\choice Incorrecta. \underline{\hspace{3cm}}. Con subrayado
\correctchoice Correcta. $ \int_{0}^{\infty} \frac{\sin(x)}{x} $ . \underline{\hspace{3cm}}. Con subrayado y fórmula.
\end{oneparchoices}
\end{questions}
\end{document}
`
Question limitations
$3
Short answer and numerical questions cannot have multiple answers nor underlines, and its answers cannot have underlines or math formulas or be empty.
$3
Multiple choice questions cannot have any `\fillin[]` macros.
GIFT file format.
The following example has questions essay questions, true/false questions, short answer questions, numerical questions, multiple choice questions and matching questions.
`gift
Redacción 1. Sin extras.{}
Redacción 2. _____. Con un subrayado.{}
Redacción 3. $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\}\\ $$ . Con fórmula.{}
Redacción 4. $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\}\\ $$ . _____. Con subrayado y fórmula.{}
Redacción 5. Sin extras.{} Respuesta en medio.
Redacción 6. _____. Con un subrayado.{} Respuesta en medio.
Redacción 7. $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\}\\ $$ . Con fórmula. {} Respuesta en medio.
Redacción 8. $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\}\\ $$ . _____. Con subrayado y fórmula. {} Respuesta en medio.
VF 1. Sin extras. Respuesta al final del enunciado.{T}
VF 2. Sin extras. {F} Respuesta en medio del enunciado
{T} VF 3. Sin extras. Respuesta al inicio del enunciado
VF 4. $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\} $$ . Con fórmula. Respuesta al final del enunciado.{T}
VF 5. $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\} $$ . Con fórmula. {F} Respuesta en medio del enunciado
{F} VF 6. $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\} $$ . Con fórmula. Respuesta al inicio del enunciado
VF 7. _____. Con un subrayado. Respuesta al final del enunciado.{T}
VF 8. _____. Con un subrayado. {F} Respuesta en medio del enunciado
{F} VF 9. _____. Con un subrayado. Respuesta al inicio del enunciado
VF 10. $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\} $$ . _____. Con subrayado y fórmula. Respuesta al final del enunciado.{T}
VF 11. $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\} $$ . _____. Con subrayado y fórmula. {T} Respuesta en medio del enunciado
{T} VF 12. $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\} $$ ._____. Con subrayado y fórmula. Respuesta al inicio del enunciado
Corta 1. Sin extras. Respuesta al final del enunciado. {=respuesta}
Corta 2. {=respuesta} Sin extras. Respuesta en medio del enunciado
{=respuesta} Corta 3. Sin extras. Respuesta al inicio del enunciado
Corta 4. $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\} $$ . Con fórmula. Respuesta al final del enunciado. {=respuesta}
Corta 5. {=respuesta} $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\} $$ . Con fórmula. Respuesta en medio del enunciado
{=respuesta} Corta 6. $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\} $$ . Con fórmula. Respuesta al inicio del enunciado
Numerica 1. Sin extras. Respuesta al final del enunciado. {#3.14:0.1}
Numerica 2. {#3.14:0.1} Sin extras. Respuesta en medio del enunciado
{#3.14:0.1} Numerica 3. Sin extras. Respuesta al inicio del enunciado
Numerica 4. $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\} $$ . Con fórmula. Respuesta al final del enunciado. {#3.14:0.1}
Numerica 5. {#3.14:0.1} $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\} $$ . Con fórmula. Respuesta en medio del enunciado
{#3.14:0.1} Numerica 6. $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\} $$ . Con fórmula. Respuesta al inicio del enunciado
Única correcta 1. Primera correcta.{
=Correcta. Sin extras.
~Incorrecta. $$ \\begin\{pmatrix\} 1 & 0 & 1 \\\\ 2 & 1 & 0 \\\\ 3 & 1 & 0 \\end\{pmatrix\}X\=\\begin\{pmatrix\} 6 & 4 & 2 \\\\ 7 & 6 & 5 \\\\ 10 & 8 & 6 \\end\{pmatrix\} $$. Con fórmula.
~Incorrecta. _____. Con subrayado
~Incorrecta. $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\} $$ . _____. Con subrayado y fórmula.
}
Única correcta 2. Segunda correcta.{
~Incorrecta. Sin extras.
=Correcta. $$ \\begin\{pmatrix\} 1 & 0 & 1 \\\\ 2 & 1 & 0 \\\\ 3 & 1 & 0 \\end\{pmatrix\}X\=\\begin\{pmatrix\} 6 & 4 & 2 \\\\ 7 & 6 & 5 \\\\ 10 & 8 & 6 \\end\{pmatrix\} $$. Con fórmula.
~Incorrecta. _____. Con subrayado
~Incorrecta. $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\} $$ . _____. Con subrayado y fórmula.
}
Única correcta 3. Última correcta.{
~Incorrecta. Sin extras.
~Incorrecta. $$ \\begin\{pmatrix\} 1 & 0 & 1 \\\\ 2 & 1 & 0 \\\\ 3 & 1 & 0 \\end\{pmatrix\}X\=\\begin\{pmatrix\} 6 & 4 & 2 \\\\ 7 & 6 & 5 \\\\ 10 & 8 & 6 \\end\{pmatrix\} $$. Con fórmula.
~Incorrecta. _____. Con subrayado
=Correcta. $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\} $$ . _____. Con subrayado y fórmula.
}
Múltiples correctas 1. Primera y segunda correcta.{
~%50.00%Correcta. Sin extras.
~%50.00%Correcta. $$ \\begin\{pmatrix\} 1 & 0 & 1 \\\\ 2 & 1 & 0 \\\\ 3 & 1 & 0 \\end\{pmatrix\}X\=\\begin\{pmatrix\} 6 & 4 & 2 \\\\ 7 & 6 & 5 \\\\ 10 & 8 & 6 \\end\{pmatrix\} $$. Con fórmula.
~%-50.00%Incorrecta. _____. Con subrayado
~%-50.00%Incorrecta. $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\} $$ . _____. Con subrayado y fórmula.
}
Múltiples correctas 2. Tercera y última correcta.{
~%-50.00%Incorrecta. Sin extras.
~%-50.00%Incorrecta. $$ \\begin\{pmatrix\} 1 & 0 & 1 \\\\ 2 & 1 & 0 \\\\ 3 & 1 & 0 \\end\{pmatrix\}X\=\\begin\{pmatrix\} 6 & 4 & 2 \\\\ 7 & 6 & 5 \\\\ 10 & 8 & 6 \\end\{pmatrix\} $$. Con fórmula.
~%50.00%Correcta. _____. Con subrayado
~%50.00%Correcta. $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\} $$ . _____. Con subrayado y fórmula.
}
Múltiples correctas 3. Primera y última correcta. Pesos variados{
~%25.00%Correcta. Sin extras.
~%-90.00%Incorrecta. $$ \\begin\{pmatrix\} 1 & 0 & 1 \\\\ 2 & 1 & 0 \\\\ 3 & 1 & 0 \\end\{pmatrix\}X\=\\begin\{pmatrix\} 6 & 4 & 2 \\\\ 7 & 6 & 5 \\\\ 10 & 8 & 6 \\end\{pmatrix\} $$. Con fórmula.
~%-10.00%Incorrecta. _____. Con subrayado
~%75.00%Correcta. $$ \\int_\{0\}^\{\\infty\} \\frac\{\\sin(x)\}\{x\} $$ . _____. Con subrayado y fórmula.
}
Relación 1. {
=Sin extras. -> Sin extras.
=$$ \\begin\{pmatrix\} 1 & 0 & 1 \\\\ 2 & 1 & 0 \\\\ 3 & 1 & 0 \\end\{pmatrix\}X\=\\begin\{pmatrix\} 6 & 4 & 2 \\\\ 7 & 6 & 5 \\\\ 10 & 8 & 6 \\end\{pmatrix\} $$ -> Con fórmula
}
``