Hi,
This fairly simple change does exactly what I want- preserves the current
rotation on a file refresh. It takes the rotation of the current page and
applies that rotation to all pages of the refreshed document- if you have
documents with different applied rotations for individual pages then this
won't be right (but could be easily fixed). The cost is quite trivial and
shouldn't cause any interference with the current behaviour- but perhaps it
could be hidden in a new preference.
regards,
Index: SKMainWindowController.m
===================================================================
--- SKMainWindowController.m (revision 7057)
+++ SKMainWindowController.m (working copy)
@@ -751,9 +751,11 @@
NSRect visibleRect = NSZeroRect, secondaryVisibleRect = NSZeroRect;
NSArray *snapshotDicts = nil;
NSDictionary *openState = nil;
+ NSInteger rotation = NSNotFound;
if ([pdfView document]) {
pageIndex = [[pdfView currentPage] pageIndex];
+ rotation = [[pdfView currentPage] rotation];
visibleRect = [pdfView convertRect:[pdfView
convertRect:[[pdfView documentView] visibleRect] fromView:[pdfView
documentView]] toPage:[pdfView currentPage]];
if (secondaryPdfView) {
secondaryPageIndex = [[secondaryPdfView currentPage]
pageIndex];
@@ -824,6 +826,12 @@
}
[[pdfView window] disableFlushWindow];
if (page) {
+ if(rotation != NSNotFound) {
+ for (int i = [[pdfView document] pageCount]; --i >= 0;
)
+ [[[pdfView document] pageAtIndex:i]
setRotation:[[[pdfView document] pageAtIndex:i] rotation] + rotation];
+ [pdfView layoutDocumentView];
+ }
+
[pdfView display];
[[pdfView documentView] scrollRectToVisible:[pdfView
convertRect:[pdfView convertRect:visibleRect fromPage:page] toView:[pdfView
documentView]]];
}
On Fri, Jan 7, 2011 at 11:05 PM, Maxwell, Adam R <[email protected]>wrote:
> On Jan 7, 2011, at 14:23, Thomas Schneider wrote:
>
> > The simplest solution is to forget the detailed rotations but to keep
> > the global changes, just as the page is kept - even though it may be
> > inconsistent in some cases. The user will understand what they have
> > done! Is that a resonable solution? Would it adversely affect
> > something else?
>
> Special-cases like that are hard to justify and/or support. For
> yourself, you could hack Skim to set a flag when you use the rotate
> action, then check that and call it after reverting a document.
>
> Personally, I have a few modifications to Skim that I keep here, and
> just periodically update from the Sourceforge subversion repo. As long
> as you have Xcode, it's painless to build from source.
>
> > (I see that synctex works with pdflatex, not straight latex - wouldn't
> > that would force me to abandon all my eps files from 20 years of
> > writing papers?)
>
> Not at all. You may know that latex itself is just a symlink to pdftex:
>
> $ ll /usr/local/texlive/2010/bin/x86_64-darwin/*tex |grep '\-> pdftex'
>
> lrwxr-xr-x 1 amaxwell wheel 6 Sep 28 10:20 amstex -> pdftex
> lrwxr-xr-x 1 amaxwell wheel 6 Sep 28 10:20 cslatex -> pdftex
> lrwxr-xr-x 1 amaxwell wheel 6 Sep 28 10:20 etex -> pdftex
> lrwxr-xr-x 1 amaxwell wheel 6 Sep 28 10:20 jadetex -> pdftex
> lrwxr-xr-x 1 amaxwell wheel 6 Sep 28 10:20 latex -> pdftex
> lrwxr-xr-x 1 amaxwell wheel 6 Sep 28 10:20 mllatex -> pdftex
> lrwxr-xr-x 1 amaxwell wheel 6 Sep 28 10:20 mltex -> pdftex
> lrwxr-xr-x 1 amaxwell wheel 6 Sep 28 10:20 pdfcslatex -> pdftex
> lrwxr-xr-x 1 amaxwell wheel 6 Sep 28 10:20 pdfetex -> pdftex
> lrwxr-xr-x 1 amaxwell wheel 6 Sep 28 10:20 pdfjadetex -> pdftex
> lrwxr-xr-x 1 amaxwell wheel 6 Sep 28 10:20 pdflatex -> pdftex
> lrwxr-xr-x 1 amaxwell wheel 6 Sep 28 10:20 pdfxmltex -> pdftex
> lrwxr-xr-x 1 amaxwell wheel 6 Sep 28 10:20 xmltex -> pdftex
>
> As far as I know, any of these can accept the --synctex=1 option and
> create a synctex.gz file. Even with dvi, Skim will read your file and
> sync with the source, as long as you have an editor set up, or at least
> is appears to in a quick test. I was opposed to adding pdfsync/synctex
> but I have to say Christiaan has done a great job with it!
>
> Now, the other thing you might consider is the epstopdf package, which
> lets you use EPS graphics and process files with pdftex. This is the
> way I'd go, since you avoid Skim running dvipdfmx on your DVI files.
>
> http://tug.ctan.org/tex-archive/macros/latex/contrib/oberdiek/epstopdf.pdf
>
> http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=epstopdf-pkg
>
> IIRC in TeX Live 2010 you don't need to explicitly use --shell-escape,
> as it will use repstopdf underneath. I don't use it myself, so this
> is only a vague memory of what I read on [email protected].
>
> --
> Adam (with apologies for the off-topic TeX stuff)
>
>
>
> ------------------------------------------------------------------------------
> Gaining the trust of online customers is vital for the success of any
> company
> that requires sensitive data to be transmitted over the Web. Learn how to
> best implement a security strategy that keeps consumers' information secure
> and instills the confidence they need to proceed with transactions.
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> Skim-app-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/skim-app-users
>
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Skim-app-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-users