From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.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 iKymKYiNpmWbdAEAe85BDQ:P1 (envelope-from ) for ; Tue, 16 Jan 2024 15:07:04 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id iKymKYiNpmWbdAEAe85BDQ (envelope-from ) for ; Tue, 16 Jan 2024 15:07:04 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=drgPbFIR; 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=1705414024; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=lCRhMhbVq5zIcLVMKMG9WBO61QOaWNYCz2+32/ARm1k=; b=K5IordjuJzsqKjqLx9jR2jH1XWXnRIgGpuWxcxXIerpOAAeoTgKKgcD+A8yItP73+cdtzo mRBV4LPmvVDPhwmoePxkjgTMfc0QwqeZ4WU3i9w7AXRkFJsHIPUpMn6in4Q0cvFwn3EYqI BZfWPRaYSW+PJvrxM8qCr0lwNIt99k2lV7bDqh3ANYuZjOA5V+wXRwdebnaupWKTYVbf+u DOEfMAi+w6v/PW2XdrviW9IF5YqeEMXU9qdSLGuF3SqSlRfd/ORqQstVzaa6PJDoyZVFbS tdsU4pIZT36WbWd0YxW8sDBXoP9mkg9GYRo65sPM19NYYYOJSs6n/QJRxRUUgw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=drgPbFIR; 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=1705414024; a=rsa-sha256; cv=none; b=bmOCGXQJdGddvWRdGf3B8Cq+AbsWsnrgQVf2IVRcYnksayki0FGH3DY4g+OGHrLyP206UB Lk+kX5l9BJ3GKlnfgj28Gx58xp6XAlOp19RRPcvUtjS9gFy8mFs0CC3t/m3zGX3cvgj+Ds +l+8YF3NKf3w3RmBrc8q7tatwcE6TcbQHJNGe2FcvfRvp7tkHNtV2s5RCdGxY8pdv/dAp0 NcVtn6CN5vwEZIkASCT9Act0WPOLDz8EZ7VW/rM23fTMVyL6WMMlWwZbtxhJwhYSWpKbTv iHAGZ+HqSbfCSeEjzK2tTOaICOhmomztz7YhJxus8ac8sYLQZ3bkvSrlw4BjXA== 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 7D25356A31 for ; Tue, 16 Jan 2024 15:07:04 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rPk54-000311-QQ; Tue, 16 Jan 2024 09:06:19 -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 1rPk4x-00030U-61 for emacs-orgmode@gnu.org; Tue, 16 Jan 2024 09:06:12 -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 1rPk4s-0005xR-6Y for emacs-orgmode@gnu.org; Tue, 16 Jan 2024 09:06:10 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id E0E3D240103 for ; Tue, 16 Jan 2024 15:06:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1705413963; bh=G0nYSMDRXMzSe6LYNHyqhqBFw7kB/BuHejctRorVdHY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=drgPbFIRA5yMNn9X0aoVpb67NKjlLXCdXSZvZfOtjjne+J/baoiSd5RIsrKtUyZPh nRbxBcFfK69va+VM79sDj/oDcHgElyLJXOzV81CIiPFG5TUWXIZDZLKPYYLqYJSCkr CzJ8gE1Lfrfv2Ly65EqnY5Rm1BvKPIrvSC2dGwYp5Z6Pz1i3FShcuLUfARsP6qQqCZ aN/HRch3ez7J+Tn9s3EarMZEH7n5D7DktNMcKwPBuG11S6aGMU1sDBlMffYl5+gM87 q9rrGsbOH2I6lFnh2zuEJjtsTG5SgRdLi8LM/ZoXl9k/qY2B4lKyUVM2IlgIZZGqaf C+DObTObXwZvA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TDrQL57y5z6tx8; Tue, 16 Jan 2024 15:06:02 +0100 (CET) From: Ihor Radchenko To: Juan Manuel =?utf-8?Q?Mac=C3=ADas?= Cc: orgmode Subject: Re: [possible patch] Remove the '\\[0pt]' string from the last line of a verse block in LaTeX export In-Reply-To: <87o7dnefwo.fsf@posteo.net> 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> Date: Tue, 16 Jan 2024 14:09:16 +0000 Message-ID: <87cyu1l69f.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@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: -9.89 X-Migadu-Scanner: mx13.migadu.com X-Spam-Score: -9.89 X-Migadu-Queue-Id: 7D25356A31 X-TUID: xYzt7A+hVTW1 Juan Manuel Mac=C3=ADas writes: >>> If I'm not mistaken, in TeX '\\' can only be used in horizontal mode: >>> that is, within a paragraph. At the end of an environment like verse >>> (\end{verse}) you are forced to enter vertical mode, and a new paragraph >>> starts. >> >> Is it true for any environment? Or just some? > > In principle, nothing prevents one from defining an environment for use > in horizontal mode (within the paragraph). E.g.: > ... > But the usual thing is that the beginning/end of an environment changes to > vertical mode, with \par or something more elaborate. This is annoying. ox-latex has some transcoders that unconditionally add \\ at the end: clocks and planning lines. If they happen to be at the end of an environment, it can be problematic. > hmm... I don't know if this should be considered a bug. We may think > that \\[0pt] should never do anything, but we must keep in mind that the > end of the verse environment is the end of a paragraph, and it changes > to vertical mode. And the end of a paragraph is an illogical place to > put that command. But it seems that it also alters things when it is at > that point. Check out this reply from David Carlisle > (https://tex.stackexchange.com/a/82666): The very reason we use \\[0pt] is because it supposed to prevent interpreting [...] at the new line/transcoded element as argument. You demonstrated that it is yet not always safe enough. May it be better to use something like \newcommand\nothing{} \newcommand{\safenewline}{\\\nothing} And then use \safenewline instead of \\[0pt] In my tests, \begin{center} \begin{tabular}{ll} [t] & s\safenewline [I] & A\safenewline [m] & kg\safenewline \end{tabular} \end{center} Does not suffer from misinterpreting new line as argument. > If there are environments that redefine \\, such as verse or tabular, > probably putting the optional argument of \\ with a value of 0pt at the > end of verse alters the calculation of the normal space after the > environment, making it shorter. I think that here we would not have a > LaTeX bug, because the syntax of the verse environment itself says that > the last line should not carry any \\ mark.=20 AFAIU, \safenewline should still use re-defined version of \\ according to the context. > At the end of the tables I have not noticed any side effects. But in the > export of the verse block, I would be in favor of somehow eliminating > that last \\[0pt]. `org-latex-verse-block' already has a giant regexp replacement: ;; In a verse environment, add a line break to each newline ;; character and change each white space at beginning of a line ;; into a normal space, calculated with `\fontdimen2\font'. One ;; or more blank lines between lines are exported as a single ;; blank line. If the `:lines' attribute is used, the last ;; verse of each stanza ends with the string `\\!', according to ;; the syntax of the `verse' package. The separation between ;; stanzas can be controlled with the length `\stanzaskip', of ;; the aforementioned package. If the `:literal' attribute is ;; used, all blank lines are preserved and exported as ;; `\vspace*{\baselineskip}', including the blank lines before ;; or after CONTENTS. We may as well strip the trailing \\[0pt] there. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at