COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### preformarted text is partially annoying

• Follow

Hello

in order to make my point clear let me denote a blank by _

so if the matlab .m file contains a line
%%
%_text here
that will lead in case convert to latex to
\begin{par}
text here
\end{par} \vspace{1em}
which is fine.
Observation in the matlab build in editor there is no menu entry for this sort of text, there is italics, bold etc but no NORMAL text. Could such a menu entry be added please.

Now to the problem:
%%
%__text here

\begin{verbatim}text here\end{verbatim}
which I find annoying because
1 missing newline: that is this code should be
\begin{verbatim}
text here
\end{verbatim}
2 more important I don't see why this should be verbatim. I would prefer the par env as above.

Can I change that in the relevant xsl file?

Uwe Brauer

 0
Reply oub (83) 5/6/2009 11:12:02 AM

I'll take a look your suggestion to add this to the menu and at #1 These sound reasonable.

With respect to #2, I'm looking for basically the LaTeX equivalent of <pre>.  "verbatim" isn't the right markup?  I'm not a LaTeX master, so guidance is welcome.

"Uwe Brauer" <oub@mat.ucm.es> wrote in message <gtrra2$1q3$1@fred.mathworks.com>...
> Hello
>
> in order to make my point clear let me denote a blank by _
>
> so if the matlab .m file contains a line
> %%
> %_text here
> that will lead in case convert to latex to
> \begin{par}
> text here
> \end{par} \vspace{1em}
> which is fine.
> Observation in the matlab build in editor there is no menu entry for this sort of text, there is italics, bold etc but no NORMAL text. Could such a menu entry be added please.
>
> Now to the problem:
> %%
> %__text here
>
> \begin{verbatim}text here\end{verbatim}
> which I find annoying because
>  1 missing newline: that is this code should be
> \begin{verbatim}
> text here
> \end{verbatim}
> 2 more important I don't see why this should be verbatim. I would prefer the par env as above.
>
> Can I change that in the relevant xsl file?
>
> Uwe Brauer

 0
Reply matthew9249 (239) 5/6/2009 3:56:02 PM

"Matthew Simoneau" <matthew@mathworks.com> wrote in message <gtsbui$l1u$1@fred.mathworks.com>...

> These sound reasonable.
are you also considering to add newlines.

>
> With respect to #2, I'm looking for basically the LaTeX equivalent
> of <pre>.  "verbatim" isn't the right markup?  I'm not a LaTeX
> master, so guidance is welcome.

Well as I said in earlier mails lstlisting would be a candidate. But
what I am asking is this:
why do you want to have
%__text
translated to <pre>?

If this is really a feature a lot of people desire I am not going to
argue about it. But how can I change that individually for me?

Uwe

 0
Reply oub (83) 5/7/2009 10:33:02 AM

Oh, you don't like the Wiki-like behavior of interpreting spaces at the beginning of the line as preformatted text.  No, there's no way to override this behavior.  What problem are you trying to solve?

 0
Reply matthew9249 (239) 5/7/2009 5:47:02 PM

"Matthew Simoneau" <matthew@mathworks.com> wrote in message <gtv6qm$11u$1@fred.mathworks.com>...
> Oh, you don't like the Wiki-like behavior of interpreting spaces at
> the beginning of the line as preformatted text.  No, there's no way
> to override this behavior.  What problem are you trying to solve?

Right I rather hate it. It might be useful in a case where your
language (wiki) has little structure elements and in the internal
editor is rather poor.

But in the case we are discussing this is NOT the case, Latex has a
rich structure and there are more than a dozen decent editors which ease
the joy of writing latex documents.

In my concrete case, the behavior you have chosen to implement is a
nightmare. My students have to submit their work with structured
commands. Now since there is NO insert simple latex comment like
%%
%_text here
%
as we already discussed the students write
%%
%__text here
%
or
%%
%___text here
%
since this is in spanish there are latin-1 chars which in the verbatim
environment just looks *awful* so I have to change manually part of
the verbatim {command} to say {par} which brings me back to a
question:

Why do you have implemented it this way.

What is the rational behind it.

I am really curious.

Uwe

 0
Reply oub (83) 5/9/2009 5:29:01 PM

We wanted to keep the MATLAB code readable in its unpublished form, so we adopted some conventions along these lines.  For example, you need to start a list at the beginning of a "paragraph" to help distinguish it from bold:

%%
% This is
% *bold*.

%%
% This is:
%
% * A list

Using multiple spaces to specify preformatted text maps naturally to situations like this:

%%
%  One
%   Two
%    Three

The drawback is that the particulars of the formatting aren't obvious from the raw code.

 0
Reply matthew9249 (239) 5/12/2009 12:14:02 AM

"Matthew Simoneau" <matthew@mathworks.com> wrote in message <guaf0a$ls4$1@fred.mathworks.com>...
> We wanted to keep the MATLAB code readable in its unpublished form, so we adopted some conventions along these lines.  For example, you need to start a list at the beginning of a "paragraph" to help distinguish it from bold:
>
> %%
> % This is
> % *bold*.
>
> %%
> % This is:
> %
> % * A list
>
> Using multiple spaces to specify preformatted text maps naturally to situations like this:
>
> %%
> %  One
> %   Two
> %    Three
>
> The drawback is that the particulars of the formatting aren't obvious from the raw code.

I am sorry but I don't see the argument  behind it.
to have structure like
%%
% text
makes perfectly sense
to have
%%
% *bold*
as well, etc etc, because they use different structures, but space  has no structure
in MARK-UP languages like latex. So what do you gain by distinguishing (when you translate)
> %%
> %  One
> %   Two
> %    Three

from
> %%
> %  One
> %  Two
> %  Three

why can't these two structures be translated identically??

Uwe

 0
Reply oub (83) 5/12/2009 10:24:02 AM

6 Replies
22 Views