3

I am teaching a course in the upcoming semester and am trying to settle on a way to prepare presentations as rapidly as possible.

I have used LaTeX beamer for years, and have even contributed some themes to it. I love using LaTeX in various contexts.

However, the situation I am in is a little peculiar and I would be glad of some advice:

  1. I am writing a textbook that will be based partially on the contents of this course. For this purpose, I was hoping to keep as much of the math (and there is going to be a non-trivial amount) in a reusable form as possible.

  2. My presentations make heavy use of drag and drop of images from various sources (of course with proper attributions). Any workflow involving saving an image and then using it in an \includegraphics block is a non-starter. Just too much of typing and clicking overhead involved and my presentations for this class are very likely to be extremely graphics heavy (some self-created using TikZ, and the rest borrowed as above).

  3. TeXmacs is useless on Mac for this purpose as its drag and drop support, despite patches, is non-existent because they have chosen to go with Qt for obvious reasons. It may have been the perfect solution for me otherwise.

  4. I am not sure if LyX is a good option for me. They have cut and paste, but no drag and drop as far as I can tell. Plus, I will not be writing the book in LyX. I find it ... stifling ... When I last used LyX many years ago, and I did not use it much, I found its LaTeX export to be a mess.

  5. I have so far been using a combination of Keynote and LaTeXIt to typeset the math. Problem is - that does not use the full power of beamer as overlays are absent. This course will involve some long derivations of expressions, where "playing striptease with my audience" will not be a bad idea. The alternative is to typeset separate equation objects and use Keynote's own transitions to create the effect. A little painful (I used it in a course I previously taught, which was far less math intensive).

  6. Typing it up in full on LaTeX has a huge markup overhead (compared to writing an article or a book). I have been looking into orgmode and multimarkdown, but I would rather not learn those unless I am certain that they check all the boxes (and I do not think they help me with drag and drop). In every single one of my past experiences, LaTeX/beamer has taken longer to work with than Keynote (the reverse is true for longer text dominated documents for LaTeX vis a vis MS Word).

An ideal solution would involve using beamer in some reduced fashion (I have newcommands etc. defined that could make frame definitions a little less painful to type in) but also involve drag and drop support. That is a contradiction in terms if one sticks to classical LaTeX.

A close approach to the solution of this problem is possible if LaTeXIt could harness the power of beamer and do overlays (internally of course, as I doubt they would allow overlays that are timed to occur with external Keynote transitions - like showing an image or hiding it, etc.).

Any suggestions that help resolve this somewhat rambling set of requirements would be welcome.

  • 1
    I think you might be interested in some other form of markdown that could export LaTeX. For this you type it up in language X and use pandoc to convert it to LaTeX. – Werner Jul 8 '14 at 5:46
  • One specific approach of the general idea mentioned by @Werner is to use xml. From here you can run it through an xslt process to get various different outputs. You can find a complete MWE and demonstration of the idea here, for example: github.com/rbeezer/mathbook – cmhughes Jul 8 '14 at 6:31
  • Does pandoc support drag and drop? I think not. So, its in the same boat as multimarkdown and orgmode. I think that pandoc is meant more for creating one source that can provide latex and ODF output. That is not the problem here. – user2751530 Jul 8 '14 at 6:39
  • You surely don't type e.g. \includegraphics... out yourself in full for every image, do you? – cfr Nov 20 '14 at 0:41
4

One other option is to invest some time in mastering any decent text editor or latex-specific editor. Either of two will certainly solve your problem with images.

Having math typed in LaTeX is the most portable solution. I find it easier to deal with math when using unicode-math.sty in xelatex.

Since you already know beamer I think it is your best bet. Inkscape or Libreoffice impress has a crippled and unmaintainable support for math, IMHO.


Edit:

I'm using Emacs. Its LaTeX modes AUCTeX, RefTeX are great already, but you may want to write some extra things to speed-up workflow.

Drag and drop images

One can use ido-completion-read to insert images. For this it is convenient to keep images in a separate folder. Here's an example TeX-doc tree:

doc/
├── img/
└── slides.tex

The following defun lets one choose an image with ido-completion:

(defun tex-image-from-./img (image)
  "You are editing a TeX file. The images are in the ./img folder.
   Call this defun to select the one to insert. Default image width is 
   0.45\\columnwidth. You can provide the width with C-u arg."
  (interactive
   (list
    (replace-regexp-in-string 
     "^.+/img" "img" 
     (ido-read-file-name "Image file: " "./img"))))

  (let (
        scale
        )

    (if current-prefix-arg
        (setq scale current-prefix-arg)
      (setq scale "0.45"))

    (insert (format 
             "\\includegraphics[width=%s\\columnwidth]{%s}"
             scale image))))

This is a simple defun which might be further tweaked to match the desired behaviour.

For example one can easily write a defun which will ask for two images, and place them in columns.

As to an exact drag-and-drop behaviour -- one might use it to copy image to the ./img folder. For example evince allows one to drag-and-drop given raster image from a pdf file to file manager.

This has an additional benefit of keeping things organized: having all images in the latex doc folder will come handy when you set up to write a book.

Templates

For examples the following defun insert template for a slide:

(defun tex-insert-beamer-slide-template ()
  (interactive)
  (insert "\\frame{
  \\frametitle{}\n\n}")
  (search-backward "frametitle{}")
  (forward-char 11))

This is just a basic defun, but arbitly complex scripts are not far away.

One can easily template math inputs (for example system of equations template) or whatever. Templates allow to reduce the tex-code to be typed (and looked-up), and thus speed-up workflow.

Custom build script

In order to speed up the workflow one should really build LaTeX doc with a single command. latexmk might be fine, but personally I prefer a simple bash script. You can make a complex bash script for all cases or a single bash script for each document (to be kept in the doc's folder, smth like make.bash).

With custom build script one can easily insert svg images in LaTeX. Just make the build script convert file.svg to file.pdf if the former is newer then the later, or the later doesn't exist at all (enen better: one can automate the export to latex inkscape functionality to get the same fonts on the svg image as in the latex doc).


Edit 2:

Images in the Internet

If a desired image is in the internet, one can copy it's URL and give the URL to a small elisp defun which would download it in the ./img and insert with the code similar to posted above to one's tex file. The image's URL might be copied fast with extensions Pentadactyl for Firefox or cVim for Chrome. You might also like to switch between browser and emacs with a hotkey. So three keystrokes overall: copy URL, switch to emacs, call the defun.

  • Can you suggest an editor that accepts drag and drop images? I would be extremely surprised if any do. I am well versed with TeXShop, emacs, Latexian, Sublime Text, vim, etc. I have never used Inkscape for presentations and Openoffice is a non-starter. Too ugly, in addition to being math unfriendly. – user2751530 Jul 8 '14 at 21:35
  • @user2751530: Yep, nor OpenOffice nor Inkscape allows to style math. E.g. to change the font size in all formulas, etc. I never used TeXShop but I think it has a choose image dialog, and probably some other goodies, which might be not exactly drag-and-drop, but should be of help. Emacs beats others by allowing one to easily automate custom task at hand. – Adobe Jul 9 '14 at 7:40
  • I was veering over to the very idea you are trying to put forth in the lisp code above but from an AppleScript angle. Since the images I use come from a browser (say Chrome), it should be possible to code AppleScript to recognize two different actions (1. drag and drop from a folder, 2. drag and drop from a URL) and then insert a suitable \includegraphics at the insertion point. I am looking into writing an AppleScript that does this. – user2751530 Jul 9 '14 at 8:27
  • @user2751530 TeXShop used to support drag-and-drop, I'm almost sure. (And could be extended with AppleScript.) – cfr Nov 20 '14 at 0:38
1

For drag and drop, I assume you mean within the application rather than between applications, since drag and drop rarely works between different programs anyway e.g. I can't even drag an image from a webpage in Internet Explorer to a Word document, and both those programs were made by Microsoft. I know that this is not the advice you asked for, but changing what application you use and all of the massive repurcussions that has seems wildly out of proportion with the difference between cut and paste (which you can do with the mouse with the context menu or toolbar) vs drag and drop. I suspect the reason it's not implemented in LyX is because it's hard to imagine anyone caring much about such a minor convenience. Perhaps you should just get used to cut and paste and focus on more important things.

Another piece of unprompted advice, but one you'll probably appreciate more: If you do go for LyX, beware that the way that it handles Beamer presentations completely changed in its most recent version (2.1.0). This won't affect you directly because it sounds like you don't have any Beamer presentations created in the older versions, but beware that any online instructions (e.g. about how to start a new slide or make overlays) that aren't specifically about 2.1 are out of date.

To come closer to answering what you actually asked: Yes, you must choose filenames for images in LyX; images can't be embedded in the LyX file as they can in Word documents. However, if you start by putting the LyX file in its own directory, and just give random names to images whenever LyX prompts you (when you paste it in), then you can essentially forget that this is happening. The only disadvantage of this strategy is that if you delete an image from the document then it will still exist on disc.

Although I think your best option will be LyX, I'll give you a fairly radical alternative: PowerPoint. Recent versions of Office have a completely new equation editor that is surprisingly good. It only supports a narrow subset of equations (MUCH narrower than LaTeX), but the features that it does support are done well (the symbols are high quality and the spacing is as good LaTeX, and occasionally even better). So have a look at whether enough equation features are supported for your purposes.

  • Maybe you did not read my post carefully enough. I already use Keynote, which handles drag and drop beautifully and LaTeXIt which handles native LaTeX. Any solution that involves saving images with \includegraphics blocks is NOT acceptable. A class presentation took about an hour longer (to do 21 slides) than it did for me switch to Keynote and then do all the 30 slides needed. Beamer is not good for rapid creation of presentations. As an academic, every minute I can save is a minute I did not have before. With all due respect, the absence of drag and drop is not a "minor inconvenience" to me. – user2751530 Jul 9 '14 at 7:03
  • I don't use LyX for its headache inducing qualities, but thanks for the additional information about LyX. – user2751530 Jul 9 '14 at 7:04
  • And please do not make assumptions about what drag and drop means. My post made it amply clear (through implication) that it was drag and drop from other applications. It works perfectly reliably on Mac (with Keynote). Maybe on Windows that is iffy but that does not concern me. – user2751530 Jul 9 '14 at 7:26
  • I had to make assumptions about what drag and drop means because you didn't make it clear (not even "by implication"). That's why I clarified what I thought you meant. The rest of the paragraph I wrote on the topic remains true though. – Jim Oldfield Jul 9 '14 at 10:15
  • 1
    The second. Saving files etc. adds an intolerable overhead. – user2751530 Jul 9 '14 at 18:04
0

I would suggest to use inkscape withJessyInk. Check the link http://www.timteatro.net/2010/08/12/a-tutorial-introduction-to-jessyink-presentations-in-inkscape/

Mathematical formulas can be rendered once pstoedit is installed. http://www.timteatro.net/2010/08/05/textext-for-math-in-inkscape/

  • Inkscape on mac uses X11, which means that anything like drag and drop would be an iffy thing. Thanks for the suggestion. – user2751530 Jul 8 '14 at 6:37
-1

I'm a bit late to the party, I realize. Similar to the previous answer, I use Inkscape and JessyInk (or sozi) to make presentations which heavily rely on maths and imported graphics. However, (probably unlike the OP) I'm really reluctant to type code to elaborate presentations and I much prefer create them visually WYSIWYG end-to-end. My math too is done WYSIWYG with Texmacs' Inkscape extension instead of Textext (Latex) as suggested above. The workflow is similar to that with MathType equation editor in Windows for those who happen to know (except for way better Tex-like typesetting!). Also Texmacs is an excellent equation editor with achoice of smart shortcuts, full menus, Latex input, scriptability and more. As a bonus, the Texmacs Inkscape extension is 2-ways compatible with formulas entered with textext!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.