!Dimension too large when knitting file to PDF using rmarkdown in RStudio - pdf

I receiving the following error when I try to knit into a pdf:
! Dimension too large.
\fb#put#frame ...p \ifdim \dimen# >\ht \#tempboxa
\fb#putboxa #1\fb#afterfra...
It's an extremely long line of code that I need to knit into a pdf (about 5000 lines). A lot of preprocessing data. The output itself is quite small maybe a line or more. Has anyone had this issue with huge blocks of code? If so, could you tell me how you solved it? I'm up for suggestions.

That's a LaTeX framed package error. RMarkdown tries to put all of that code into a single environment (I believe it's a snugshade environment, but I might be wrong), and that environment isn't ready for something that's going to stretch over many pages. The most I managed to get was about 1300 lines which were broken up into 48 pages of code.
The simplest solution would be to break that up into 4 or 5 pieces, but that might not be easy for you to do.
Next simplest might be not to show it as code at all: use echo = FALSE in the code chunk that runs it, and include it some other way (e.g. in a verbatim environment, or using the listings package). With that much code, showing it as a couple of hundred pages of text doesn't really make much sense anyway.

Related

How do I safely (i.e. crash resistantly) serialize docs in spacy?

I have a pretty big corpus of texts that I use to make a few million Doc-objects.
I am somewhat familiar with the usage of DocBin(), but it looks like it loads all the Docs to memory before dumping it to file. Seems a bit risky and crash-prone. Ideally I want to be able to continue where it stopped should a crash or unexpected exit occur.
I came up with two options:
Write every doc as a single file with Doc.to_disk.
After the first x iterations I write the docbin to file, then every x iteration after that I load the docbin-file, merge it with the ones in memory, then write that new DocBin to file again.
Anything I've missed here? What are the up- and downsides to these methods? Any other suggestions?

VBA to automatically print page ranges of a PDF

At work, attached files size to email is limited to 10 Mo and because of many reasons :
Outlook is the only way to share files
I can only use the programs already installed
I am trying to create a VBA macro to :
automatically split PDF bigger than 10 Mo by printing them into smaller files
merge them on the other side
I know it is far from ideal (and many tools exists to do it), but I have no other options.
So far, it seems that I can only use PDFCreator and Adobe Reader for this task, as no other helpfull tools are deployed on my PC (mostly Office)... and I can not figure a way to use command line for printing range of pages.
I successfully created a working (very) inelegant macro, based on Shell commands and SendKeys VBA, basically emulating human interaction to print range A, then waiting for the job to be done, them printing range B, and so on... Among the many problems I should now solve :
add protection to take into account machines with different processing power (replace my timings with file creation verification and detect if jobs are still running in the background)
create a robust merging system when receiving the mail
Plus I am very dependant of the software versions installed, and I foresee a lot of issues with software updates/version if this macro is to be used by many people.
So this method doesn't have a bright futur for now, and unless I find an other way to solve this problem, I will probably give up and keep doing this manually (after all, if my employer doesn't provide better tool, I should not be expected to be as efficient as I could).
Have you any insight about how to cleverly solve this issue ?
(Yes, I already told my boss that working like this is a nightmare, but easy file exchange is not the priority).
I managed to solve my problem using 7-zip and its "-v" option using command line : I split my big file into binary smaller files and automatically create new mail with them as attachments.

PS PDF Conversion text issues

having a bit of a weird issue that I can't for the life of me figure out how to solve. It may just be a blond moment on my part but I've been scratching my head with this one for a while.
Basically I've made a load of PS PDF files in CS6 and used Acrobat Pro DC to merge the files into one big file. Granted this may not be the most efficient way to work with PDFs but it seemed like the way that made the most sense to me. Anyway I've been doing this for a while and I've not really had any issues however when I did it today I hit a little snag. Several pages in the document come out with their text all mangled. The odd thing is that the text appears to look fine in the DC viewer but if I print them out or view them in Windows Reader they look deformed.
I've tried a load of different ways to try to solve the problem but I can't really find the answer I'm looking for. I've tried a number of different file formats and different printing settings (which I now realize are useless as it's messed up in Reader as well as in print). I've also tried rasterizing the text which seems to work but obviously the text becomes unselectable in the PDF views so I'd prefer to use this as a last resort and find the actual root of the problem.
I can only assume that it's an issue on photoshops side as the majority of the pages come out fine and they all use the same base template and same fonts.
Any insight into this will be really helpful.

PHPStorm slow on ONE specific CodeIgniter Model

So my I swear by PHPStorm, I have been using it for over a year now and have had no issues up until now.
I have now come to slight problem in the form of sluggish editing.
I have a model file that is just under 4000 lines of code - nothing too big, but PHPStorm seems to be having some trouble with it. My other models seem to be just fine, but this one goes sluggish every few seconds while editing. Meaning, it will let me start typing and editing the code, but then it will freeze briefly for a few seconds and then complete the actions I entered... like lag.
I am assuming it has something to do with the fact that it's an SQL file since I have other control files that are larger.
Ultimate, I guess I can reduce the model in size to be separated into other models, but I would rather not.
Anyone else have experience with this?
Thanks
B

How to handle LaTeX/PDF doc reviews?

I am a Ph.D student, and I usually write articles which are later proof-read by my supervisor. I usually do it in LaTeX and reviews are done to the PDF outputs in Adobe Reader itself. There are mostly grammatical ones and mostly I miss prepositions and conjuctions in fast writing. To re-phrase everything I have to manually enter everything in my LaTeX script again.
This seems to be hell lot of work and this goes on multiple times sometimes. Is there any software in current world that makes the task easier? For example, if a text stuck out for grammar errors and suggested alternatives, can I accept the changes to replace old one with new phrase or sentence and also able to blank out the striked text. Please suggest me a tool which really makes my life easier.
You may want to take a look at the following link. It has some good information about version controlling.
http://en.wikibooks.org/wiki/LaTeX/Collaborative_Writing_of_LaTeX_Documents
You could attach the LaTeX sources to the PDF (with the attachfile2 package), so reviewers can directly edit the source and send that back. Or you try to accept comments to the PDF, but currently only Adobe Reader and Foxit allow that - and not on Linux.