For my Master Thesis I am writing a Latex document where I must put all the research I do. This document is reviewed periodically by my thesis advisors once or twice per month. Since this is a big document I'd like to automatically highlight what's new in the document since the last revision same way like Word or Openoffice do.
So my question is, given that I have a Latex document controlled by Subversion, what is the best way to create a pdf highlighting the differences between the HEAD and a previous version?
Say that I want:
New text in a red coloured font
New images and tables with a light red background
Deleted text marked as a footnote or something similar
If not all are possible, which ones could be implemented?
Thanks.
Check out latexdiff. It is much better than simple diff programs because it understands LaTeX and won't mark changes that are simply extra spaces, or reformatted lines in the tex file.
There are several packages which could manage revisions. I'd like to use some version control system like git to manage and show changes.
You could use a diff program. I recommend DiffMerge from Source Forge.
i like wdiff. available on an *nix platform.
you can use
wdiff -w "\fbox{" -x "}" -y "\fbox{\fbox{" -z "}}" ...
I created revdiff to build diff versions of my papers before sending them to reviewers. They have told me several times that the result was really helpfull. Hope it can be useful for you.
Find it here: http://pedromateo.github.io/revdiff-LaTeX/
Related
I've used Sphinx to document a Python library. So far this works great, I get nice HTML and LaTeX output. Concerning Latex, Sphinx generates a complete standalone document with lots of special packages and configurations.
But, I would like to integrate the generated Latex files within an already existing Latex project (more precise: in the appendix of a book). In particular I want the Sphinx-generated documentation pages to have the header, footer and section heading styles of the parent document. I guess I could somehow transfer the relevant parts by manually removing unneeded stuff and adjusting various options in the tex files generated by Sphinx. However, probably this is going to be a very tedious fiddling taking too much of my time (thinking of conflicting packages and options I have to detect and fix).
Does Sphinx' Latex-Builder support such a use case? If not, is there a more general approach how to merge independent Latex-documents?
Thanks for any hints!
It seems there is no generally valid answer to this question. I've asked this question on the sphinx mailing list and received an answer which basically says one has to manually extract and partly convert the relevant parts of the latex code generated by sphinx - a less expensive solution does not yet exist.
What is the best way to print - syntax colored and well formatted - code from Pharo/Squeak on paper?
1) Is there a way to print directly from within Pharo/Squeak? (i use it on macosx)
2) Is there a way to export syntax colored, well formatted code from Pharo/Squak?
3) Are there external tools to color and format a filed out piece of code?
For the appendix in my master thesis I used the Pier CMS-to-LaTeX converter in the Pier-Documentation package. However, this plugin only takes class comments and method comments into consideration, it does not print the source code. Pier also provides a package ShoutPier for syntax highlighting of Smalltalk code, so I guess it would require little work to bring the two together. You can find the mentioned extension packages in http://source.lukas-renggli.ch/pieraddons.html.
Pharo browsers seem to use syntax highlighting.
What difficulty are you having reading Smalltalk code using the browsers and senders/implementors ?
Edit: Would something that produces UML give the overview you're looking for? The Dandelion website only shows downloads for old Squeak versions - I don't know if they would work with Pharo.
And perhaps this GSoC project "Generate UML diagrams from Smalltalk code for Pharo" suggests not.
Here's how I did it on my Mac, I think this should work on other platforms too.
Save your categories to a Monticello local folder on your disk -- see the Pharo manual on how to do this: http://book.pharo-project.org/book/PharoTools/Monticello/?_s=hdGOLc_FXsvVY1iR&_k=YYH-Ln8f5mtWZ8z2&_n&148
Browse to this folder, and unzip the .mcz file
You'll see all your code in snapshot/source.st file
You'll need to edit this a bit, to remove the ! characters for e.g., there might be a tool to do this?
-Eric.
There is webdoc project, which allows you navigating code in web browser:
http://ss3.gemstone.com/ss/webdoc.html
(and of course you can print code from your favorite web browser)..
1) Install shout from www.squeaksource.com
2) I don't know. May be you can customize shout.
3) In gnu-smalltalk you have a smalltalk mode for emacs. But I am not pretty sure to understand what you are looking for.
I do Ruby on Rails development pretty much exclusively. I currently develop in OS X using TextMate. I have a virtual machine running to emulate as closely as possible the environment my app will be deployed into, and I mount the code on a Samba share into OS X from the VM guest. From there I open with TextMate and code away.
I'm beginning to think that with the proper plugins and time spent learning, I could be much more productive in vim directly on the VM. Right now my TextMate is basically stock, though I do find the ProjectPlus plugin indispensable. What I'm looking for are some suggestions of vim resources and plugins (if that's the right terminology) to closely emulate the features I am unwilling to give up in TextMate. Or at least, compelling reasons why I should be willing to give them up. Here's a short list:
Ability to have a (preferably) collapsible project tree visible either at all times or easily toggle-able.
Ability to see SCM status at a glance, either within this project tree (preferable) or otherwise. (I use git almost exclusively if this makes any difference.)
Being able to view a side-by-side diff from within vim would be great too
Ability to search through the entire project at will (I suppose :stop; grep -nr; fg; would accomplish this, unless there's a better way to do it.)
Code completion, if possible
The NERD Tree plugin gives you a collapsible project tree. Personally, I find that the netrw plugin is more than sufficient, and this usually comes installed with Vim. Whereas the NERD tree feels as though it tries to emulate the behaviour of other IDEs (and TextMate's project drawer), I feel that the netrw plugin does things the Vim way. I suggest you try both out, and see which one you prefer.
The fugitive plugin provides a git interface to Vim (See Vimcasts: parts 1, 2, 3, 4 and 5).
The ack plugin is great for searching an entire project. You'll want to read up on Vim's quickfix list to get the most out of this.
TextMate's word completion is triggered with esc, and shift-esc. In Vim, you get similar autocomplete functionality using ctrl-n and ctrl-p in insert mode. Check :help ins-completion for (much!) more info.
I am running a series of screencasts about learning Vim over at vimcasts.org. My background is with TextMate, but I've been using Vim fulltime for a while now. As I write this, I'm only 6 episodes in, but I do plan on covering each of the points you've raised in future episodes. I'll try and come back to edit this answer with links to the screencasts as they become available.
And snipMate : TextMate-style snippets for Vim
I'm currently in a similar position to you (moving from TextMate to Vim)
One really good resource is this:
http://robots.thoughtbot.com/post/166073596/intro-rails-vim
Good luck with it!
For file navigation is simply love CommandT
This functions very much the same as the beloved commandT function in textmate.
You might want to start with my Ruby/Rails related vimfiles which includes support for rvm and git.
This screencast is great as well http://blip.tv/file/1372096
I do use VIM and i specially like how to rotate from model/view and controller related..
Check out the blog post: From Textmate to VIM for Rails coders.
The comments there may also valuable for you.
All of the other answers plus:
Ability to have a (preferably) collapsible project tree visible either at all times or easily toggle-able.
The project.vim plugin doesn't really work like TextMate's Project drawer but it's close.
With NERDTree, you can setup bookmarks and make it work a little like a project drawer.
:help mkview and :help mksession can help, too.
Ability to see SCM status at a glance, either within this project tree (preferable) or otherwise. (I use git almost exclusively if this makes any difference.)
vcscommand.vim provides the same set of commands for multiple SCMs, it works with Git, SVN, Mercurial…
You can use the aforementioned fugitive plugin to display the Git status in the status line, :help fugitive-statusline.
Being able to view a side-by-side diff from within vim would be great too
fugitive provides the :Gdiff command that does just that.
A recently released plugin called Gitv tries to emulate GitK in Vim. I like it a lot and the author is very responsive. In the tree view, hit <CR> to open a previous commit in another window and D to see a double diff.
Code completion, if possible
There are a few solutions, if you don't need it to be automatic <C-x><C-o>, <C-n> and <C-p> will be more than enough, if you want "autocompletion" you may try these few plugins. My favorite is autocomplpop.
Search an entire project here.
Code completion: Normally done with ctrl-X then ctrl-O while in insert mode.
Git Integration: git.vim
Project Tree: Nerdtree.vim
Good luck
I published an extended post on this topic today, in which I explain how to replicate 100 features from Textmate within VIM. It's the product of a great deal of hours research.
For example I explain:
How to replicate a Project Drawer
How to manage tabs
How to do Rails specific commands (Lets face it: A lot of Textmate users are Rails programmers)
How to do find and replaces
How to do project wide searches
Read Original Article: Textmate To VIM
I currently work in the position of Data Warehouse programmer and as such have to put numerous flat files through ETL process. Of course prior to loading the file I have to be aware of its content, the problem is that majority of the files are > 1 GB large and I can not open them using my dear old friend "notepad". Kidding. I usually use VIM or Notepad++ but it still takes a while to open the file. Could I perform a "partial" read of the file using VIM or some other editor?
P.S. I know that I could write a 10 liner script to "data sample" the file, but it would be simpler to convince team members to use a feature of an editor than a script that I wrote.
Thank you for any insight you might have.
If you want to stick with using vim, you could have a look at the LargeFile script.
Alternatively, I've always found that UltraEdit opens large files extremely quickly.
You said you had VIM, that makes me wonder if you have a unix environment as well?
If you like, you can pipe the input through unix utility top and display the raw imput on your screen. Like this:
EDIT: (thanks Honk)
terminal$> head -N 15 file.csv
(Where that 15 indicates you want to see 15 lines only).
Pretty sure there are loads of similar questions, but hey, Textpad is a good choice for this.
use the head command.
Use the 'less' on solaris ... use the same through cygwin on windows. On mainframes this problem doesn't appear, ISPF editor handles it pretty well.
UltraEdit claims to handle files over 4GB...
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 months ago.
Improve this question
I have occasion to need to print code (Horrors!!! ;) ), and i was wondering what editor or tool would i use to print that code out with proper formatting and syntax highlighting? If it's important, it will be c# code but ideally the tool will work for as many languages as possible. Can Notepad++ or something handle this?
You can use Vim! It's probably installed already if you're on modern Linux/MacOS and an easy install if not.
:syntax will turn syntax highlighting on and :hardcopy will print it. There's syntax highlighting definitions for many languages out there. The default look is usually optimised for screen display, but you can fix that.
Simply open the file on command line with vim <filename>, type :syntax on<ENTER>, then :hardcopy<ENTER> to print it. Quit Vim with :q!<ENTER>.
There's also the :TOhtml command which will open the current selection as HTML in a new Vim window. Capture the entire document with :%y<ENTER> followed by :TOhtml<ENTER> to open it.
Yes, Notepad++ can certainly print code with syntax highlighting.
Colour printing would obviously be preferable, but on the occasions when I've printed in black and white, the subtle differences in colour [rendered as shades of grey, of course] can be difficult to distinguish.
However, I think a little customisation of the colour schemes should make this less of a problem.
New Answer:
Use TextMate. It prints colored code automatically. There's no setup. Just print. In case previous or newer versions can't do this I'm using TextMate version 2.0.23
Old Answer, and the answer for people who don't have Macs:
Use vim. Its the easiest method to do it in my experience by far, that is, once you know how.
Vim comes pre-installed on Macs, btw. And I know how you special people like colors, so I'm going to make this impatientbusinessman-proof for the benefit of all.
1.) open file
vim filename.m
2.) enable syntax coloration (mine did not have enabled by default)
:syntax on
3.) print
:hardcopy
Vim will choose your system's default printer without asking you so make sure you set that up first.
4.) exit the program (this is actually not a given)
:q
http://pygments.org/ is one option. It supports a ton of languages, and since it's written as a python library, you can script the conversion process however you want.
Visual Studio will, and allows you have a completely separate configuration for printing.
I recently compared the 2 solutions already mentioned : vim & pygments. They both give great results, but there is how you can practically use them quickly:
pygments does not provide direct export to PDF. Hence, the simplest solution I found was to export to HTML and then use wkhtmltopdf. You can combine both operations using the following bash script:
src2pdf () {
local noext="${1%.*}"
pygmentize -O full -o "$noext.html" "$1"
# enabling line wrapping in <pre> blocks
perl -i -wpe '/<style.*>$/&&($_.="pre{white-space:pre-wrap;}\n")' "$noext.html"
wkhtmltopdf "$noext.html" "$noext.pdf"
rm "$noext.html"
}
for vim, it's as simple as this: TERM=xterm-256color vim '+hardcopy >out.ps' +q code.src
I found out that the $TERM environment variable can affect the output colors, so I prefer to set it explicitly.
And finally, you may need to tweak your .vimrc a little:
set printfont=:h9
set printoptions=number:y,left:5pc
The tool called enscript is very much the tool for doing this. It is very powerful, is not tied to an editor nor a language and you can create PDF's with syntax highlighting.
The documentation pretty much says it all.
enscript man page
Under unix you might want to try a2ps. It is flexible and produces nice results.
I while ago I created a household python script that wraps pygments into a small console utility. It works with any language supported by pygments.
Also if you happen to use eclipse, you could simply copy the selected text in the editor and then paste it in a RTF-aware editor like MS Word - it will preserve all the colors, fonts and formatting.
If you have problems with Visual Studio 2012 concerning the highlighted printing an handeling the described problem:
Download and install this Power Tool which implements the color
printing, besides some other features and bug fixes. Works for me!
Solution For Bash Shell
Add this line to ~/.bashrc if you are using UBUNTU
or, to ~/.bash_profile if you are using MAC
If that file does not exists, create it.
alias lprc='vim -me -c ":syntax on" -c ":hardcopy" -c ":q"'
source ~/.bashrc or source ~/.bash_profile
To print colored hello.py just do this:
lprc hello.py instead of lpr hello.py
Use ConTEXT programming editor (which is free). I am using it for both generating .pdf-s with syntax highlighted source code and printing to paper.
There are many ConTEXT syntax highlihting definitions to download and you can make your own highligher file which will BTW be highlighted using the ConTEXT Highlighter Files highlighter definition.
I do it downloading js and css files from
https://prismjs.com/
There are so many 5-7 options to select the theme and language highlighter. Once you select a theme and download the tiny js/css files the next thing you need to do is rename the code file to html, and call the css/js files. Open the html in a browser and print it. Done!
You can also use this in case you've to print with bnw syntax highlighting https://github.com/SGI-CAPP-AT2/code-highlight-n-print