From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 8FR/GLwTqGVOcAEAqHPOHw:P1 (envelope-from ) for ; Wed, 17 Jan 2024 18:51:56 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 8FR/GLwTqGVOcAEAqHPOHw (envelope-from ) for ; Wed, 17 Jan 2024 18:51:56 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=QarNqA+U; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705513916; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=mkerqlsGxT4rs6V8etL8p4SAJGMC63n6mLPydAX7x24=; b=HC0BWa9kkoSNmg3fJncexdsIKUamw749cpREG7VHInJ5qZapsB9xY+99LlP3a9WmgYFgJY attjHKDcmtoYfh5mAaZTp7j/3YaPqWMe6gUlwskUdpAO+n9yPQhclXybDgQUS3KIjtURD6 ZuKxG5bJqPxEzVE6UkV/jBn5P+yt+1DWqKAwULhE6YqRPR2H/UbSmhXNpOAfhfxNjWMzB9 2MszHWMAPqyxTidiUUmSv92c3aueVC8/DfQ429UBavEH72QJeZ14IGrjZ3psaKWR87vzAY BgbTlfDSqJBg/bETXEByHHjs1RHFLwN5DAieGgbylROeBNlTt7a+ad2SUKBL7g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=QarNqA+U; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705513916; a=rsa-sha256; cv=none; b=Q6M4cmzMzVSLJZNx6FHVKrTHUfM7Z+ChWh6TjfkVhbK5/gSAGGpYr1gMchxoZVc7VXTQ5n kc28/IdQI1gAACtsqk26/yGwP8GEeDpVRYmwsoEsvuThxySEIKNM66IiHI52CzQqPCIwEx TlttC0rL28KlPwgDcb6FCmhW/tprP0d40bLZHaG0WsQ+Od411N3/SY9E/C39BcHvslZbYo zjjMgFhBfCX7SF0cB70NX6zqhrBHBMw7ywE5E6Ld/H9cjwiTCsgw8Z7FZu85gs8QNlU2pO llpSKMXNxW7wCKh9vn8AxmvzFs5bpdTqx6XEVEUkan4/2spBkeVaZlF1g0NaaA== 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 4A96055E9C for ; Wed, 17 Jan 2024 18:51:56 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQA4C-0002m5-GK; Wed, 17 Jan 2024 12:51:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQA49-0002kt-Rx for emacs-orgmode@gnu.org; Wed, 17 Jan 2024 12:51:07 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQA45-0008CV-Am for emacs-orgmode@gnu.org; Wed, 17 Jan 2024 12:51:05 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 3F8DD240103 for ; Wed, 17 Jan 2024 18:50:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1705513859; bh=p0JCzUNO6ThUxgH17Zr3fgIuxGnKKQCwuLgSsZVSznA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=QarNqA+UpAzJq7VZm1jkTJSxnXu7VbKvN5whlQS2eQY5xy1bhd8n/0SUvE1NzFhAQ myeoBi7Q2VMg58MBhIcnuRTm/E3+Dp5bxKrkiaY6T8fVlChUTTeyuoHmlPoQpMvibv tPpFVNpBUs1GbHVKxYSLWWJed60cL2UZvdGVc9ue35OBhf2tAtLApZGorugOeWibYE NXAMMBj8YyVj0O8QZLfKAA27BukZqXc0To2qmEx20M0fcFnZ30zFse5xIogOiosOJh DGmGZvJJByVRRrUAepIW5SoosweNQH5GHzLhcXkPXMPaUTUt/8Zy5Ng6Xqnt8HmabZ AKOOjDHotHViQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TFYMQ2r4Tz6tmv; Wed, 17 Jan 2024 18:50:58 +0100 (CET) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Ihor Radchenko Cc: orgmode , Max Nikulin Subject: Re: [possible patch] Remove the '\\[0pt]' string from the last line of a verse block in LaTeX export In-Reply-To: <8734uwjerg.fsf@localhost> (Ihor Radchenko's message of "Wed, 17 Jan 2024 13:00:51 +0000") References: <874jfvjo2k.fsf@posteo.net> <87cyu5uv7c.fsf@localhost> <878r4tfccn.fsf@posteo.net> <87zfx9t7di.fsf@localhost> <87wmsddlw5.fsf@posteo.net> <87r0ikrt5h.fsf@localhost> <87o7dnefwo.fsf@posteo.net> <87cyu1l69f.fsf@localhost> <87il3tax9a.fsf@posteo.net> <8734uwjerg.fsf@localhost> Date: Wed, 17 Jan 2024 17:50:52 +0000 Message-ID: <87o7dju9vn.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=maciaschain@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -10.39 X-Migadu-Scanner: mx13.migadu.com X-Spam-Score: -10.39 X-Migadu-Queue-Id: 4A96055E9C X-TUID: gRISRrdY67yp Ihor Radchenko writes: > If the idea with custom command does not have obvious downsides, it > might be a better option. In the previous thread, we only considered > redefining \\ itself - obviously a non-starter for environments that > re-define \\ by their own, like here. I find several drawbacks to adding a new latex command like \nothing. First, the standardization of the exported LaTeX code is lost. \\[0pt], at least, always compiles. A new command obviously needs to be defined first. Let's imagine that someone wants to simply share the LaTeX code of a table... Then there is the problem of how to name the new command so that it doesn't 'clash' with some user-defined command. In LaTeX it is usually good practice to use the at sign character (@) in the name of a command or macro that is not in user space, since this character can only be used in a *.sty file. In a *.tex file, if you want to use the at sign to define or redefine something, you have to enclose the code between \makeatletter...\makeatother. And, in any case, I think that the LaTeX code produced by org should be as 'universal' as possible (standard LaTeX code + packages included in TeX live), and leave the definition of new commands or environments to the user's discretion. On the other hand, we are not sure that a command like \nothing does not have some undesirable effect. I seem to remember that in the aforementioned thread, adding \relax (the typical command that is used to tell LaTeX do nothing) was also proposed as a solution, and it was discarded for some reason. >> In any case, square brackets are a problematic character in LaTeX >> (think, e.g., of some environment that takes an optional argument). I >> think pandoc chooses to always export them as {[}{]}: >> >> #+begin_src sh :results latex >> str="[hello world] [foo] [bar]" >> pandoc -f org -t latex <<< $str >> #+end_src >> >> #+RESULTS: >> #+begin_export latex >> {[}hello world{]} {[}foo{]} {[}bar{]} >> #+end_export >> >> We could do the same, but I'm afraid it's too late if >> org-latex-line-break-safe already exists... I don't remember if >> something similar was proposed in that discussion, and it was rejected >> for some reason. > > It is not too late. > > AFAIR, we just decided not to dig deeper about pandoc's approach. > > As for {[}{]}, it is a bit difficult to implement. Especially when we > also consider user filters and derived backends. If we have several > transcoders of consequent elements, there is always a risk that even > when a given filter/transcoder is generating a valid LaTeX code, > concatenating them may still cause issues like we have with \\. I see. I think pandoc's solution is what Leslie Lamport recommends (naturally, Lamport doesn't say to enclose /all/ brackets in curly braces). > I am wondering if there are other examples of commands with optional > arguments that may cause a similar problem with > > \command > [unrelated text] > > If there are, we may actually want to consider pandoc's approach > seriously. In principle, any environment that takes an optional argument in a "dangerous" position. Just do a simple test. Something like this: #+begin_figure [lorem] ipsum #+end_figure will throw an error like ''LaTeX Error: Unknown float option...'' Of course, putting an empty line after #+begin... usually solves it. But the user may not know it. There are also a number of commands with an optional argument. For example \pagebreak. Something like this will give an error: lorem @@latex:\pagebreak@@ [ipsum] \item is another typical example, but in this case org adds \relax. Best regards, Juan Manuel