Search Comments and Ratings

go

   
Date File Comment by Comment Rating
23 Jun 2014 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@Yiang: Maybe try comment out the "upquote=true" statement in mcode.sty ...

Comment only
23 Jun 2014 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@Michael: Nope, read the listings package docs why.

Comment only
29 Apr 2014 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

Cheeky indeed. But good work! About time someone did this properly.

Comment only
14 Apr 2014 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@Ofelie: I suspect something with file and/or font encodings. Try this. Find this line in your local mcode.sty "{delta}{{\tiny$\Delta$}}1 % \Delta" and insert this below "{µ}{{$\mu$}}1 % \mu" (without the quotes of course). Does that help?

By the way, adding a "µ" to the mcode demo document half-works. While it doesn't seem to render on screen, it also doesn't break compilation...

Comment only
09 Apr 2014 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@Ofelie: "An error" is not very descriptive of the problem...

Comment only
09 Apr 2014 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@Sevada: Have a look at the documentation (top of the mcode.sty file), in particular the "useliterate" option.

Comment only
05 Nov 2013 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@JH: As I said many times before, please have a look at the listings documentation (type "texdoc listings" in a command prompt, or find it here: http://mirrors.ctan.org/macros/latex/contrib/listings/listings.pdf), Section 4.8 in particular.

Comment only
05 Nov 2013 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@Tony Almeida: Thanks for the pointer. The font size is static for each code block / inline code is static (it's set in the .sty file), so it doesn't change with context (such as in a footnote). As a remedy, I've updated the package for you to include a new \mcodefn{} command, which produces the inline code in footnotesize. Have a look at the mcode.sty for more details, in case you want to further adapt it for your particular application.

Comment only
05 Nov 2013 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@Alex: Not sure what your question is, but you can use this package for that purpose, provided you disable line numbering.

Comment only
08 Oct 2013 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

Hi Tintin, not sure what the issue is. Try using the demo file provided and work your way on from there...

Comment only
10 Sep 2013 Arrowhead arrowh draws a solid 2D arrow head into the current plot. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@Miguel - sorry I can't. But it's quite easy, I just plotted the analytical solution of a 2D ODE with complex eigenvalues using initial conditions placed on a circle...

Comment only
08 Sep 2013 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@Mike - automatic line breaking [especially with comments] is not supported by the listings package (which does the work under the hood). You unfortunately have to do that manually...

Comment only
14 Aug 2013 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ Jean: Have a look at the listings documentation (type "texdoc listings" in a command prompt, or find it here: http://mirrors.ctan.org/macros/latex/contrib/listings/listings.pdf), Section 4.4 in particular and the "linerange" option.

Comment only
12 Jul 2013 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

Well, I'm an Apple Macintosh user and like TeXShop, but I'm not sure if the editor itself has anything to do with it.

I would try to compile the demo document that comes with the package first, and take it from there. Oftentimes it's simply a clashing between packages.

Comment only
09 Jul 2013 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@Alon: Sorry, but I cannot help you with BaKoMa TeX. LaTeX just isn't made for WYSIWYG, you're better off using the more traditional approach to this wonderful typesetting system.

Comment only
29 May 2013 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

Hi Bob,

That means there's still something wrong with your TeX installation (textcomp requires more than just a .sty file chucked in the same path).

If you can't get it working, you can also disable it, by removing / commenting out the following in mcode.sty:

\ifx\textquotesingle\undefined%
\RequirePackage{textcomp}%
\fi

as well as

upquote=true, % upright quotes

Comment only
09 Apr 2013 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ kevin: Strange, I haven't observed this behaviour. Can you email me a minimal working example that reproduces the problem?

Comment only
06 Feb 2013 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ Jon: Yeah, there's something wrong with your LaTeX installation. In particular, you are missing the "pcr" font (that's the Courier font used by the package to display stuff in monospaced font, similar to Matlab...).

Comment only
26 Oct 2012 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

Thanks @Eric. I've had a look at getting the slim line working. Half got there using this "literate programming" string:

{\%\%}{{{\color[gray]{.85}{\makebox[0em][l]{\raisebox{2ex}[0pt][0pt]{\rule{\linewidth}{.4pt}}}}}\%\%}}{2}

Problem: Cell comment (%%) must begin on the beginning of the line, but worse: the remainder of the line no longer gets printed in green. Not sure how you can use the "literate programming" feature but still trigger the comment-formatting...

Comment only
30 Aug 2012 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@Juan: Not sure why you are having this issue. The package should load the textcomp package in case \textquotesingle is not defined already. Try manually including the textcomp package before loading mcode to see if that helps...

Comment only
30 Apr 2012 EzyFit 2.42 A free curve fitting toolbox for Matlab Author: Frederic Moisy

Frederic Moisy (view profile)

Florian Knorn

Florian Knorn (view profile)

Oh, just one question. Maybe it's just me, but I can figure out a way to use constants in an Ezfit FUN expression. Sure, I could use subs to replace known variables by their numerical values before using ezfit, but it would be very handy, in particular for scripting, if you could tell ezfit which variables *not* to consider unknown but rather use the currently assigned value for...

Comment only
30 Apr 2012 EzyFit 2.42 A free curve fitting toolbox for Matlab Author: Frederic Moisy

Frederic Moisy (view profile)

Florian Knorn

Florian Knorn (view profile)

Very useful, as good as an "original" Matlab toolbox. Frédéric, you really should put a PayPal donation button on your page for me and other people to click! Your work and efforts very much deserve it.

5
14 Apr 2012 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@Mikkel, Sorry, not quite sure what you mean. Why would you want to break a path (?)

Comment only
26 Mar 2012 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@Adam: Thanks! That's exactly what I designed it for. Quick and easy deployment. Save other people the hassle of tweaking the listings package's settings.

Comment only
20 Mar 2012 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@Dan: Try replacing the command defining the default font to be used by something like this:

\def\lstbasicfont{\fontfamily{pcr}\fontsize{8}{8}\selectfont}

In the \fontsize command, the first number is the fontsize and the second is the line spacing (roughly speaking), so play around with the numbers a bit until you like the result.

It appears, however, that some number combinations don't play nicely with framed listings. I don't know why this is the case; this is an issue with the listings package.

Comment only
15 Feb 2012 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

Hi there, can't investigate this right now, but to remove this feature just uncomment line 228 of the current version (2.2) of mcode.sty.

Comment only
24 Nov 2011 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@Maxi: You can indeed do this provided you use the original command provided by the listings package. So have a look at the .sty how the \mcode command is defined. Basically, in your example, instead of using \mcode, use this:

\lstinline[basicstyle=\lstbasicfont\small]|Test={'hans' 'peter'}|

Comment only
17 Nov 2011 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ Axel: Sorry, still not sure I understand your question. Can you email me directly? Thanks.

Comment only
16 Nov 2011 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ Axel: Thanks for your kind words. Have a look at the demo-document included in the package. It shows quite clearly how you can get LaTeX to parse fancy stuff in your comments.

Comment only
12 Oct 2011 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ Niko: Again, my package isn't doing any work, it just configures the listings package for you. Anyway, I just had a look at the listings documentation for you. I didn't see an option for this directly, but what you can do is add in your case firstnumber=6 to the \lstinputlisting options to have the numbering start with 6. This will do what you want.

Comment only
13 Sep 2011 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ Oscar -- sorry to disappoint you, but the listings package doesn't handle unicode, as far as I know.

Comment only
10 Aug 2011 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ Emil: Comment out Line 229.

Comment only
02 May 2011 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@Sweidan: So far no; might look into it one day, but have no time for that right now, sorry!

Comment only
15 Mar 2011 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ Petr: Thanks for the hint. I could have seen this earlier ;-) Anyway, just revised the package to include this (check documentation).

Comment only
02 Dec 2010 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ David: Sorry, try to install the listings package properly; the package requires more than just the .sty file as far as I know...

Comment only
01 Dec 2010 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ Nick: Ok, figured it out -- your m-file needs to be in UTF-8 encoding for some reason (the one you sent me was Windows Latin 1). Not 100% sure why this makes a difference (but I suspect it has to do with the way the section sign § is encoded), but this will fix it for you. As an alternative, you could try to use a different math-escape character.

Comment only
01 Dec 2010 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

Hm, looks like you do have the most recent version of listings. I've just tried it myself with the demo document, including some external .m file with § \LaTeX § in it and it works fine...

Have you tried including just a very simple m-file? Do you still get the same problem?

It's hard to debug things this way, maybe you can throw together a minimal non-working example so I can see for myself...

Comment only
01 Dec 2010 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ Nick: Hm, works find for me... What version of the listings package are you using (try "texdoc listings" in a command line)

Comment only
25 Oct 2010 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ Zhenyu -- glad you like the package. Replacing "delta" by "Δ" is actually intentional. But If you don't want that, simply remove the line "{delta}{{\tiny$\Delta$}}1% \Delta" from the file.

Comment only
13 Sep 2010 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ Ken H — thanks for your positive comment. I've had a look at your problem, but I can't reproduce it. Using my demo document (see link at the top), leaving mathescape=false as set by default in the document and including the tipa package, I can simply type §\textpipe§ to get the pipe showing up just fine. Not sure why this is not working for you... Try with the demo document, as this is a very barebones document. If it works there, but doesn't with your document, then it's almost sureley some package clash...

Comment only
08 Sep 2010 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ Thomas — There's no difference between the operating systems. The easiest way would be to just put it in the same path as your .tex file . . .

Comment only
23 Aug 2010 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ Ariel — How the heck can I know which keyboard you are using? That § symbol is called "Section Sign" (http://en.wikipedia.org/wiki/Section_sign) and on my Mac Keyboard (US layout) I can get it by pressing Alt + 6

Comment only
01 Jun 2010 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ Fritz: Sorry, as far as I know the listings package doesn't support automatic line wrapping... This means, you'll have to manuall edit your code to make it fit into your code "box" (for me that's about 78 characters for instance). A little tip: Over in the MATLAB editor you can set a character per line number after which you can have stuff automatically wrapped, or you can wrap things manually but use the vertical line it produces in the editor as a guide...

Comment only
12 Apr 2010 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ durg ch: Please see the file description above, at the end of it is a download link to a small demo document (including LaTeX sources) where you can see how the package is used . . .

Comment only
17 Jan 2010 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

Hi Viktor, I don't think the listings package has that feature, sorry ...

I don't know how exactly you have to specify the path on Windows systems, but I always thought Windows uses backslashes ( \ ) in the path names, not forward slashes ... Could that be the problem?

Otherwise, I can't really help you, sorry ! Maybe ask the developers of the listings package ...

Comment only
14 Jan 2010 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

Updated the demo document.

@ Rasmus: I've shuffeled things around a little bit in the source code, and added a description to make it really clear how to change the font size.

@ turker: I've modified the "solution" to the end/end problem; you can now use "iend" in the source code to get "end" typeset in black (when used to reference the last element in vector...)

@ All: If you use the LaTeX escape functionality in comments, there's now an easy way of getting that typeset in the same style as the rest of the comment, see the demo document ...

Comment only
10 Dec 2009 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ Cat: Replace the "\footnotesize" in that line by "\tiny". That's as small as it gets with standard fontsize commands. If you need even smaller fontsize, you'll need to remove this "\footnotesize" and replace the first line in the Config-Section with something like "\def\lstbasicfont{\fontfamily{pcr}\fontsize{3}{4.6}\selectfont}"...

Comment only
24 Nov 2009 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ Lagrange: I've used the package in the appendix many times and it works fine. I suspect (because of the upquote error message) that you have a slightly outdated version of the listings package installed. Make sure you have the latest version.

@ Daniel: I know, I know, I'd love to have this fixed too, but such functionality appears to be quite unique to the Matlab scripting language, and the listings package (which does all the work) does not support such behaviour. I've mailed the package maintainer already, but he never got back to me...

Comment only
20 Aug 2009 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

@ Alvin: Sorry, I never got the error you have. But thanks for pointing out a work-around, for those that do not have a "proper" TeX installation, including all fonts and map-files. You're right, the 'textcomp' package is only there for the upquotes. The idea of using that comes straight from the listings documentention (Section 4.7).

@ turker: Thank you very much for sharing your work-around for the 'end'-issue. While it's not too sleek, it works very well! Unfortunately there's little I can do to fix this in a more elegant way. As I said many times, the actual work is done by the listings pacakge, and as far as I can see it doesn't support different colouring of the same keyword...

Comment only
06 Apr 2009 M-code LaTeX Package Easily include nicely syntax highlighted m-code in your LaTeX documents. Author: Florian Knorn

Florian Knorn (view profile)

Florian Knorn

Florian Knorn (view profile)

Sorry Andrew, that feature would have to be provided by the listings package...

Comment only

Contact us