[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    Re: [CMake] Matlab producing image files for use with LaTeX
From:       Myles English <mylesenglish () gmail ! com>
Date:       2015-01-12 11:26:01
Message-ID: 87fvbgz0r1.fsf () gmail ! com
[Download RAW message or body]


Hello Rob,

Rob McDonald writes:

> I am familiar with UseLATEX, but would like to take the automation of
> my document build system a step or two further.  Solutions that build
> on UseLATEX -- or a totally separate approach, are OK.
> 
> I often use Matlab to create *.pdf figures -- which are then used in a
> LaTeX document.  I would like my build setup to notice when a Matlab
> *.m file has changed - and then re-run it to re-generate the dependent
> *.pdf - and then LaTeX for the final document.

I haven't done it myself, but How about using emacs?  An emacs daemon
could notice when files change and call emacs org-mode functions
(optionally via a call to CMake) to call Matlab to regenerate the plots,
then org-mode export as LaTeX.

A part of CMakeLists.txt to call emacs function may be like this:

add_custom_command(
              OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mainThesis.tex
              COMMAND emacs -Q --batch --eval \"(progn
                  (add-to-list 'load-path
                         (expand-file-name \\"~/.emacs.d/plugins/org-mode/lisp/\\"))
                  (require 'org)
                  .....etc.

> If that works, I would like to take things a step further and specify
> that the *.m files may depend on some external data files of arbitrary
> formats.  The whole system should notice and update when those data
> files are updated.

A cron job to download the data locally (using curl or wget) then the
emacs daemon could monitor those also.

> 
> Bonus points for a system that detects as much of the dependencies
> automagically (like #include ing header files).

Emacs Org-mode source blocks store a hash so they only re-run if
necessary.

Myles

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: \
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information \
on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at \
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic