Zim

Preserve Verbatim Text Completely

Asked by Jayesh Badwaik

Hi,

I have been using zim to create and export my website. Now, I would like to use MathJaX in my websites in order to depict the math I want to use. I have created a template which is a copy of Default_with_index template, where the resulting webpages load the MathJaX script. That's not a problem.

However, my next problem is to protect the MathJaX I use from the zim parser and keep it completely intact through the parsing process. Is this possible? Is there some sort of way, where one write something like in wiki

<donotparsetag>
\begin{align}
\lim\limits_{x \to 0} \int \limits_\Omega f dx = 0
\end{align}
<donotparsetagend>

which then translates into
\begin{align}
\lim\limits_{x \to 0} \int \limits_\Omega f dx = 0
\end{align}

in the html file (without <br> and <tt>) tags? I've seen that verbatim does that by just adding pre, may be a similar mode can be created which does not even attach <pre>?

Question information

Language:
English Edit question
Status:
Answered
For:
Zim Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) said :
#1

There is no such feature by default, but it can be created by an plugin.

Might be an interesting option to re-use the equation editor here. Could
make it such that the template can use the latex source instead of the
image output. Would that help ?

Regards,

Jaap

On Thu, Jan 14, 2016 at 7:17 PM, Jayesh Badwaik <
<email address hidden>> wrote:

> New question #280983 on Zim:
> https://answers.launchpad.net/zim/+question/280983
>
> Hi,
>
> I have been using zim to create and export my website. Now, I would like
> to use MathJaX in my websites in order to depict the math I want to use. I
> have created a template which is a copy of Default_with_index template,
> where the resulting webpages load the MathJaX script. That's not a problem.
>
> However, my next problem is to protect the MathJaX I use from the zim
> parser and keep it completely intact through the parsing process. Is this
> possible? Is there some sort of way, where one write something like in wiki
>
> <donotparsetag>
> \begin{align}
> \lim\limits_{x \to 0} \int \limits_\Omega f dx = 0
> \end{align}
> <donotparsetagend>
>
> which then translates into
> \begin{align}
> \lim\limits_{x \to 0} \int \limits_\Omega f dx = 0
> \end{align}
>
> in the html file (without <br> and <tt>) tags? I've seen that verbatim
> does that by just adding pre, may be a similar mode can be created which
> does not even attach <pre>?
>
> --
> You received this question notification because you are an answer
> contact for Zim.
>

Revision history for this message
Jayesh Badwaik (d-cbuntuone-b) said :
#2

Yes

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) said :
#3

That would actually be quite easy to make for me - the latex export also exports the equations inline. What block delimiter should we use ? In the MathJX manual I see "\[ \]" is this the default you would use?

-- Jaap

Revision history for this message
Jayesh Badwaik (d-cbuntuone-b) said :
#4

I'm sorry, I did not understand what you meant at first. You meant that a person will still enter the equation through an equation editor, which will then be displayed in the wiki as the image, but when being exported will be exported with the default MathJAX delimiter attached. There is nothing wrong with this.

My original proposed setup was different, and if that is not acceptable to you, then the above setup is completely fine. However, what I wanted to do was to introduce a "verbatim" block plugin. And all the text which is inside that block will be transferred as it is to HTML.

This has two advantages:
1. While MathJAX does have a default delimiter, I frequently use other delimiters because they serve different purpose, which are not satisfied by "\[ \]" in some cases.
2. Typing it out in the the wiki itself is much more comfortable for me, even if the text is not converted to image of equation,
     since I'm pretty comfortable reading LaTeX, as might be with other people too, who are pretty comfortable reading/writing
     LaTeX.

The disadvantage is that the equation is visible as an image in Wiki. I don't have any problems right now with it, and you can always develop code to detect the MathJaX limiters in the verbatim text, and then convert the text into image later, should somebody ask for it.

Revision history for this message
Jayesh Badwaik (d-cbuntuone-b) said :
#5

Grammatical Mistake in the last paragraph:

The disadvantage is that the equation is now not visible as an image in Wiki. I don't have any problems right now with it, and you can always develop code to detect the MathJaX limiters in the verbatim text, and then convert the text into image later, should somebody ask for it.

More clarification:
I'm not sure how to implement the verbatim plugin, it can be a text mode like the verbatim you already have, but even more handsoff, in that, it does nothing, does not even introduce the <br> tags which is done in verbatim.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) said :
#6

Yes, I understand how the proposal differs. While I want to address those
functions as well, it is not an easy fix, while re-using the equation
editor can be made easily.

Entering latex directly inline would also be usefull for the equation editor
And having verbatim blocks for export is also a good idea, but requires a
separate "object" on it's own.

REgards,

Jaap

On Tue, Feb 2, 2016 at 8:57 PM, Jayesh Badwaik <
<email address hidden>> wrote:

> Question #280983 on Zim changed:
> https://answers.launchpad.net/zim/+question/280983
>
> Jayesh Badwaik posted a new comment:
> I'm sorry, I did not understand what you meant at first. You meant that
> a person will still enter the equation through an equation editor, which
> will then be displayed in the wiki as the image, but when being exported
> will be exported with the default MathJAX delimiter attached. There is
> nothing wrong with this.
>
> My original proposed setup was different, and if that is not acceptable
> to you, then the above setup is completely fine. However, what I wanted
> to do was to introduce a "verbatim" block plugin. And all the text which
> is inside that block will be transferred as it is to HTML.
>
> This has two advantages:
> 1. While MathJAX does have a default delimiter, I frequently use other
> delimiters because they serve different purpose, which are not satisfied by
> "\[ \]" in some cases.
> 2. Typing it out in the the wiki itself is much more comfortable for me,
> even if the text is not converted to image of equation,
> since I'm pretty comfortable reading LaTeX, as might be with other
> people too, who are pretty comfortable reading/writing
> LaTeX.
>
> The disadvantage is that the equation is visible as an image in Wiki. I
> don't have any problems right now with it, and you can always develop
> code to detect the MathJaX limiters in the verbatim text, and then
> convert the text into image later, should somebody ask for it.
>
> --
> You received this question notification because you are an answer
> contact for Zim.
>

Revision history for this message
Jayesh Badwaik (d-cbuntuone-b) said :
#7

Okay, no problem then. I'm happy with your proposal too.

Can you help with this problem?

Provide an answer of your own, or ask Jayesh Badwaik for more information if necessary.

To post a message you must log in.