From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id yJlDLf2n52KfRQEAbAwnHQ (envelope-from ) for ; Mon, 01 Aug 2022 12:16:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id GCQPLf2n52LdIAAAauVa8A (envelope-from ) for ; Mon, 01 Aug 2022 12:16:29 +0200 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 5B7511638D for ; Mon, 1 Aug 2022 12:16:29 +0200 (CEST) Received: from localhost ([::1]:43910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oISTM-0000Hq-A2 for larch@yhetil.org; Mon, 01 Aug 2022 06:16:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oISN5-0004Py-7A for emacs-orgmode@gnu.org; Mon, 01 Aug 2022 06:09:59 -0400 Received: from w4.tutanota.de ([81.3.6.165]:56870) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oISN2-0000s3-VG for emacs-orgmode@gnu.org; Mon, 01 Aug 2022 06:09:58 -0400 Received: from w3.tutanota.de (unknown [192.168.1.164]) by w4.tutanota.de (Postfix) with ESMTP id 7E38E10601E7; Mon, 1 Aug 2022 10:09:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1659348593; s=s1; d=vergauwen.me; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=517MF/yamINF2ZrokHQS8XdRaScF5dUuKSFVBA9xV2A=; b=hXaAXfqh1jgFt+pGOw29yfeLmnNrmmEth311Lej12hQHDxyV7eEQ/wC9ZgCdvkkp VFA5Dzj0OCdHxe+QEQP+HowblN+SFNx8rGXH8D8UrqLvKLQmf4rH0YJYbu7KipgYMLz FcD0M5YBWW8fnnaZnUpbcB65tGZNaSXrJHSmlA0JRDatcR6GZzI3XKofrgrn8xy0KHi 2B6pX786VgS+pmcmhEbFnNPf4JhmJYo3/2zgE8vp18uNhS2KvXcrB+Pz9jbrYQ1Rcd5 awHrujLnIOz+1IR9ZViIoHekD+wl0O1/r3OUtZIzpNlFeQWT/k0Fhvm8fU3GrIzivYC RHlJGwQTeg== Date: Mon, 1 Aug 2022 12:09:53 +0200 (CEST) To: Max Nikulin Cc: Daniel Fleischer , emacs-orgmode@gnu.org Message-ID: In-Reply-To: References: <87wnbuje62.fsf@localhost> <95786e25-53c4-93dd-b77f-0e64fc793b83@gmail.com> <87h72yj9bj.fsf@localhost> Subject: Re: [PATCH]: ox-latex: omit empty date MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_122017_319610782.1659348593215" Received-SPF: pass client-ip=81.3.6.165; envelope-from=emacs@vergauwen.me; helo=w4.tutanota.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-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" Reply-to: emacs@vergauwen.me From: emacs--- via "General discussions about Org-mode." X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1659348989; h=from:from:sender:sender:reply-to: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=517MF/yamINF2ZrokHQS8XdRaScF5dUuKSFVBA9xV2A=; b=pIos3iBjUWFX0GI7Eszm5J6vGo4Za/tsrsDqZfTTjZeA8Hs6Ewo8EtgtqHqqLnHFAhtJr/ tCoRzh8ODfN2Ivi+z02vQCxRjSZ1fFt+dL7ZjI78dpMDWWmoIsJ4ZNSJ9YBu1VFTzKdLwO OzRQssGKYmLKQbUN3V9zZWMWzgsIgKAHzoZtNOU7to6/SWI9beoqUvjYN7Ha2AdHp1XC9w hd0QRnw7ZekKH/6g1DMYlJgKFEUgB5fNpxzGFbPYSBIxbuwMTcGC5BD2bjjoxVKLF0RE+l qMYzuZjLPp9QTa9MTjcW2GxWvDTc8uOaKC974KxqzK8gxlEpa/TvxmQBULo7hA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659348989; a=rsa-sha256; cv=none; b=ZWaPklaZsK2k8UhyJj9PLObbpeASxB8ZZUbpgobxYvoI/CdDz6XcRD0LnK+s5M0ThIxVt0 Sgt8Tpk8/YLs/1JJbqFlJrE5y+Y2PjnZbyQ49bP/FQC385niBT0K5HuHPdfouZjoRUtFPG UsPed4GKYoM8j1DHx00JUCMsGVcESUa3E/VZFna3f73sT/8lFtNx1KPQnp64A1TCbGPnTV UpJ99J3CmpOdqLkWwPy9LSODibkX2YlIavb3cCmJ8MDO5dgNKi5gDu+L8Pl26mloLBtI+w 1xFapvjlArq8sF+GrJrHYgOoHQNXTq+e0I4ttx8LIubwuOgG9tSPn3PLn9K6lA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=vergauwen.me header.s=s1 header.b=hXaAXfqh; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Spam-Score: -2.02 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=vergauwen.me header.s=s1 header.b=hXaAXfqh; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Queue-Id: 5B7511638D X-Spam-Score: -2.02 X-Migadu-Scanner: scn0.migadu.com X-TUID: NnMeBM/Q1+sQ ------=_Part_122017_319610782.1659348593215 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 31/07/2022 09:38, Ihor Radchenko wrote: >> Max Nikulin writes: >> >>>> All the above makes sense. Do I miss something? >>>> >>> >>> To be precise, \date is not exported to LaTeX file, but current date >>> appears in PDF. That is why I consider the change as a breaking one. >>> >>> Try to export to PDF the following document. >>> >>> ---- >8 ---- >>> #+options: title:t >>> # #+options: date:nil >>> # #+date: >>> #+title: Title >>> test >>> ---- 8< ---- >>> >>> PDF file is produced with current date. Before the patch it was possibl= e >>> to suppress date in PDF file by removing comment for either "#+options: >>> date:nil" or for "#+date:". With current main branch HEAD some other >>> workaround is required. I think, it is not what is expected from the >>> description of the #+options: keyword: >>> >> >> Agree. I did not know about this LaTeX default. >> >> Bob, do you have any ideas? I am inclined to revert the patch. >> > > We may ask the maintainer of ox-latex Daniel Fleischer if a better way to= handle \date exists. > > Bob, could you, please, provide more detail concerning your use case and = the purpose of the patch? > I was only looking at removing the empty date command string from my tex fi= les.=C2=A0 But I acknowledge the fact that it now generates an unwanted default date i= n the=C2=A0 latex pdf file when "date:nil" is provided.=C2=A0 In my use case, my template overwrites the date command and a date should b= e=C2=A0 passed as=C2=A0 \date{day}{month}{year}. My template uses different formats for the date in different locations of t= he text.=C2=A0 E.g. copyright notice, front cover, preface,... My use case is very niche and be solved by changing my custom latex date=C2= =A0 command by renaming it as for example \mydate. Adding extra options like with_date:nil seems overkill for this small issue= .=C2=A0 A second option would be is to analyze the data format in the org file. If for example the date is specified as=C2=A0 #+date: {day}{something} and the regex \{.*\}=C2=A0 matches, then the date can be used as and we use=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (f= ormat "\\date%s\n" (org-export-data date info)))) instead of=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (f= ormat "\\date{%s}\n" (org-export-data date info)))) This is non breaking and would not require any extra options to be passed o= n to the exporter.=C2=A0 In this case, the date can also be suppressed by using=C2=A0 #+date: {} Kind regards, Bob ------=_Part_122017_319610782.1659348593215 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 31/07/2022 09:38, Ihor Radchenko wrote:
Max Nikulin writes:
All the above makes sense. Do I miss something?

To be precise, \date is not exported to LaTeX = file, but current date
appears in PDF. That is why I consider= the change as a breaking one.

Try to export t= o PDF the following document.

---- >8 ----<= br>
#+options: title:t
# #+options: date:nil
# #+date:
#+title: Title
test
=
---- 8< ----

PDF file is produced with= current date. Before the patch it was possible
to suppress d= ate in PDF file by removing comment for either "#+options:
da= te:nil" or for "#+date:". With current main branch HEAD some other
workaround is required. I think, it is not what is expected from the<= br>
description of the #+options: keyword:
=

Agree. I did not know about this LaTeX default.

Bob, do you have any ideas? I am inclined to revert t= he patch.

We may ask the maintain= er of ox-latex Daniel Fleischer if a better way to handle \date exists.
=

Bob, could you, please, provide more detail conce= rning your use case and the purpose of the patch?
I was only looking at removing the empty date command string= from my tex files. 
But I acknowledge the = fact that it now generates an unwanted default date in the 
<= div dir=3D"auto">latex pdf file when "date:nil" is provided. 

In my use case, my template = overwrites the date command and a date should be 
passed as 
\date{day}{month}{year}.<= br>
My template uses different formats for the date = in different locations of the text. 
E.g. c= opyright notice, front cover, preface,...

My use case is very niche and be so= lved by changing my custom latex date 
comm= and by renaming it as for example \mydate.

Adding extra options like with_date:nil seems = overkill for this small issue. 

<= div dir=3D"auto">A second option would be is to analyze the data format in = the org file.
If for example the date is specifi= ed as 
#+date: {day}{something}
and the regex \{.*\}  matches, then the date can be us= ed as
and we use 
             = (format "\\date%s\n" (org-export-data date info))))
instead of 
    &nb= sp;        (format "\\date{%s}\n" (org-e= xport-data date info))))

This is non breaking and would not require any extra options to be pas= sed on to the exporter. 
In this case, the = date can also be suppressed by using 
#+dat= e: {}

Kind regards,<= br>
Bob
------=_Part_122017_319610782.1659348593215--