emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: "Sébastien Vauban" <wxhgmqzgwmuf@spammotel.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: Org-special-blocks for code chunks
Date: Thu, 13 Aug 2009 07:13:52 -0600	[thread overview]
Message-ID: <m2y6pnhn5b.fsf@gmail.com> (raw)
In-Reply-To: <87prb0yphr.fsf@mundaneum.com> ("Sébastien Vauban"'s message of "Thu, 13 Aug 2009 12:31:12 +0200")

Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> writes:

[...]

>
> Look, I've done an ECM with the different ways I currently see for Org-mode:
>

I haven't followed this whole thread, so please forgive me if I'm
duplicating information.  With the latest Org-mode from git, regular
source-code blocks can be exported into the lstlisting LaTeX
environment.  I mention this because it does not appear as an option in
your ECM.  For instructions see
http://orgmode.org/worg/org-faq.php#fontified_source_code_w_latex

-- Eric

>
> * Org
>
> *** A. To escape the \_
> ***** 1. No marking at all
> \begin{lstlisting}
> months_employed(?applicant, ?months)
> \end{lstlisting}
> ***** 2. Literal LaTeX code
> #+LaTeX: \begin{lstlisting}
> months_employed(?applicant, ?months)
> #+LaTeX: \end{lstlisting}
> ***** 3. Lines between markers
> #+BEGIN_LaTeX
> \begin{lstlisting}
> months_employed(?applicant, ?months)
> \end{lstlisting}
> #+END_LaTeX
> ***** 4. Org-special-blocks
> #+BEGIN_lstlisting
> months_employed(?applicant, ?months)
> #+END_lstlisting
>
> *** B. Or not to escape the _?
> ***** 1. No marking at all
> \begin{lstlisting}
> months\_employed(?applicant, ?months)
> \end{lstlisting}
> ***** 2. Literal LaTeX code
> #+LaTeX: \begin{lstlisting}
> months\_employed(?applicant, ?months)
> #+LaTeX: \end{lstlisting}
> ***** 3. Lines between markers
> #+BEGIN_LaTeX
> \begin{lstlisting}
> months\_employed(?applicant, ?months)
> \end{lstlisting}
> #+END_LaTeX
> ***** 4. Org-special-blocks
> #+BEGIN_lstlisting
> months\_employed(?applicant, ?months)
> #+END_lstlisting
>
>
> Without org-special-blocks, I have such LaTeX generated:
>
> % Created 2009-08-13 Thu 12:07
> \documentclass[final]{mcreport}
> \usepackage[utf8x]{inputenc}
> \usepackage[T1]{fontenc}
> \usepackage{graphicx}
> \usepackage{longtable}
> \usepackage{hyperref}
> \usepackage{xcolor}
> \usepackage{listings}
>
> \title{ecm-escape}
> \author{Fabrice Niessen}
> \date{13 August 2009}
>
> \begin{document}
>
> \maketitle
>
> \setcounter{tocdepth}{3}
> \tableofcontents
> \vspace*{1cm}
> \section{Org}
> \label{sec-1}
>
>
> \subsection{A. To escape the \_}
> \label{sec-1.1}
>
> \subsubsection{1. No marking at all}
> \label{sec-1.1.1}
>
> \begin{lstlisting}
> months_employed(?applicant, ?months)
> \end{lstlisting}
> \subsubsection{2. Literal \LaTeX{} code}
> \label{sec-1.1.2}
>
> \begin{lstlisting}
> months_employed(?applicant, ?months)
> \end{lstlisting}
> \subsubsection{3. Lines between markers}
> \label{sec-1.1.3}
>
> \begin{lstlisting}
> months_employed(?applicant, ?months)
> \end{lstlisting}
> \subsubsection{4. Org-special-blocks}
> \label{sec-1.1.4}
>
> months$_{\mathrm{employed}}$(?applicant, ?months)
>
> \subsection{B. Or not to escape the _?}
> \label{sec-1.2}
>
> \subsubsection{1. No marking at all}
> \label{sec-1.2.1}
>
> \begin{lstlisting}
> months\_employed(?applicant, ?months)
> \end{lstlisting}
> \subsubsection{2. Literal \LaTeX{} code}
> \label{sec-1.2.2}
>
> \begin{lstlisting}
> months\_employed(?applicant, ?months)
> \end{lstlisting}
> \subsubsection{3. Lines between markers}
> \label{sec-1.2.3}
>
> \begin{lstlisting}
> months\_employed(?applicant, ?months)
> \end{lstlisting}
> \subsubsection{4. Org-special-blocks}
> \label{sec-1.2.4}
>
> months\_employed(?applicant, ?months)
>
> \end{document}
>
>
> With org-special-blocks turned on, I have:
>
> % Created 2009-08-13 Thu 12:10
> \documentclass[final]{mcreport}
> \usepackage[utf8x]{inputenc}
> \usepackage[T1]{fontenc}
> \usepackage{graphicx}
> \usepackage{longtable}
> \usepackage{hyperref}
> \usepackage{xcolor}
> \usepackage{listings}
>
> \title{ecm-escape}
> \author{Fabrice Niessen}
> \date{13 August 2009}
>
> \begin{document}
>
> \maketitle
>
> \setcounter{tocdepth}{3}
> \tableofcontents
> \vspace*{1cm}
> \section{Org}
> \label{sec-1}
>
>
> \subsection{A. To escape the \_}
> \label{sec-1.1}
>
> \subsubsection{1. No marking at all}
> \label{sec-1.1.1}
>
> \begin{lstlisting}
> months_employed(?applicant, ?months)
> \end{lstlisting}
> \subsubsection{2. Literal \LaTeX{} code}
> \label{sec-1.1.2}
>
> \begin{lstlisting}
> months_employed(?applicant, ?months)
> \end{lstlisting}
> \subsubsection{3. Lines between markers}
> \label{sec-1.1.3}
>
> \begin{\LaTeX{}}
> \begin{lstlisting}
> months_employed(?applicant, ?months)
> \end{lstlisting}
> \end{\LaTeX{}}
> \subsubsection{4. Org-special-blocks}
> \label{sec-1.1.4}
>
> \begin{lstlisting}
> months$_{\mathrm{employed}}$(?applicant, ?months)
> \end{lstlisting}
>
> \subsection{B. Or not to escape the _?}
> \label{sec-1.2}
>
> \subsubsection{1. No marking at all}
> \label{sec-1.2.1}
>
> \begin{lstlisting}
> months\_employed(?applicant, ?months)
> \end{lstlisting}
> \subsubsection{2. Literal \LaTeX{} code}
> \label{sec-1.2.2}
>
> \begin{lstlisting}
> months\_employed(?applicant, ?months)
> \end{lstlisting}
> \subsubsection{3. Lines between markers}
> \label{sec-1.2.3}
>
> \begin{\LaTeX{}}
> \begin{lstlisting}
> months\_employed(?applicant, ?months)
> \end{lstlisting}
> \end{\LaTeX{}}
> \subsubsection{4. Org-special-blocks}
> \label{sec-1.2.4}
>
> \begin{lstlisting}
> months\_employed(?applicant, ?months)
> \end{lstlisting}
>
> \end{document}
>
>
> Conclusions?
>
> - Org-special-blocks seems to misbehave in cases A3/B3 (adding an unsound
>   environment) and A4 (letting the underscore being converted);
>
> - Cases 1 and 2 always work as expected: producing me what I want for the "A
>   series", and something expected (but not what I want to see in the document)
>   for the "B series" (just there for informative purpose -- because, anyway, I
>   don't wanna see the underscore, nowhere, neither having to type it, neither
>   printing it in the docs);
>
> - Cases A1 and A3 are the nicest to read in Org: code chunks are highlighted
>   differently.
>
> - Though, case A1 is not very friendly: nothing tells I'm inline LaTeX code
>   (what about other exports, as HTML and the like?)
>
> - Thought, case A2 is the one I currently choose for the slides I'm producing,
>   as it both works whenever org-special-blocks is activated and when it's not.
>
> Any comments?
>
> Seb

      parent reply	other threads:[~2009-08-13 13:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-11 15:41 Org-special-blocks for code chunks Sébastien Vauban
2009-08-11 16:51 ` Chris Gray
2009-08-13 10:31   ` Sébastien Vauban
2009-08-13 11:56     ` Chris Gray
2009-08-13 12:23       ` Sébastien Vauban
2009-08-13 13:13     ` Eric Schulte [this message]

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=m2y6pnhn5b.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=wxhgmqzgwmuf@spammotel.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).