// Numbas version: exam_results_page_options {"name": "Ben's copy of Displaying a randomised LaTeX command", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "statement": "

If you don't wrap the string in the latex function, it's displayed as plain text: $\\var{expression}$

\n

The correct way to do it is as follows: $\\var{latex(expression)}$

\n

\n

$\\var{latex(tryThis)}$ vs $\\simplify{{latex('\\frac{3}{2}')}}$

\n

\n

$\\var{latex('\\frac{1}{2}')}$

\n

\n

$\\var{test}$ $\\var{blah}$

\n

\n

{text} {math}

", "advice": "", "variables": {"test": {"name": "test", "definition": "latex(\"\\\\sqrt{2}\")", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "expressions": {"name": "expressions", "definition": "[\n\"\\\\frac\\{1\\}\\{2\\}\",\n\"\\\\sin(x)\",\n\"2 + \\\\hat\\{x\\}\"\n]", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "tryThis": {"name": "tryThis", "definition": "'\\\\sqrt\\{x\\}'", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "text": {"name": "text", "definition": "\"blah\"", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "math": {"name": "math", "definition": "5^2", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "expression": {"name": "expression", "definition": "random(expressions)", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "blah": {"name": "blah", "definition": "5", "group": "Ungrouped variables", "templateType": "anything", "description": ""}}, "rulesets": {}, "tags": [], "preamble": {"js": "", "css": ""}, "extensions": [], "name": "Ben's copy of Displaying a randomised LaTeX command", "functions": {}, "variablesTest": {"maxRuns": 100, "condition": ""}, "ungrouped_variables": ["expressions", "expression", "test", "tryThis", "blah", "text", "math"], "metadata": {"description": "

Demonstrates how to create variables containing LaTeX commands, and how to use them in the question text.

", "licence": "Creative Commons Attribution 4.0 International"}, "parts": [], "type": "question", "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}