emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Berry, Charles" <ccberry@ucsd.edu>
To: Jeremie Juste <jeremiejuste@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>,
	Grant Rettke <gcr@wisdomandwonder.com>
Subject: Re: Happily exporting LaTeX, now want to export to text and HTML, can't figure how to handle latex markup
Date: Thu, 3 Aug 2017 16:56:58 +0000	[thread overview]
Message-ID: <AAAD2BCF-FB79-4B19-8880-7D4DCE73E501@ucsd.edu> (raw)
In-Reply-To: <87vam5tv1e.fsf@freegnu.noherd.org>


> On Aug 2, 2017, at 4:22 PM, Jeremie Juste <jeremiejuste@gmail.com> wrote:
> 
> 
> 
> Hello 
> 
>> 
>> Putting together a macro seems like the best option.  Recall that you
>> can use elisp in macros by placing it between `(eval’ and `)', so the
>> following emits “def’ in all but latex exports and “abc” for latex.
>> 
> 
> 
> Yes I found this nice piece of code  
> 
> It switches to svg if backend is html and to raw latex if backend is
> latex. You only have to tweak it your needs.
> 

I think this is obsolete. It fails on org-9.0.9. What version of org are you using? 

In any case replacing the ~(if ...)~ by ~org-export-current-backend~ will fix it.


> #+header: :file (by-backend (html "tree.svg") (t 'nil))
> #+header: :imagemagick
> #+header: :results (by-backend (pdf "latex") (t "raw"))
> #+begin_src latex
>  \usetikzlibrary{trees}
>  \begin{tikzpicture}
>    \node [circle, draw, fill=red!20] at (0,0) {1}
>    child { node [circle, draw, fill=blue!30] {2}
>      child { node [circle, draw, fill=green!30] {3} }
>      child { node [circle, draw, fill=yellow!30] {4} }};
>  \end{tikzpicture}
> #+end_src
> 
> * COMMENT setup
> #+begin_src emacs-lisp :results silent
>  (setq org-babel-latex-htlatex "htlatex")
>  (defmacro by-backend (&rest body)
>    `(case (if (boundp 'backend) (org-export-backend-name backend) nil) ,@body))
> #+end_src
> 
> The reference http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html
> 

Another case were adding dates to Worg entries might help.

Chuck

  reply	other threads:[~2017-08-03 16:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-02  5:20 Happily exporting LaTeX, now want to export to text and HTML, can't figure how to handle latex markup Grant Rettke
2017-08-02 16:15 ` Berry, Charles
2017-08-02 23:22   ` Jeremie Juste
2017-08-03 16:56     ` Berry, Charles [this message]
2017-08-03 19:16       ` Jeremie Juste
2017-08-07  1:06   ` Grant Rettke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AAAD2BCF-FB79-4B19-8880-7D4DCE73E501@ucsd.edu \
    --to=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=gcr@wisdomandwonder.com \
    --cc=jeremiejuste@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).