From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iO+GKYAUMmGe6QAAgWs5BA (envelope-from ) for ; Fri, 03 Sep 2021 14:26:40 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id sJudJYAUMmFNIAAA1q6Kng (envelope-from ) for ; Fri, 03 Sep 2021 12:26:40 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E25451B0A8 for ; Fri, 3 Sep 2021 14:26:39 +0200 (CEST) Received: from localhost ([::1]:39810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mM8HG-0001QJ-UH for larch@yhetil.org; Fri, 03 Sep 2021 08:26:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mM88Z-0000gf-1h for emacs-orgmode@gnu.org; Fri, 03 Sep 2021 08:17:39 -0400 Received: from ciao.gmane.io ([116.202.254.214]:60398) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mM88X-0004Wa-B7 for emacs-orgmode@gnu.org; Fri, 03 Sep 2021 08:17:38 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mM88T-00066A-EY for emacs-orgmode@gnu.org; Fri, 03 Sep 2021 14:17:33 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Maxim Nikulin Subject: Re: Bug: Percentage in caption (even escaped) does not work in LaTeX export Date: Fri, 3 Sep 2021 19:17:25 +0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 X-Woof-Bug: User input is combined with format string in org-latex-src-block In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 19 X-Spam_score: 1.9 X-Spam_bar: + X-Spam_report: (1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.888, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630672000; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=RNHsMnNJG4/oiaMGCR0cF9h9HWjd3sMG/EmV5kY+Lc4=; b=N500FJVbPOZ9kEGuUcWvYuvwfajcTgTk+K4bjmrNnJDhoG7ssW1uBeRK8HhGalZIudfdP8 7DVQJO6sG4qPuFWIhhynXDiUCpjx71/u9CNAUzEvUxIBUi++OEtSeHkrZBSDGSic16rdGf Zwk3jcGx/9YWuvZQjcH5CfW9FYQj0l+K8AfJBNYAJC77Sqx8uWYmuS1N0wAc8HSTuzPw+p xtE/22d33ETnWii77YLN47exZCarssWj8woqFZ8H2+NW15zCRfecBdn5hwERhgJnFyV+st CeQZhubowG51+YlUuwEcGb0K7rDLBRweqgAfrhr847SVzfZCmf8hPp+tITrMzA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630672000; a=rsa-sha256; cv=none; b=GEcAenB+XSGbNm4K7Ss4IJ/u1SZ3RRc5UlfXEoWWB709j0HZLfHA8X/jt/xxKXs/tEiOsl lzyBJeQdARdmasYXeqpp2ckPzSggHGIdo38pH5MeRAVWHtoRuOHFRpwAe6nm1+g5fIdDH2 r1wtujOe8sDtnI23Jgrki+spIh1/MJCbvWXzzBsG684E6j20uQMC0AIQWWScnOjx3SN5iM 2Jf4L040O9RWKdlicT3AgiL1THOePilfWaEvIQS0ACa9ssMeb2D/xDC1mjPiB+zokVtL36 YDIC++JlpgJUEKWEZBhiKZJ/A0TlZCoUoSzmi4UO1Mi4hRXTxisr8QbpE1YMGA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.82 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: E25451B0A8 X-Spam-Score: -1.82 X-Migadu-Scanner: scn0.migadu.com X-TUID: 6XKXjrUGEPxQ 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.fsf@posteo.net/, - https://orgmode.org/list/CAJ51ETqZm+8rwcOMYMh2MEXe8Si0Nzn2Wq3K55N041-RAxhSew@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))