emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Inline images in latex
@ 2009-06-21 19:39 Arne
  2009-06-22 18:38 ` Arne
  0 siblings, 1 reply; 3+ messages in thread
From: Arne @ 2009-06-21 19:39 UTC (permalink / raw)
  To: emacs-orgmode

I am not able to get the inline images including in the exported latex output. 
The raw latex contains an \href{}{} instead of \includegraphics.  I have
verified that pdflatex is the latex to pdf process and the the appropriate image
file extensions are in the org-export-latex-inline-image-extensions.  

I am at a loss  and would find this feature very convenient.   I am presently
using two work arounds, including the raw latex in the org file or a post
processing script to convert the href's to includegraphics.   

I'm using org 6.27a and I have the same issue on three linux computers running
different emacs versions.  So I think it has to do with how I am invoking "org".

It must be something obvious, but I can't find the problem. 

Thanks in advanced....and below is my .emacs file, Arne

================================================================================
;;
(set-default-font "-adobe-courier-bold-r-normal--18-180-75-75-m-110-iso8859-1")
;;(set-default-font "-adobe-courier-bold-r-normal--14-140-75-75-m-90-iso8859-1")
;; get rid of the toolbar on top of the window
(tool-bar-mode 0)
; load special stuff
(add-to-list 'load-path "/usr/local/share/emacs/site-lisp")
(add-to-list 'load-path "~/tasks/eeepc/site-lisp")
(add-to-list 'load-path "~/tasks/eeepc/site-lisp/remember")
;;(add-to-list 'load-path "/usr/share/emacs21/site-lisp/emacs-goodies-el")

(setq max-specpdl-size '100000)

; special modes for elegant
(require 'elegant-lattice-mode)
(require 'elegant-control-mode)
; load csv-mode
(require 'csv-mode)
; load iimage
(require 'iimage)

; load remember
(require 'org-install)
(require 'remember)
(require 'vc-git)
(when (featurep 'vc-git) (add-to-list 'vc-handled-backends 'git))
(require 'git)

;;bbdb stuff
(require 'bbdb)
(bbdb-initialize 'gnus 'message 'sc 'w3)

;; external editor for thunderbird 

(require 'tbemail)
(add-hook 'tbemail-mode-hook 'flyspell-mode)
(add-hook 'tbemail-mode-hook 'auto-fill-mode)


;; autoload
(autoload 'git-blame-mode "git-blame"
           "Minor mode for incremental blame for Git." t)
(autoload 'flyspell-mode 
  "flyspell" "On-the-fly spelling checker." t)
(autoload 'iimage-mode "iimage" "Support Inline image minor mode." t)
(autoload 'turn-on-iimage-mode "iimage" "Turn on Inline image minor mode." t)



; 
;;flyspell on certain mods
(add-hook 'latex-mode-hook 'flyspell-mode)
(add-hook 'text-mode-hook 'flyspell-mode)
(add-hook 'text-mode-hook 'auto-fill-mode)
(add-hook 'text-mode-hook 'turn-on-orgstruct)
(add-hook 'diary-mode-hook 'turn-on-orgtbl)
;;(add-hook 'diary-mode-hook 'turn-on-orgstruct)
(add-hook 'diary-mode-hook 'flyspell-mode)
(add-hook 'diary-mode-hook 'auto-fill-mode)

(add-hook 'diary-display-hook 'fancy-diary-display)

;; The following lines are always needed.  Choose your own keys.
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))

(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)

(global-font-lock-mode 1)                     ; for all buffers
(add-hook 'org-mode-hook 'turn-on-font-lock)  ; org-mode buffers only
(add-hook 'org-mode-hook 'flyspell-mode)      ; autospell check
(add-hook 'org-mode-hook 'iimage-mode)        ; iimage mode
;; This line only if org-mode is not part of the X/Emacs distribution.
;;(require 'org-install)
(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(LaTeX-command "pdfltex")
 '(auto-save-interval 3000)
 '(case-fold-search t)
 '(csv-separators (quote (" " ",")))
 '(current-language-environment "UTF-8")
 '(default-input-method "rfc1345")
 '(global-font-lock-mode t nil (font-lock))
 '(inhibit-startup-screen t)
 '(org-agenda-files (quote ("/home/user/tasks/journal.org"
"/home/user/tasks/meetings.org" "/home/user/tasks/ahla/RF_heat_AUG29.org"
"/home/user/tasks/leaders/abandoned_projects.org"
"/home/user/tasks/leaders/leaders_weekly.org"
"/home/user/tasks/leaders/leaders_weekly_FY08.org"
"/home/user/tasks/bteam/bteam_weekly.org")))
 '(org-export-latex-classes (quote (("article"
"\\documentclass[11pt,letter]{article}
\\usepackage{inputenc}
\\usepackage[T1]{fontenc}
\\usepackage{graphicx}
\\usepackage{hyperref}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}"
. "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" .
"\\subparagraph*{%s}")) ("report" "\\documentclass[11pt,letter]{report}
\\usepackage{inputenc}
\\usepackage[T1]{fontenc}
\\usepackage{graphicx}
\\usepackage{hyperref}" ("\\part{%s}" . "\\part*{%s}") ("\\chapter{%s}" .
"\\chapter*{%s}") ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" .
"\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}")) ("book"
"\\documentclass[11pt,letter]{book}
\\usepackage{inputenc}
\\usepackage[T1]{fontenc}
\\usepackage{graphicx}
\\usepackage{hyperref}" ("\\part{%s}" . "\\part*{%s}") ("\\chapter{%s}" .
"\\chapter*{%s}") ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" .
"\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))))
 '(org-export-latex-image-default-option "width=0.8\\textwidth")
 '(text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify))))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )

(customize-set-variable 'org-file-apps
			'(("docx" . "soffice %s")
			  ("xlsx" . "soffice %s")
			  ("pptx" . "soffice %s")
			  ("doc"  . "soffice %s")
			  ("xls"  . "soffice %s")
			  ("ppt"  . "soffice %s")
			  ("ods"  . "soffice %s")
			  ("odw" . "soffice %s")
			  ("odp" . "soffice %s")
			  ("pdf" . "acroread %s")))
;
;;(setq org-agenda-files (list "~/tasks"))
(setq org-agenda-files (list "~/tasks"
			     "~/tasks/ahla"
			     "~/tasks/leaders"
			     "~/tasks/npes"
			     "~/tasks/bteam"))
;;			     "~/diary.org"))
			     
(setq org-hide-leading-stars 1)
(setq org-startup-folded 'showall)
(setq org-tag-alist '(
		      ("Accel". ?A)
		      ("Budget" . ?B)
		      ("Controls" . ?C)
		      ("DOE" . ?D)
		      ("Emacs" . ?E)
		      ("Food" . ?F)
		      ("gnuplot" . ?g)
		      ("AHLA" . ?H)
		      ("INCLUDE" . ?I)
		      ("Java" . ?J)
		      ("Linux" . ?L)
		      ("Management" . ?M)
		      ("OPS" . ?O)
		      ("Positron" . ?P)
		      ("perl" . ?p)
		      ("SELECT" . ?S)
		      ("SENSITIVE" . ?s)
		      ("12GeV" . ?T)
		      ("EXCLUDE" . ?X)))

(setq org-export-exclude-tags (list 
			       "EXCLUDE"
			       "SENSITIVE"))
(setq org-export-select-tags (list 
			       "SELECT"
			       "INCLUDE"))
(setq org-todo-keywords
       '((sequence "TODO" 
		   "WAITING" 
		   "INPROGRESS" 
		   "DELEGATED" 
		   "|" 
		   "DONE" 
		   "CANCELED")))

(setq org-export-html-inline-images t)
(setq org-export-latex-inline-images t)
(setq org-agenda-include-diary t)
(setq  org-agenda-ndays  7)
;  set up remember and remember templates
(setq remember-annotation-functions '(org-remember-annotation))
(setq remember-handler-functions '(org-remember-handler))
(add-hook 'remember-mode-hook 'org-remember-apply-template)
;
(org-remember-insinuate)
(setq org-directory "~/tasks/")
(setq org-default-notes-file (concat org-directory "/journal.org"))
(define-key global-map "\C-cr" 'org-remember)
; templates
(setq org-remember-templates
      '(("Todo" ?t "* TODO %? %^g\n  %T\n  %i\n" "~/tasks/tasks.org" top)
        ("Meeting" ?m "* %? %^g\n  %T\n  %i\n" "~/tasks/meetings.org" top)
        ("EEEPC" ?e "* %? %^g\n  %T\n  %i\n" "~/tasks/eeepc/eeepc.org" top)
        ("Journal" ?j "* %? %^g\n  %T\n   %i\n" "~/tasks/journal.org" top)
        ("Idea" ?i "* %^{Title} %^g\n  %T\n  %i\n" "~/tasks/ideas.org" top)))

;; org code to deal with subtasks
(defun org-summary-todo (n-done n-not-done)
  "Switch entry to DONE when all subentries are done, to TODO otherwise."
  (let (org-log-done org-log-states)   ; turn off logging
    (org-todo (if (= n-not-done 0) "DONE" "TODO"))))

(add-hook 'org-after-todo-statistics-hook 'org-summary-todo)


;;-------------------------------------------------------------------------
;; inline images
;;-------------------------------------------------------------------------
(add-to-list 'iimage-mode-image-regex-alist
             (cons (concat "\\[\\[file:\\(~?" iimage-mode-image-filename-regex
                           "\\)\\]")  1))
;;(define-key org-mode-map [(control c) ?i] 'iimage-mode)  ; C-c i for image
;;(add-hook 'org-mode-hook (lambda ()
;;			   (local-set-key "\M-I" 'org-toggle-iimage-in-org)))


(defun org-toggle-iimage-in-org ()
  "display images in your org file"
  (interactive)
  (if (face-underline-p 'org-link)
      (set-face-underline-p 'org-link nil)
    (set-face-underline-p 'org-link t))
  (iimage-mode))

(define-key org-mode-map [(control c) ?i] 'org-toggle-iimage-in-org)


;;--------------------------------------------------------------------
;; Lines enabling gnuplot-mode

;; move the files gnuplot.el to someplace in your lisp load-path or
;; use a line like
;;  (setq load-path (append (list "/path/to/gnuplot") load-path))

;; these lines enable the use of gnuplot mode
(autoload 'gnuplot-mode "gnuplot" "gnuplot major mode" t)
(autoload 'gnuplot-make-buffer "gnuplot" "open a buffer in gnuplot mode" t)

;; this line automatically causes all files with the .gp extension to
;; be loaded into gnuplot mode
(setq auto-mode-alist (append '(("\\.gp$" . gnuplot-mode)) auto-mode-alist))

;; This line binds the function-9 key so that it opens a buffer into
;; gnuplot mode 
(global-set-key [(f9)] 'gnuplot-make-buffer)

(global-set-key "\C-cp" 'org-plot/gnuplot)
;; end of line for gnuplot-mode
;;--------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Inline images in latex
  2009-06-21 19:39 Inline images in latex Arne
@ 2009-06-22 18:38 ` Arne
  2009-06-23  4:15   ` Carsten Dominik
  0 siblings, 1 reply; 3+ messages in thread
From: Arne @ 2009-06-22 18:38 UTC (permalink / raw)
  To: emacs-orgmode

Arne <freyberger.arne <at> cox.net> writes:
> 
> I am not able to get the inline images including in the exported latex output. 
> The raw latex contains an \href{}{} instead of \includegraphics.  I have
> verified that pdflatex is the latex to pdf process 
> and the the appropriate image
> file extensions are in the org-export-latex-inline-image-extensions.  

Carsten,
I've tracked it down to an underscore in the filename.  Almost all my filenames
have an underscore in them, a habit I should probably break.   The first 
command works where as the second line results in an "href".

  [[./data/linacE.jpg]]      # works, results in \includegraphics

  [[./data/linac_energy.jpg]]   # does not work, results in \href

The jpg files are identical.

If this is easy to fix, that'd be great, otherwise I move to bumpy names.

Thanks for a great tool!
Arne

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Re: Inline images in latex
  2009-06-22 18:38 ` Arne
@ 2009-06-23  4:15   ` Carsten Dominik
  0 siblings, 0 replies; 3+ messages in thread
From: Carsten Dominik @ 2009-06-23  4:15 UTC (permalink / raw)
  To: Arne; +Cc: emacs-orgmode


On Jun 22, 2009, at 8:38 PM, Arne wrote:

> Arne <freyberger.arne <at> cox.net> writes:
>>
>> I am not able to get the inline images including in the exported  
>> latex output.
>> The raw latex contains an \href{}{} instead of \includegraphics.  I  
>> have
>> verified that pdflatex is the latex to pdf process
>> and the the appropriate image
>> file extensions are in the org-export-latex-inline-image-extensions.
>
> Carsten,
> I've tracked it down to an underscore in the filename.  Almost all  
> my filenames
> have an underscore in them, a habit I should probably break.   The  
> first
> command works where as the second line results in an "href".
>
>  [[./data/linacE.jpg]]      # works, results in \includegraphics
>
>  [[./data/linac_energy.jpg]]   # does not work, results in \href
>
> The jpg files are identical.
>
> If this is easy to fix, that'd be great, otherwise I move to bumpy  
> names.

This was a bug, fixed now.  Thanks!

- Carsten

>
> Thanks for a great tool!
> Arne
>
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-06-23  4:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-21 19:39 Inline images in latex Arne
2009-06-22 18:38 ` Arne
2009-06-23  4:15   ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).