Re: Bug: Percentage in caption (even escaped) does not work in LaTeX export

2022-10-06 Thread Ihor Radchenko
Timothy  writes:

> This should be finally fixed in
>  when it’s merged.

The referenced patch has been applied, and the bug should be fully
resolved on main now.
Fixed.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Bug: Percentage in caption (even escaped) does not work in LaTeX export

2022-05-08 Thread Timothy
Hi All,

This should be finally fixed in
 when it’s merged.

All the best,
Timothy


Re: Bug: Percentage in caption (even escaped) does not work in LaTeX export

2021-09-30 Thread Max Nikulin

On 25/09/2021 23:04, Bastien wrote:

(I'm marking this as a confirmed bug, even if a first patch as been applied.)


Since it was there earlier, it is tracked twice now:
- User input is combined with format string in org-latex-src-block
- Bug: Percentage in caption does not work in LaTeX export

Let's assume that one entry is to fix "minted" and another one for 
"listings" environment. Though one more obscure issue remains: 
"multicolumn" option does do what can be expected from its name.





Re: Bug: Percentage in caption (even escaped) does not work in LaTeX export

2021-09-25 Thread Bastien
(I'm marking this as a confirmed bug, even if a first patch as been applied.)



Re: Bug: Percentage in caption (even escaped) does not work in LaTeX export

2021-09-03 Thread Maxim Nikulin

On 30/07/2021 22:00, Charest, Luc wrote:

    I simplified the problem down to :

#+CAPTION: Org Mode works 99.99\% of the time.
#+BEGIN_SRC -n
// this is only a proof of concept
#+END_SRC

As soon as I put the percentage sign in the caption, the LaTeX export 
backend fails with this message :


org-latex-src-block: Not enough arguments for format string


Confirmed

User input is combined with format string in `org-latex-src-block' so 
percent character in caption is treated as a format specifier. Maybe 
emacs versions newer than 26 does not throw an error on extra specifier 
with missed argument. =:latex-cation-above nil= might still cause 
corrupted LaTeX code.


Code of `org-latex-src-block' is quite convoluted to provide a quick 
fix. Besides particular reported case it is better to check variants 
with listings and minted packages, custom environment.


Absence of language and line numbering option are irrelevant. Backslash 
before percent likely should not be used in Org files. My minimal example


#+caption: User input "%S" is combined with format string
#+begin_src emacs-lisp
  t
#+end_src

P.S. "Not enough arguments for format string" error usually means that a 
string provided by user is passed as format or incorrect number of 
arguments is specified for a format-like function. The former case is a 
quite frequent mistake:

- https://orgmode.org/list/87bl5tzof2@posteo.net/,
- 
https://orgmode.org/list/caj51etqzm+8rwcomymh2mexe8si0nzn2wq3k55n041-raxh...@mail.gmail.com/ 
(vs. correct variant 
https://emacs.stackexchange.com/questions/38276/get-description-of-an-org-mode-link).


Use

(defun my-safe-fun (msg)
 (message "%s" msg))

not just

(defun not-a-fun (msg)
 (message msg))





RE: Bug: Percentage in caption (even escaped) does not work in LaTeX export

2021-08-31 Thread Charest, Luc
Hello Timothy,

   Yeah, I tried, and it did not worked.

   I had exchanged emails with Eric, we came to the conclusion that the source 
of the problem might be a clash between my emacs version 26 and an updated 
version of the org-mode. I have to try to update my emacs to see where it goes 
from there, but have to find some time to do it.

   I was thinking also I might had screw up my installation some time ago by 
attempting to install Org-roam. It stopped at some point complaining about not 
finding the database, which, from what I understand, was supposed to be 
downloaded and compiled manually.

   Anyway, I'll try updating my emacs with a fresh install, I'll keep you 
inform. 

Thank you for the follow-up ! 

-Message d'origine-
De : Timothy  
Envoyé : 31 août 2021 11:38
À : Charest, Luc 
Cc : Eric S Fraga ; emacs-orgmode@gnu.org
Objet : Re: Bug: Percentage in caption (even escaped) does not work in LaTeX 
export

[You don't often get email from tecos...@gmail.com. Learn why this is important 
at http://aka.ms/LearnAboutSenderIdentification.]

Courriel provenant de l'externe
ATTENTION, avant d'accéder à une pièce jointe ou à un lien de ce courriel, 
assurez-vous que celui-ci provient d'un tiers de confiance.

Hi Luc,

Eric wrote:
> What happens if you do specify a language?
>
> If I specify a language, the export is fine with % unescaped, by the 
> way.

Have you been able to give this a shot?

All the best,
Timothy



Re: Bug: Percentage in caption (even escaped) does not work in LaTeX export

2021-08-31 Thread Timothy
Hi Luc,

Eric wrote:
> What happens if you do specify a language?
>
> If I specify a language, the export is fine with % unescaped, by the
> way.

Have you been able to give this a shot?

All the best,
Timothy


Re: Bug: Percentage in caption (even escaped) does not work in LaTeX export

2021-08-03 Thread Eric S Fraga
On Friday, 30 Jul 2021 at 15:00, Charest, Luc wrote:
>I simplified the problem down to :
>
> #+CAPTION: Org Mode works 99.99\% of the time.
> #+BEGIN_SRC -n
>
> // this is only a proof of concept
> #+END_SRC
>
> As soon as I put the percentage sign in the caption, the LaTeX export backend 
> fails with this message :
>
> org-latex-src-block: Not enough arguments for format string

whereas for me it fails because no language was given for the src block,
i.e. different error message in the latex compilation.  What happens if
you do specify a language?

If I specify a language, the export is fine with % unescaped, by the
way.

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.6-607-g185706
: Latest paper written in org: https://arxiv.org/abs/2106.05096



Bug: Percentage in caption (even escaped) does not work in LaTeX export

2021-08-03 Thread Charest, Luc

Hello,

   I simplified the problem down to :

#+CAPTION: Org Mode works 99.99\% of the time.
#+BEGIN_SRC -n
// this is only a proof of concept
#+END_SRC

As soon as I put the percentage sign in the caption, the LaTeX export backend 
fails with this message :

org-latex-src-block: Not enough arguments for format string

I tried "%", "\%", "\\%", "%%"... nothing works !

If I get it wrong, sorry but please update the documentation accordingly, as I 
found nothing in the specs regarding this matter specifically.

My versions :
Emacs  : GNU Emacs 26.2 (build 1, x86_64-w64-mingw32)
of 2019-04-13
Package: Org mode version 9.4.6 (9.4.6-4-g093c94-elpa)

Thanks !

[http://www.hydroquebec.com/images/logo-hqp-courriel.gif]

Luc Charest
Conseiller Optimisation I
Optimisation Modélisation Mathématique
Direction Production et Exploitation
Hydro-Québec Production
Édifice Jean-Lesage
75, boulevard René-Lévesque Ouest, 9e étage
Montréal (Québec) H2Z 1A4
Tél. : 514 289-2211,7049
Interne0-289-7049
www.hydroquebec.com
[http://www.hydroquebec.com/images/2019g289-signature-courriel-bandeau.gif]