Re: [O] Bug and quick bugfix

2019-10-13 Thread Nicolas Goaziou
Hello,

Godefroy  writes:

> I recently encountered a bug when exporting an org file to LaTeX: when
> generating a figure with a caption, the LaTeX result has the following
> shape:
>
> \begin{figure}
> …
> \caption{\label{…}
> Content of the caption}
> \end{figure}
>
> When compiling to LaTeX, the carriage return causes a indesirable white
> space in some cases. What I would expect is:
>
> \begin{figure}
> …
> \caption{Content of the caption}
> \label{…}
> \end{figure}
>
> To fix this, I have changed the org-latex--caption/label-string function
> in ox-latex.el on lines 1314 and 1315:
>
> (format (if nonfloat "\\captionof{%s}%s{%s%s}\n"
>  "\\caption%s%s{%s%s}\n")
>
> becomes
>
> (format (if nonfloat "\\captionof{%s}%s{%s}\n%s"
>  "\\caption%s%s{%s}\n%s")

IIRC, the label has to be included in the caption command. I applied
a different solution. Let me know if that works for you.

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] ox-html: add option to restore old src block behaviour?

2019-10-13 Thread Nicolas Goaziou
Hello,

Jens Lechtenboerger  writes:

> Subject: [PATCH] ox-html: Control wrapping of source lines
>
> * lisp/ox-html.el (org-html-format-code, org-html-do-format-code):
>   Use new export option :html-wrap-src-lines with variable
>   org-html-wrap-src-lines to control whether source code lines should
>   be wrapped in code elements or not.
> * doc/org-manual.org: Document the new option

Applied. Would you mind adding an ORG-NEWS entry about it?

Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug and quick bugfix

2019-10-13 Thread Ken Mankoff


On 2019-10-13 at 09:26 +02, Nicolas Goaziou  wrote...
> IIRC, the label has to be included in the caption command. I applied a
> different solution. Let me know if that works for you.

I thought so too. But I couldn't find a definitive answer for this when 
searching about this last night.

  -k.




Re: [O] [PATCH] Document "help:" Org link type in manual

2019-10-13 Thread Nicolas Goaziou
Hello,

Robert Irelan  writes:

> Patch attached

Thank you.

However, I couldn't apply your patch since manual changed quite a bit in
this area not so long ago. I adapted your patch to the new structure and
applied it.

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] ob-ocaml: Support for pretty-printed outputs

2019-10-13 Thread Nicolas Goaziou
Hello,

"Robert M. Kovacsics"  writes:

> Subject: [PATCH] ob-ocaml: Support for pretty-printed outputs
>
> E.g. the following snippet produces multiple lines of output, due to
> pretty-printing
>
>  #+BEGIN_SRC ocaml :exports code :eval no-export :results verbatim
> (* Note, no need to have parentheses around sqrt, as
> application binds the tightest *)
> let rec gamma n = if n = 0
>   then (1.0 +. sqrt 5.0) /. 2.0
>   else 1.0 /. (gamma (n-1) -. 1.0)
>
> let nums = List.map gamma (List.init 5 (fun x -> x))
>  #+END_SRC
>
>  #+NAME: gamma-tbl
>  #+RESULTS[1fd6a3e846afdef51350eb6d7ba15c6844ccc14e]:
> : val gamma : int -> float = 
> : val nums : float list =
> :   [1.6180339887498949; 1.61803398874989468; 1.61803398874989535;
> :1.61803398874989357; 1.61803398874989823]
>
> (In reality this would have 50 or so outputs, point being mathematically
> it shouldn't change, but due to floating point errors it does.)
>
> The regexp has the following problems:
>
> - The "." in group 5 (as-was) doesn't match new-lines, so it only
>   matches the first line, e.g. as a list
>   : - [1.6180339887498949, 1.61803398874989468, 1.61803398874989535,
>
> - When using "\\(.\\|\n\\)", it includes the starting indentation of the
>   list, which makes org-babel-script-escape choke (called from
>   org-babel-ocaml-read-list, from org-babel-ocaml-parse-output, from
>   org-babel-execute:ocaml, the code being modified.

Since no-one commented your patch, I applied it. I added TINYCHANGE
cookie at the end of the commit message, since I don't know if you
signed the FSF papers already.

Thank you for your contribution!

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug and quick bugfix

2019-10-13 Thread Vladimir Lomov
Hello,
** Nicolas Goaziou  [2019-10-13 09:26:42 +0200]:

> Hello,
> 
> Godefroy  writes:
> 
>> I recently encountered a bug when exporting an org file to LaTeX: when
>> generating a figure with a caption, the LaTeX result has the following
>> shape:
>>
>> \begin{figure}
>> …
>> \caption{\label{…}
>> Content of the caption}
>> \end{figure}
>>
>> When compiling to LaTeX, the carriage return causes a indesirable white
>> space in some cases. What I would expect is:
>>
>> \begin{figure}
>> …
>> \caption{Content of the caption}
>> \label{…}
>> \end{figure}
>>
>> To fix this, I have changed the org-latex--caption/label-string function
>> in ox-latex.el on lines 1314 and 1315:
>>
>> (format (if nonfloat "\\captionof{%s}%s{%s%s}\n"
>>  "\\caption%s%s{%s%s}\n")
>>
>> becomes
>>
>> (format (if nonfloat "\\captionof{%s}%s{%s}\n%s"
>>  "\\caption%s%s{%s}\n%s")
> 
> IIRC, the label has to be included in the caption command. I applied
> a different solution. Let me know if that works for you.

There is no strict rule but a general good practice: for caption
material put label command inside the caption macro. Otherwise there
might be some side effects.

> Regards,
> 
> -- 
> Nicolas Goaziou

---
WBR, Vladimir Lomov

-- 
QOTD:
"I thought I saw a unicorn on the way over, but it was just a
horse with one of the horns broken off."


signature.asc
Description: PGP signature


Re: [O] [PATCH] ox-html: add option to restore old src block behaviour?

2019-10-13 Thread Jens Lechtenboerger
On 2019-10-13, at 09:30, Nicolas Goaziou wrote:

> Jens Lechtenboerger  writes:
>
>> Subject: [PATCH] ox-html: Control wrapping of source lines
>>
>> * lisp/ox-html.el (org-html-format-code, org-html-do-format-code):
>>   Use new export option :html-wrap-src-lines with variable
>>   org-html-wrap-src-lines to control whether source code lines should
>>   be wrapped in code elements or not.
>> * doc/org-manual.org: Document the new option
>
> Applied. Would you mind adding an ORG-NEWS entry about it?

Thanks!  A patch is attached.

Best wishes
Jens

>From f2f93c573fef6a079c2f7f434e6c65d51e2f0906 Mon Sep 17 00:00:00 2001
From: Jens Lechtenboerger 
Date: Sun, 13 Oct 2019 14:06:09 +0200
Subject: [PATCH] Mention option html-wrap-src-lines in ORG-NEWS

* etc/ORG-NEWS: Mention new option html-wrap-src-lines.
---
 etc/ORG-NEWS | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 9fff4ad16..0e07326cb 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -123,6 +123,12 @@ auto-commit attachments to git:
   one need to require the =org-attach-git= module in the startup.
 
 ** New features
+*** New option to wrap source code lines in HTML export
+
+When new option ~html-wrap-src-lines~ (with variable
+~org-html-wrap-src-lines~) is non-nil, HTML export wraps source code
+lines in HTML ~code~ elements.
+
 *** New option to handle schedules and deadlines in iCalendar export
 
 Export ignore done tasks with a deadline when
-- 
2.17.1



[O] Make org-agenda-switch-to to show all parent headings

2019-10-13 Thread Joon Ro
Hi,

When I right click on an agenda item to invoke org-agenda-switch-to, it shows 
only the specific heading for the item and its top-level heading, and 
in-between headings are not shown. Is there a way to change this behavior so it 
shows all parent headings of the item? Currently I often am confused which 
parent the right-clicked item belongs to. Please see below for a minimal 
example:


Current behavior:

* Top Heading
*** TODO Heading for the right-clicked item in the agenda


Desired behavior:

* Top Heading
** Second heading
*** TODO Heading for the right-clicked item in the agenda

Best Regards,
Joon



Re: [O] Make org-agenda-switch-to to show all parent headings

2019-10-13 Thread Sebastian Miele


Joon Ro  writes:

> When I right click on an agenda item to invoke org-agenda-switch-to,
> it shows only the specific heading for the item and its top-level
> heading, and in-between headings are not shown. Is there a way to
> change this behavior so it shows all parent headings of the item?
> Currently I often am confused which parent the right-clicked item
> belongs to. Please see below for a minimal example:
>
> Current behavior:
>
> * Top Heading
> *** TODO Heading for the right-clicked item in the agenda
>
> Desired behavior:
>
> * Top Heading
> ** Second heading
> *** TODO Heading for the right-clicked item in the agenda

The variable `org-show-context-detail' probably is what you are looking
for.

Best wishes
Sebastian



[O] beamer export: misplaced \end{frame} with \lecture structure

2019-10-13 Thread Gürtler , Martin
Hi,

I was trying to use the \lecture command in latex to structure my lecture.

As org-modeis not able to convert , say, first-level headlines into
\lecture statements, I placed the \lecture statement directly before
first level headlines. Unfortunately,in the resulting tex document, the
\end{frame} statement appears only after the \lecture statement. So, in
the resulting pdf, the information about a new lecture (which is created
from a \AtBeginLecture macro) appears as part of the last slide of the
previous lecture and not as a new frame.

1. What can I do in the org mode file in order to enforce ending the
  frame before the \lecture statement.
2. Would anybody be willing to implement \lecture and maybe \part in the
  exporter?

Thanks a lot

Martin Gürtler
-- 
  Prof. Dr. rer. nat. Martin Gürtler
 Professur für Produktions- und Logistiksysteme
  H T W K Leipzig,  Fakultät Ingenieurwissenschaften
 Inst. f. Technologie und Produktion im Maschinenbau
 Tel. +49-341-3076 4129
 - Besucher -   - Post -
 Büro N234 (Nieper-Bau) PF 30 11 66
 Karl-Liebknecht-Str. 134   04251 Leipzig
 04277 Leipzig