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

### preformarted text is partially annoying

• Email
• 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 (94) 5/6/2009 11:12:02 AM

See related articles to this posting

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 (94) 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 (94) 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 (94) 5/12/2009 10:24:02 AM

6 Replies
32 Views

Similar Articles

12/12/2013 4:21:54 AM
page loaded in 5482 ms. (0)

Similar Artilces:

Sheesh! A New Text Edit Annoyance
I received a Word document as an e-mail attachment. I saved it to my HD and then went to the Finder and selected Open With > TextEdit. When I tried to edit the text I got the following: "Are you sure you want to modify the document in place? Modifying the document in place might cause you to lose some of the original formatting. Would you like to duplicate the document first?" "Overwrite, Cancel, Duplicate" No s**t? You mean if I change the document it will be changed? Really? Thanks for that valuable tip. Perhaps I should sleep on it and decide if I really ...

Create Value Aliases in Query Based on partial text?
I have a table that contains the following type of informaiton: Name | Size | Etc myname1images | 15 GB | etc myname1text | 12 GB | etc myname1music | 3 GB | etc myname2images | 8 GB | etc myname2text | 4 GB | etc myname2music | 22 GB | etc What I want to produce is a query that will give me that information but like this: Project | Category | Size | etc myname1 | All Images | 15 GB | etc myname1 | All Text | 12 GB | etc myname1 | All Media | 3 GB | etc myname2 | All Images | 8 GB | etc myname2 | All Text | 4 GB | etc myname2 | All Media | 22 GB | etc Now the project name, I can get, beca...

Text from required text box to read-only text box
Hello, I am fairly new to JavaScript and its use in Acrobat Professional. My situation is this: I have a form with a text box field which is required for the user to enter his/her name. I would like the required text box to display the name in all caps. I also need the user's name to appear in a read-only text box later in the form, which I would like to have the first letter of the user's first, middle initial, and last names to be capitalized. I would also like to have all required fields on the form highlighted in yellow, but the highlighting not printed. Lastly, I would like the...

HTML Text and Photoshop Text
Hey Folks: I thought it best to do title text in photoshop and bring into my webpage for a better quality look. But, using Composer, the HTML looks pretty darn OK. Thoughts? Composer? what is that.. I would much prefer using Adobe Photoshp for text titles. Their effects are nice & customizable & with CS2, you can do more with that. "Raoul" <gaycat56@gmail.com> wrote in message news:1132628078.236760.142570@g44g2000cwa.googlegroups.com... > Hey Folks: > > I thought it best to do title text in photoshop and bring into my > webpage for a better quali...

Text IN an Image To Straight Text?
Hi. (I'm not sure where to ask this so I'm trying a few newsgroups) I have some .jpg's of text documents. Is there a utility which will work like OCR in a scanner, helping to convert the text WITHIN the image to straight text? I don't have a printer working at the moment, or I'd print the .jpg's and then scan them using OCR. (The format doesn't necessarily have to be .jpg) Thanks in advance for any help GP Yes, if the image is not to bad a pic (not much noise and all that). Try http://www.twocows.com/windows.html I know they have a couple of ocr programs s...

Text
Anyone know or have a third party software for Solidworks, that will create machineable text? I machine the text within SW all the time, just have to be careful which font you use. Maybe be more specific as to your issue? -- Brian Hokanson Starting Line Products Does anyone know how to add a tekst in a sketch with a font that does not have a double line but a single one. The text will be used by cam to engrave it. Actually the text needs to look like what I have typed here! The cam program just follows the single line. "Brian" <brianh.castrate.all.spammers@slp.cc>...

distinguish between binary text and regular text
How can I distinguish between binary text and regular text ? For example: I want to convert the value of SYSOT to hex values, and to keep the value of SYSOT1 the same. 01 SYSOT VALUE '^@^X^@^A^@^AA' PIC X(07). 01 SYSOT1 VALUE 'ABC' PIC X(07). zvika <zglickman@il.bphx.com> wrote in comp.lang.perl.misc: > How can I distinguish between binary text and regular text ? That distinction doesn't make much sense. All data is binary on a standard computer. Text is simply (binary) data intended to be decoded and rendered in form of cha...

Highlighting part of the text in a text box
Hi all, I've been struggling with this for days. How can I use javascript to high light a part of the text in a textbox or a textarea? OR if the user highlights a part of the text in a textbox or a textarea, how can I say which part of the text is highlighted? (ie: at what character the highlight starts and at what character the highlight ends). thanks in advance. Aria wrote: > if the user highlights a part of the text in a textbox or a textarea, > how can I say which part of the text is highlighted? (ie: at what > character the highlight starts and at what character the hig...

Insert text file in a text field ...
Hallo, I have 2 questions: 1) How can I insert a text file into a TEXT field of a table (by an sql instruction) ? 2) How can I insert a microsoft word file into a BLOB field of a table (by an sql instruction) ? Please, could you help me ? Thank you . Fab. On Thu, 18 Oct 2007 06:41:52 -0700, electric_r@yahoo.it wrote: > Hallo, > > I have 2 questions: > > 1) How can I insert a text file into a TEXT field of a table (by an > sql instruction) ? > > 2) How can I insert a microsoft word file into a BLOB field of a table > (by an sql instruction) ? > > Please,...

Newby: how to transform text into lines of text
Hello, I'va read a text file into variable "a" a=open('FicheroTexto.txt','r') a.read() "a" contains all the lines of the text separated by '\n' characters. Now, I want to work with each line separately, without the '\n' character. How can I get variable "b" as a list of such lines? Thank you for your help vsoler schrieb: > Hello, > > I'va read a text file into variable "a" > > a=open('FicheroTexto.txt','r') > a.read() > > "a" contains a...

Replacing text in a text file with VB6
Hi all, I'm trying to figure out how to replace text in a text file with a new string. The replace function seems to be the way to go, but I can't get it to work right. The program is a time clock for employees to punch in and out at a business. It uses ADOX for its database and creates a separate text file for each employee which the clock in and clock out timestamps are written to. The top 3 lines of each file containe 1. The employee's name, 2. His or her SSN, and 3. His or her employee number. If an employee's name or SSN changes, I have no problem updatin...

converting vertical text to horizontal text
I have file that contains text formated like horizontal H e B l i p P g e r m l P y a i b i n r s a i i t n n h e t i h s a e n m s r e w e l e a t r r i ! n g Does anyone have a good way to convert this to horizontal text like such below? Thanks. Big Pain in the rear! Help my brain is melting Perl is the answer I've search CPAN and found some Text modules to rotate the text, but I'm stuck trying to figure out how to read this text in. I'm thinking using unconstrainted 2D array. Thank you. -- I am not an Intel spokesperson...

Deselecting text in input text box
I have a text input box and I don't want the text to be selected either when the user tabs to the item or if the user clicks on it. Now the function below which I found from 2002 in the archive works fine for IE 6 but it works in neither Netscape 7 nor Firefox 1.0. I'm hoping some of you might have an alternative suggestion or insight for Netscape and Firefox. Code that works in IE6: function clearSelection () { if (document.selection) document.selection.empty(); else if (window.getSelection) window.getSelection().removeAllRanges(); } <input type="text" name=...

Pulling out lines of text from a text file
Hi everybody, I'm looking to write a Catalyst model to basically use a newline delimited database, so that each line of the text file corresponds to a datum. My question isn't about the module per se, but on smart algorithms to pull a single line of text from an arbitrary text file. I know the following would work: #!/usr/bin/perl use warnings; use strict; print "Enter a file\n"; my $file = <STDIN>; print "Enter a number\n"; my$number = <STDIN>; my @array; open FILE, "$file"; while (<FILE>) { push @array; } close FILE; print$a...

Click on a picture, insert text in a text box: how?
I'm trying to make a webpage do the following: I want a user to be able to click on a given image (there will be more than one image). Upon clicking a given image, characters specific to that image will be inserted into a textbox which is actually a text area. If the cursor is in the textbox/textarea then the characters are to be inserted at the cursor location. This means if the cursor is between some text then the characters need to be inserted in between the text exactly where the cursor is. If the cursor is not in the textbox/textarea then the characters need to be displaye...

How to display text messages in a scrolling text area?
To display text messages (as - for example - in a window with log messages) in a scrolling text area, there are several Swing components I am aware of: http://download.java.net/jdk7/docs/api/javax/swing/JTextArea.html http://download.java.net/jdk7/docs/api/javax/swing/JTextPane.html http://download.java.net/jdk7/docs/api/javax/swing/JEditorPane.html I might want to subclass one of them for my �log area�. While I only think of plain text output now, more features, such as different typefaces or text colors might come in handy later. I also might want to use one of them in teach...

Paste text across multiple text boxes
I've written a python program that analyzes some data. However, I would like to make it easier to input data from the user. Currently, I have nine text boxes arranged vertically, and the user types a number into each of the boxes. This can be a little tedious, so I've envisioned a way speed up the process. I would like the user to be able to copy a vertical list of data (from excel or notepad) and paste it into the first textbox on my program. When they do this, I want each number to go into its respective box (the first number into the first box, and so on). I'm using wx.TextCtrl...

Change the text of a 'Static Text'
Hello, I work now at a GUI in matlab. And I have the following code (function) for a Button Callback: function Button_Callback(hObject, eventdata, handles) set(handles.Status,'String','Busy!'); .... %.. some code that requires several seconds .... set(handles.Status,'String','Idle'); handles.Status is the handle for a StaticText control. What I want to do is to change the Text(Label) for the static text at the beginning (in "BUSY") and when everything is done to change it to "IDLE". My problem is that the Label/Text is changed only at t...

Firefox
I am able to set the iframe to design mode, but I cannot execute the following command document.frames['testiframe'].execCommand("bold",false,null); Usually I select text and click on a button which is supposed to execute the above command. This does not work. Is there a work around for this...? On Jan 11, 10:41 pm, deostroll <deostr...@gmail.com> wrote: > I am able to set the iframe to design mode, but I cannot execute the > following command > > document.frames['testiframe'].execCommand("bold",false,null); > > Usually I select te...

Add text to a field and keep the old text?
I know what I want to do, however I don't now how to do it, or if Im doing it right. Im running an update and I need to add text to a field and keep the text that was already their in order of "new text"+"old text". So I have this query I wrote, however as its a live db I cant chance the mistake. UPDATE users SET levels = 0, mbox = 0, notes = ? + notes WHERE subscription_id = ? LIMIT 1 * Question marks are converted via php to their values. Levi NVM I found what I needed. For anyone else you need CONCAT() On 12 Oct, 16:06, l3vi <ad...@madfrogproductions.c...