How to output LaTeX code in line with PHP text statement

Viewed 111

Hope you're all doing well during such extraordinary times. I'm trying to display mathematical equations on my website but it keeps doing so centred and on a new line. I apologise in advance if the solution is simple, I haven't much experience in code and have been trying to find solutions by searching the web but have had little luck.
First I'm storing an array with my question and possible answers:
<?PHP $basic_question1 = array('Find the roots of the equation $${x^2} + 8x + 1 = 0$$','\[x =  \pm 4 + \sqrt {15} \]','No solutions','\[x =  \pm 4\sqrt {15} \]','\[x = 8,x = 1\]')?>

Then, in HTML, an input type radio

<form action="easyquestionsscore.php" method="post">
            <div class="col-md-4 offset-md-4 form-div questions1">
                <p><?php echo $basic_question1[0]?></p>
                <!-- we can only choose one bullet point as all inputs have the same name -->
                <p><input type="radio" name="question1" value="1" > <?php echo $basic_question1[1]?> </p>
                <p><input type="radio" name="question1" value="2"> <?php echo $basic_question1[2]?> </p>
                <p><input type="radio" name="question1" value="3"> <?php echo $basic_question1[3]?> </p>
                <p><input type="radio" name="question1" value="4"> <?php echo $basic_question1[4]?> </p>
                <div class="form-group">
                    <input type="submit" value="Submit" name="submit" class="btn btn-primary"/>
                </div>
            </div>
</form>

The CSS code is:

.form-div.questions1{
    margin: 50px auto 50px;
    padding: 25px 15px 10px 15px;
    border: 1px solid #80ced7;
    border-radius: 250px;
    font-size: 1.1em;
    text-align: center;
    font-family: 'Lora', serif
}
.col-md-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}
.offset-md-4{margin-left:33.333333%}
.form-div.questions{
        margin: 50px auto 50px;
        padding: 25px 15px 10px 15px;
        border: 1px solid #80ced7;
        border-radius: 5px;
        font-size: 1.1em;
        text-align: center;
        font-family: 'Lora', serif
    }

However my result is https://i.stack.imgur.com/R9aCw.png Has anyone advice please? My aim is that the math equations won't start a new line and will follow the same format as 'No sultions' (being next to the clickable circle). I have been using MathType to generate the LaTeX code.
Cheers

0 Answers
Related