Hi all,
./compile.sh can be passed a parameter to compile only a specific file rather than the whole book. Now I consider this probably only occurs during development with a human executing the script (rather than some CI process which will be processing the whole book) and I'm finding it useful to automatically fire off a PDF Viewer on the generated file, as per the line below tagged "ADDED". if [[ $# -eq 1 ]]; then dir=$(dirname "$1") # e.g., Zinc pier_file=$(basename "$1") # e.g., Zinc.pier pillar_one "$1" produce_pdf "${dir}" "${pier_file}" open "${dir}"/"${pier_file}".pdf # <----ADDED else pillar_all compile_chapters compile_latex_book fi Is this something others would find useful? or can you see issues with it? Having this mod makes my working area dirty, and 'git clean' blows it away - so I'd like to integrate something like it. Now the above works for me on OSX, but for flexibility to deal with other platforms, the "open" command could be replaced with an environment variable, and do nothing if environment variable does not exist. What do you think? cheers -ben |
very good idea, it makes perfect sense to have the ability to open pdf as soon as compiling ends. I advice to provide an option to activate this ability as a command line argument. So if there is batch compiling or compiling happening on the server this process wont trigger. Even cooler it would be if there is a problem with Latex generation to open the tex file displaying the error. But that is probably a lot trickier.
On Sat, Jun 7, 2014 at 6:01 PM, Ben Coman <[hidden email]> wrote: Hi all, |
In reply to this post by Ben Coman
Ben Coman <[hidden email]> writes: > Hi all, > > ./compile.sh can be passed a parameter to compile only a specific file > rather than the whole book. Now I consider this probably only occurs > during development with a human executing the script (rather than some > CI process which will be processing the whole book) and I'm finding it > useful to automatically fire off a PDF Viewer on the generated file, as > per the line below tagged "ADDED". > > if [[ $# -eq 1 ]]; then > dir=$(dirname "$1") # e.g., Zinc > pier_file=$(basename "$1") # e.g., Zinc.pier > pillar_one "$1" > produce_pdf "${dir}" "${pier_file}" > open "${dir}"/"${pier_file}".pdf # <----ADDED The `open' tool is OSX-specific, isn't it? Cheers, Nico > else > pillar_all > compile_chapters > compile_latex_book > fi > > > Is this something others would find useful? or can you see issues with > it? Having this mod makes my working area dirty, and 'git clean' blows > it away - so I'd like to integrate something like it. Now the above > works for me on OSX, but for flexibility to deal with other platforms, > the "open" command could be replaced with an environment variable, and > do nothing if environment variable does not exist. > > What do you think? > > cheers -ben > _______________________________________________ > Magritte, Pier and Related Tools ... > https://www.iam.unibe.ch/mailman/listinfo/smallwiki -- Nicolas Petton http://nicolas-petton.fr |
Nicolas Petton wrote:
Probably Yes. And even on OSX someone may want to use a different tool. That is why I below :) I suggest using an environment variable so the command can be customized outside the controlled compile.sh file, and do nothing if that environment variable doesn't exist.Ben Coman [hidden email] writes:Hi all, ./compile.sh can be passed a parameter to compile only a specific file rather than the whole book. Now I consider this probably only occurs during development with a human executing the script (rather than some CI process which will be processing the whole book) and I'm finding it useful to automatically fire off a PDF Viewer on the generated file, as per the line below tagged "ADDED". if [[ $# -eq 1 ]]; then dir=$(dirname "$1") # e.g., Zinc pier_file=$(basename "$1") # e.g., Zinc.pier pillar_one "$1" produce_pdf "${dir}" "${pier_file}" open "${dir}"/"${pier_file}".pdf # <----ADDEDThe `open' tool is OSX-specific, isn't it? cheers -ben else pillar_all compile_chapters compile_latex_book fi Is this something others would find useful? or can you see issues with it? Having this mod makes my working area dirty, and 'git clean' blows it away - so I'd like to integrate something like it. Now the above works for me on OSX, but for flexibility to deal with other platforms, the "open" command could be replaced with an environment variable, and do nothing if environment variable does not exist. What do you think? |
In reply to this post by Nicolas Petton
I propose we don't change anything with respect to that :-). I think users can open the pdf viewer once manually and this viewer will see updated to the pdf file so you don't have to open the pdf again and again. On Sat, Jun 7, 2014 at 7:52 PM, Nicolas Petton <[hidden email]> wrote:
-- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill |
nope i am afraid that is not how it works. Pdf is loaded into memory and is not auto reloaded when its modified/recreated. So the pdf you open will not update automagically to its latest version. So it makes perfect sense to have that as option in compile.sh because if you do frequent recompiles you waste a lot of time opening the pdf , again and again. At least I have. Not that is such a big problem I can create a bash that does that anyway.
On Sun, Jun 8, 2014 at 7:47 PM, Damien Cassou <[hidden email]> wrote:
|
On Sun, Jun 8, 2014 at 7:23 PM, kilon alios <[hidden email]> wrote: nope i am afraid that is not how it works. Pdf is loaded into memory and is not auto reloaded when its modified/recreated. So the pdf you open will not update automagically to its latest version. and there is no refresh button or anything in your PDF viewer? If not, I can only encourage you to use another one. -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill |
I am using the default on MacOS which is Preview, though I doubt the situation is any different for Linux or Window. I would be highly surprised if any default pdf viewers auto reload when the pdf is modified or recreated. A refresh button would be a better option only if I could tie it to a shortcut , because the process of navigating to the menu to press refresh is as time consuming as double click to reopen it. Preview has no refresh button as far I can tell.
On Sun, Jun 8, 2014 at 8:27 PM, Damien Cassou <[hidden email]> wrote:
|
On Sun, Jun 8, 2014 at 7:36 PM, kilon alios <[hidden email]> wrote: I am using the default on MacOS which is Preview, though I doubt the situation is any different for Linux or Window. I would be highly surprised if any default pdf viewers auto reload when the pdf is modified or recreated. A refresh button would be a better option only if I could tie it to a shortcut , because the process of navigating to the menu to press refresh is as time consuming as double click to reopen it. Preview has no refresh button as far I can tell. ok then, you can modify the script and use the PDFVIEWER environment variable. Still, the default pdf client on Ubuntu refreshes automatically when the PDF updates. It is so useful that I stupidly thought even paying OS had this. I should have known better. In French we say "Linux: y'a moins bien, mais c'est plus cher" (Linux: you can find worse but that's more expensive) :-) -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill |
In reply to this post by Damien Cassou
Damien Cassou wrote:
Okay. I'll just copy it to mycompile.sh and leave the original untouched. cheers -ben
|
In reply to this post by Damien Cassou
I wish I felt the same about Linux, really do, that could have saved me some money. But alas though not as bad Windows, has still long way to go before it convince me to replace MacOS with it. The driver support is still quite bad. Pharo dropping support for older Ubuntu versions forced me to return back to Win 7 (my pc at work is dual boot Win 7 / Ubuntu 13.10 ) I am surprised though that it auto updates. Definitely a plus. Well don't modify the bash script just because I want it. Its not a big deal to add the bash line myself.
On Sun, Jun 8, 2014 at 8:51 PM, Damien Cassou <[hidden email]> wrote:
|
In MacOS you can use Skim, it can auto-refresh when the underlying file changes, and it gives you the option in a good way. Plus it has good emacs synctex integration ;-) On Jun 8, 2014, at 2:20 PM, kilon alios <[hidden email]> wrote: > I wish I felt the same about Linux, really do, that could have saved me some money. But alas though not as bad Windows, has still long way to go before it convince me to replace MacOS with it. The driver support is still quite bad. Pharo dropping support for older Ubuntu versions forced me to return back to Win 7 (my pc at work is dual boot Win 7 / Ubuntu 13.10 ) > > I am surprised though that it auto updates. Definitely a plus. > > Well don't modify the bash script just because I want it. Its not a big deal to add the bash line myself. > > > On Sun, Jun 8, 2014 at 8:51 PM, Damien Cassou <[hidden email]> wrote: > > On Sun, Jun 8, 2014 at 7:36 PM, kilon alios <[hidden email]> wrote: > I am using the default on MacOS which is Preview, though I doubt the situation is any different for Linux or Window. I would be highly surprised if any default pdf viewers auto reload when the pdf is modified or recreated. A refresh button would be a better option only if I could tie it to a shortcut , because the process of navigating to the menu to press refresh is as time consuming as double click to reopen it. Preview has no refresh button as far I can tell. > > ok then, you can modify the script and use the PDFVIEWER environment variable. Still, the default pdf client on Ubuntu refreshes automatically when the PDF updates. It is so useful that I stupidly thought even paying OS had this. I should have known better. In French we say "Linux: y'a moins bien, mais c'est plus cher" (Linux: you can find worse but that's more expensive) :-) > > > -- > Damien Cassou > http://damiencassou.seasidehosting.st > > "Success is the ability to go from one failure to another without losing enthusiasm." > Winston Churchill > ---> Save our in-boxes! http://emailcharter.org <--- Johan Fabry - http://pleiad.cl/~jfabry PLEIAD lab - Computer Science Department (DCC) - University of Chile |
Thanks Johan , I am actually a big fan of emacs and use it for editing pillar files. It also has surprisingly nice GUI for an open source app. Looks like a keeper :) On Sun, Jun 8, 2014 at 9:29 PM, Johan Fabry <[hidden email]> wrote:
|
Free forum by Nabble | Edit this page |