emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* A question/bug report(?)
@ 2022-03-26  7:58 Pedro Andres Aranda Gutierrez
  2022-03-29 13:12 ` Eric S Fraga
  0 siblings, 1 reply; 6+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2022-03-26  7:58 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1424 bytes --]

Hi,

I'm using org-mode mainly to generate LaTEX (both documents and
presentations). I'd like to know if there is any way to flag that the
contents of an EXAMPLE block should be passed RAW to LaTEX.
I need this to be able to include my colouring commands in some listings,
which otherwise break because some things like '...' are translated to
\ldots, etc.

An example:

#+ATTR_LATEX: :options [fontsize=\small,frame=single,commandchars=\\!|]
#+BEGIN_verbatim
\GreenLst!student@juju|:~$ sudo usermod -aG lxd $(whoami)
student@juju:~$ newgrp lxd
student@juju:~$ lxd init --auto
student@juju:~$ lxc network set lxdbr0 ipv6.address none
#+END_verbatim

Translates into:

\begin{verbatim}[fontsize=\small,frame=single,commandchars=\\!|]
\GreenLst!student@juju|:\textasciitilde{}\$ sudo usermod -aG lxd \((whoami)
student@juju:~\) newgrp lxd
student@juju:\textasciitilde{}\$ lxd init --auto
student@juju:\textasciitilde{}\$ lxc network set lxdbr0 ipv6.address none
\end{verbatim}

Where
\((whoami)
is obviously wrong.

Emacs 28.0.92 built yesterday.

GNU Emacs 28.0.92 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20,
cairo version 1.16.0) of 2022-03-23

Thanks a ton, /PA

-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet

[-- Attachment #2: Type: text/html, Size: 2151 bytes --]

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

* Re: A question/bug report(?)
  2022-03-26  7:58 A question/bug report(?) Pedro Andres Aranda Gutierrez
@ 2022-03-29 13:12 ` Eric S Fraga
  2022-03-29 14:44   ` Max Nikulin
  2022-03-30  5:14   ` Pedro Andres Aranda Gutierrez
  0 siblings, 2 replies; 6+ messages in thread
From: Eric S Fraga @ 2022-03-29 13:12 UTC (permalink / raw)
  To: Pedro Andres Aranda Gutierrez; +Cc: emacs-orgmode

I'm not sure but maybe you want to use a src block,

#+begin_src latex :exports results
...
#+end_src

?  I am not entirely clear how you wish org to know what is "raw" and
what is "LaTeX".

-- 
: Eric S Fraga, with org release_9.5.2-420-g971eb6 in Emacs 29.0.50


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

* Re: A question/bug report(?)
  2022-03-29 13:12 ` Eric S Fraga
@ 2022-03-29 14:44   ` Max Nikulin
  2022-03-29 15:04     ` Eric S Fraga
  2022-03-30  5:14   ` Pedro Andres Aranda Gutierrez
  1 sibling, 1 reply; 6+ messages in thread
From: Max Nikulin @ 2022-03-29 14:44 UTC (permalink / raw)
  To: emacs-orgmode

On 29/03/2022 20:12, Eric S Fraga wrote:
> I'm not sure but maybe you want to use a src block,
> 
> #+begin_src latex :exports results
> ...
> #+end_src
> 
> ?  I am not entirely clear how you wish org to know what is "raw" and
> what is "LaTeX".

If LaTeX is the only export target then a more simple way exists:

#+begin_export latex
   any arbitrary LaTeX code
#+end_export

info "(org) Quoting LaTeX code" 
https://orgmode.org/manual/Quoting-LaTeX-code.html



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

* Re: A question/bug report(?)
  2022-03-29 14:44   ` Max Nikulin
@ 2022-03-29 15:04     ` Eric S Fraga
  0 siblings, 0 replies; 6+ messages in thread
From: Eric S Fraga @ 2022-03-29 15:04 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

On Tuesday, 29 Mar 2022 at 21:44, Max Nikulin wrote:
> If LaTeX is the only export target then a more simple way exists:
>
> #+begin_export latex

Yes, of course!

-- 
: Eric S Fraga, with org release_9.5.2-420-g971eb6 in Emacs 29.0.50


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

* Re: A question/bug report(?)
  2022-03-29 13:12 ` Eric S Fraga
  2022-03-29 14:44   ` Max Nikulin
@ 2022-03-30  5:14   ` Pedro Andres Aranda Gutierrez
  2022-03-30  7:05     ` Max Nikulin
  1 sibling, 1 reply; 6+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2022-03-30  5:14 UTC (permalink / raw)
  To: Org Mode List

[-- Attachment #1: Type: text/plain, Size: 1333 bytes --]

Hi Eric,

Thanks for answering :-) I'm currently solving the issue with

#+BEGIN_export LaTeX
\begin{verbatim}[commandchars=\\\{\}]
student@juju:~$ \textbf{sudo bootstrap-juju.sh}
\end{verbatim}
#+END_export

What I was wondering is whether we could have something like:

#+ATTR_LATEX :raw t :attributes [commandchars=\\\{\}]
#+BEGIN_verbatim
student@juju:~$ \textbf{sudo bootstrap-juju.sh}
#+END_verbatim

With that ":raw t" the text between the BEGIN_ and END_ would not go
through the protecttexttt function. (of course, without the :raw t
everything would work as today).

Again, it's just because it would be a cleaner to read. I have an yasnippet
in place, so it wouldn't actually mean more or less typing.

Best, /PA


On Tue, 29 Mar 2022 at 15:12, Eric S Fraga <e.fraga@ucl.ac.uk> wrote:

> I'm not sure but maybe you want to use a src block,
>
> #+begin_src latex :exports results
> ...
> #+end_src
>
> ?  I am not entirely clear how you wish org to know what is "raw" and
> what is "LaTeX".
>
> --
> : Eric S Fraga, with org release_9.5.2-420-g971eb6 in Emacs 29.0.50
>


-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet

[-- Attachment #2: Type: text/html, Size: 2332 bytes --]

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

* Re: A question/bug report(?)
  2022-03-30  5:14   ` Pedro Andres Aranda Gutierrez
@ 2022-03-30  7:05     ` Max Nikulin
  0 siblings, 0 replies; 6+ messages in thread
From: Max Nikulin @ 2022-03-30  7:05 UTC (permalink / raw)
  To: emacs-orgmode

On 30/03/2022 12:14, Pedro Andres Aranda Gutierrez wrote:
> 
> Thanks for answering :-) I'm currently solving the issue with
> 
> #+BEGIN_export LaTeX
> \begin{verbatim}[commandchars=\\\{\}]
> student@juju:~$ \textbf{sudo bootstrap-juju.sh}
> \end{verbatim}
> #+END_export
> 
> What I was wondering is whether we could have something like:
> 
> #+ATTR_LATEX :raw t :attributes [commandchars=\\\{\}]
> #+BEGIN_verbatim
> student@juju:~$ \textbf{sudo bootstrap-juju.sh}
> #+END_verbatim

I think, it is better to add :attributes parameter support to 
#+begin_example block. It may be added to org, for a while you can use a 
custom derived backend. See info "(org) Advanced Export Configuration" 
https://orgmode.org/manual/Advanced-Export-Configuration.html

You need to define an example-block filter, current implementation is 
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/ox-latex.el#n1853

I never tried it but perhaps it is possible to customize the listings 
LaTeX package for automatic highlighting of text after shell prompt. In 
Org #+begin_src blocks may use lstlisting environment.



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

end of thread, other threads:[~2022-03-30  7:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-26  7:58 A question/bug report(?) Pedro Andres Aranda Gutierrez
2022-03-29 13:12 ` Eric S Fraga
2022-03-29 14:44   ` Max Nikulin
2022-03-29 15:04     ` Eric S Fraga
2022-03-30  5:14   ` Pedro Andres Aranda Gutierrez
2022-03-30  7:05     ` Max Nikulin

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).