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 <b...@openinworld.com> wrote:

> 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
>
>

Reply via email to