1

While creating a deck for Anki using the import functionality from csv, I've run into an issue getting the line breaks to function properly.

Here is the situation:

  • This is for the front card
  • It is imported from a csv file
  • Starts out with a question and is followed by an equation
  • There needs to be a line break between the equation and question
  • the equation and question should be centered

This is what has been tried so far:

Inserting <br>

How is the following matrix-vector product computed? <br>
\( y^{T}=x^{T}A 
\)

When using <br> as a line break, it seems to get ignored for some reason. The result can be seen here. And yes, the option to "allow HTML in fields" is selected.

Use \\ linebreaks inside of mathjax/latex math equation using \displaylines{}

How is the following matrix-vector product computed?
\( \displaylines{
\\y =Ax
}\)

This does create a line break but did not center the equation. You can see the result here. Note: without \displaylines{}, the \\ line breaks wouldn't work.

How is a line break created in Anki when importing from a csv file?

1 Answers1

0

I read through the docs here

Anki docs importing

And everything you are saying is represented.

However it would seem you're asking a seperate question about how to center the equation which would seem to be a question of latex markup.

have you tried this ?

latex text alignment

If latex is working but html is not, consider trying to use the latex tag.

As to what another programmers code looks like, eg the developers of anki, there is really no way of knowing without seeing it.

Try using the \centering latex tag. Its specified as a builtin.

This will of course expect that whatever renderer anki is using supports this command, which it probably does as its likely using the standard LaTex compiler.

Hope this helps.