When creating (Impress) presentations containing source code snippets, what is the best way of including these snippets in the presentation? If possible, I would like them to be rendered with a fixed-width font and appropriate syntax coloring.
An obvious answer would be to embed a screen captures from a code editor, but this causes problems when showing the presentation on projectors with varying screen resolutions. Maybe it's possible to create a vector graphics image that will scale properly, or even render the code with some macros to provide proper formatting and coloring instead? Do any tools for processing source code in this way exist?
Not sure how Open Office works but I'd imagine it's capable of rendering HTML. If I wish to copy some source code to a blog post, I usually find a tool that allows me to copy the source code as HTML. I suspect this would also work for Open Office.
I think this is what I use for Visual Studio.
Related
I have to write a report using LaTeX for my final year project at university. Having been given some example documents to learn to use it, a common command, \summary, keeps appearing. However, what's written inside the summary doesn't appear anywhere in the produced document. Is it some kind of internal documentation?
With a quick google, it is likely that /summary is used as a shortcut to reuse the abstract in one place.
Looking at a few templates : ucl thesis template, book template and stackoverflow it tends to be a custom command used for repeated style. Look through the different files for "summary" to see if appears in the preamble somewhere.
I am trying to use two different textareas displaying the same code, but with one master, and another copy. In the copy textarea, I would like to highlight changes, something similar to what GitHub offers when we do some changes.
I was wondering if this is possible or if someone did something similar before. Any advice is welcome.
The CodeMirror Merge add-on is exactly what you want. See the demo, which matches your description.
At first I thought you wanted a separate diff, displayed in a div below your textareas rather than inside one of the textareas, and I wrote the following answer. It may still be useful.
Check out the google-diff-match-patch library, used by the CodeMirror Merge add-on. It’s not a drop-in solution, but it looks like you could use diff_main to get a list of original and changed text, and then display that yourself. The library also provides diff_prettyHtml, which outputs example markup for the diff.
Mergely is another option that produces very nice visual diffs using CodeMirror and is distributed under the GPL, LGPL and MPL licenses. It's GitHub repo is here.
Also Prettydiff which isn't very pretty, but when you click the "execute" button at the bottom you get an interesting visual diff. Not sure if the diff itself is using codemirror or just the two input texts that the diff is generated from.
For a school project i need to write or use a online programming editor. It is a part of a bigger project. I thought of a java application, php/html/javascript or flash.
I have a couple of things i could do:
Find a good working application and edit it so it works with the rest of the project
Find good parts for a editor and make it working my self (syntax highlighter, auto-indent, autocompletion, etc.)
Combination of those two
Does anybody know a good editor or have tips for this project or a editor?
Thanks for reading,
Leon
For the syntax highlighting and basic editing part, check out my recent question Textarea that can do syntax highlighting on the fly?
Solutions presented there:
CodeMirror
Bespin (Mozilla only, but great)
For the rest - autocompletion etc. - ... Check out the Wikipedia article Comparison of JavaScript-based source code editors
Interested to see what other suggestions come up.
Bespin comes to mind. Though it might be too bleeding edge, depending on how the rest of the project is built/meant to be used (but hey, programmers love bleeding edge).
If you decide to use PHP/HTML/CSS/JavaScript, see GeSHi for syntax highlighting.
I have a side project developed with ACE.
It connects to your server through SFTP and allows you to create new files,read and edit all from your browser with your file tree at sidebar.
Demo at TePe
Code at Github Repo
I found Cobalah Editor it's also built on CodeMirror but with some customization. There are some themes available we can set, increase or decrease font size.
I'm running on an Ubuntu and I hope it doesn't matter. Either than the preview it's a great latex editor
Considering the Texlipse man page mentions building and previewing, I do not think it can make a real-time preview, especially when the previewing relies on external tool.
But you could associate that Texlipse editor with other tools able to read the same LaTeX definition file and make a real time preview, like in this question:
Real-Time LaTeX
I think you're looking for the "Previewing" section on this manual page. When I glanced over it though, it didn't look like there is necessarily a way to do a live preview. It is an open source project, so if you really need to scratch that itch there's a way. :)
does anyone know how to add "change markers" functionality to SynEdit? I mean those lines, green for modified & saved, yellow for modified & unsaved parts of document... here is an example from other editor: http://img222.imageshack.us/img222/6474/editori.jpg
Yes, I've added it to my copy of SynEdit. I originally snagged the code from another project.
It is broken across (at least) two different units IIRC.
You need to modify SynEditTextBuffer.pas as well as SynEdit.pas.
The code is rather complex because you need to modify several spots in SynEditTextBuffer.pas as well as 1 or 2 spots in SynEdit.pas.
The original project I snagged the code from was being very ambitious in that they were trying to develop code folding and line blocking (as shown in your image) as well.
I couldn't get the code folding to work reliably so I dropped that mod and just used the line change code. I believe that dropping the code folding also dropped the line blocking.
The name of that project is SynEditSudio, it from a Chinese website, but I believe the Firefox translator plugins work pretty well in converting it.
EDIT: contact me directly if you want to get a copy of my changes.
HTH
Ryan.