emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tsd@tsdye.com (Thomas S. Dye)
To: Sebastien Vauban
	<public-wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@plane.gmane.org>
Cc: public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org
Subject: Re: Can't export LaTeX source code blocks
Date: Mon, 22 Apr 2013 12:25:12 -1000	[thread overview]
Message-ID: <m17gjumcdz.fsf@poto.westell.com> (raw)
In-Reply-To: <867gju6xyd.fsf@somewhere.org> (Sebastien Vauban's message of "Mon, 22 Apr 2013 23:46:02 +0200")



Aloha Seb,

"Sebastien Vauban"
<wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:

>>> * TODO Documentation
>>>
>>> Here is the LaTeX code:
>>>
>>> #+name: doc-macro-a
>>> #+begin_src latex
>>> \DescribeMacro{\dummyMacro}
>>> This macro does nothing.\index{doing nothing|usage} It is merely an
>>> example.  If this were a real macro, you would put a paragraph here
>>> describing \textbf{what} the macro is supposed to do, what its mandatory and
>>> optional arguments are, and so forth.
>>> #+end_src
>>>
>>> followed by the LaTeX output:
>>>
>>> #+results: doc-macro-a
>>> #+BEGIN_LaTeX
>>> \DescribeMacro{\dummyMacro}
>>> This macro does nothing.\index{doing nothing|usage} It is merely an
>>> example.  If this were a real macro, you would put a paragraph here
>>> describing \textbf{what} the macro is supposed to do, what its mandatory and
>>> optional arguments are, and so forth.
>>> #+END_LaTeX
>>>
>>> * Results
>>>
>>> As you can see, the code block is NEVER exported. I don't understand
>>> why?
>>
>> I'm not sure either.
>>
>> This is not a problem from the exporter as
>> `org-export-execute-babel-code' on your ECM makes the src block
>> disappear.
>>
>>> The results block is exported, but then (interpreted and) only visible in the
>>> LaTeX back-end. The HTML document is completely empty...
>>
>> I can answer that one: "#+begin_BACKEND" means "export this block when
>> using export BACKEND, otherwise ignore it". Therefore, html back-end
>> ignores the results.
>
> Yes, I agree: that second behavior is logical. I just emphasized it as,
> consequently, we can't export anything (not even the results -- though, that
> does not make much sense) to HTML, as exposed by the ECM.
>
> The only buggy behavior is the first one: the fact that the "code" block
> disappears, as you say.

I took a quick look at ob-latex.el. The code there sets `:exports
results' and then, IIUC, goes on its way without checking if :exports
has been set in the buffer.

IIRC, the main uses of LaTeX code blocks were for tangling .tex
documents, and for preview snippets. This seems to be supported by the
documentation, which says "LaTeX source code blocks can be used to
tangle a LaTeX source file, or to create bitmap images or pdf snippets
of arbitrary LaTeX code."

It looks to me like ob-latex.el would need to be revised to work with
your use case (a document about LaTeX authoring?).

hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com

  reply	other threads:[~2013-04-22 22:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-22 19:34 Sebastien Vauban
2013-04-22 20:14 ` Nicolas Goaziou
2013-04-22 21:46   ` Sebastien Vauban
2013-04-22 22:25     ` Thomas S. Dye [this message]
2013-04-24 21:32       ` Sebastien Vauban
2013-04-27  9:16       ` Sebastien Vauban
2013-04-27  9:45         ` [PATCH] " Sebastien Vauban
2013-05-03 20:40           ` Sebastien Vauban
2013-05-06 20:32           ` Eric Schulte

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=m17gjumcdz.fsf@poto.westell.com \
    --to=tsd@tsdye.com \
    --cc=public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org \
    --cc=public-wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@plane.gmane.org \
    --subject='Re: Can'\''t export LaTeX source code blocks' \
    /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

Code repositories for project(s) associated with this 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).