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 sCiuFBZyaGOrbgAAbAwnHQ (envelope-from ) for ; Mon, 07 Nov 2022 03:48:54 +0100 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 IP+jFBZyaGM03wAAauVa8A (envelope-from ) for ; Mon, 07 Nov 2022 03:48:54 +0100 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 BC45C3698A for ; Mon, 7 Nov 2022 03:48:53 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orsAm-0005Er-AR; Sun, 06 Nov 2022 21:47:40 -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 1orsAT-000565-RE for emacs-orgmode@gnu.org; Sun, 06 Nov 2022 21:47:30 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orsAO-00073r-AF for emacs-orgmode@gnu.org; Sun, 06 Nov 2022 21:47:21 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 67B85240026 for ; Mon, 7 Nov 2022 03:47:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1667789233; bh=ENcZgjnq3JAgQm6XD/p72Xo6FdbC4USIeU5KGtLtiyY=; h=From:To:Cc:Subject:Date:From; b=ILbq5XhPgAIkhXsYh0q5ghnc9UY/rgvO/h+p2OZ1Od5oCXgtNJZ7qYFSQTUwxqYkm esEqCTuo3bOzy7wjYCMC9ZSu5sVcsl/PkdM7GrxvDdiLl9SQs0vIkK8PHDf5per7qb 13Y9Ju8DXZkov4GM2k/Iy6cWHhnVtmibWmP9cvPiIOj7EXKa3Y3W3jnYy2MQnxKGnj 0lkiQ/duSkxCUSd5U6y9VHLFRNEAMCCn6ICAvQ3KPiKMDpEvnA5Y2DATOXamy1/A2D 6jLI8rqVNcFsnfcUsaIJvHP8SwI4RH12foIMWP1rwF5kN/8J26FKoTTRvLuzgyBp4r k61xDDqVeuVZQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4N5Fxq6YyQz9rxF; Mon, 7 Nov 2022 03:47:11 +0100 (CET) From: Ihor Radchenko To: =?utf-8?Q?Andr=C3=A1s?= Simonyi Cc: emacs-orgmode list Subject: Re: [PATCH] oc-csl: Improve LaTeX bibliography formatting In-Reply-To: References: Date: Mon, 07 Nov 2022 02:47:51 +0000 Message-ID: <87o7tja3ag.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.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1667789334; 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=5PbjjNVzEI5SQuVpozR8ibdiayLbv/tPr2wKOKEReoA=; b=hvAob1axq/qbRjH6wa5VaAfRJWHsosfBKb/sxpbN3KUnbOXehufT18VgRiY/hFuEodhG7A KCXeG/df/czmTpVhVdPj+n+lto4eJyHD8HXfbPiObWvnxC3+AdSceZapBh6VM1MsWAr6Dg je92kHApT3par/oBU92A3C16TjTmJeMiNcT2j9/unfDlslhqeFPkrnClMHiM/T+mW6+ASV WrMJWonWhIVxlNTwHcA/3pSrzCTLi3DFTVRZ6XQlCIOUrGGK2GI95Jof7Zqqf7BHlsQ4Wk liIUbULpEGCUwxl1PFrOLF7DaGEUNF5EdAo3cQPSZbbECShOjx0RUgV8pCpQfQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667789334; a=rsa-sha256; cv=none; b=fMjckXf7AXcJrvilfMpOcvJvf1IJlk1v2KT+o4LgXuV36EcUnji0bS/Z4NtqfjPiK8yU6D B667yYkewhduB2FV2hV9nDYmVo5p42m7ZAGai/w8TsMBDKQf2r/vcoShHmPWMDHebS/e/T Ztl2KkuqgvJ9aRFfKAV2Sc+zHlvSxhtz37IjFaBaUxH+FwmOUeqJjSPm/8Vm9AUNjxCMvF Ehvu9WAMvl1dY0zqw6sMZ39VFUvnabIdxnjrvnmzglXLeMIFuF/P1auFuVUjsn57n5vBX9 IWfqac/ig8vwRTorbGS+b9H87R4hLcSX6s35lzukqetXoAzHN/cF4beMH1AzSA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=ILbq5XhP; dmarc=pass (policy=none) header.from=posteo.net; 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: -9.00 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=ILbq5XhP; dmarc=pass (policy=none) header.from=posteo.net; 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: BC45C3698A X-Spam-Score: -9.00 X-Migadu-Scanner: scn0.migadu.com X-TUID: MDPd76dLd/2b Andr=C3=A1s Simonyi writes: > the attached patch substantially improves the formatting of CSL-based > bibliographies in LaTeX export by supporting in-style formatting > settings that were previously ignored, most importantly, > 'second-field-align', which is typically used for numeric styles such > as ieee.csl. > > I'm sending this while another oc-csl patch (about affix and locator > formatting) is still under discussion because I consider it a priority > for the 9.6 release. (Not supporting those formatting settings > rendered a large number of styles, some of them pretty popular, close > to being unusable.) Thanks for the patch! Please, document the new customization in ORG-NEWS. Also, it would be nice to describe CSL usage and tweaks in the manual. > +;; The following was inspired by and mostly follows how Pandoc's > +;; () default LaTeX template handles > +;; CSL output. Many thanks to the author, John MacFarlane! > +(defcustom org-cite-csl-latex-preamble > + "\\usepackage{calc} > +\\newlength{\\cslhangindent} > +\\setlength{\\cslhangindent}{[CSL-HANGINDENT]} > +\\newlength{\\csllabelsep} > +\\setlength{\\csllabelsep}{[CSL-LABELSEP]} > +\\newlength{\\csllabelwidth} > +\\setlength{\\csllabelwidth}{[CSL-LABELWIDTH-PER-CHAR] * [CSL-MAXLABEL-C= HARS]} > +\\newenvironment{citeprocbib}[2] % 1st arg. is hanging-indent, 2nd entry= spacing. > + {% By default, paragraphs are not indented. > + \\setlength{\\parindent}{0pt} > + % Hanging indent is turned on when first argument is 1. > + \\ifodd #1 > + \\let\\oldpar\\par > + \\def\\par{\\hangindent=3D\\cslhangindent\\oldpar} > + \\fi > + % Set entry spacing based on the second argument. > + \\setlength{\\parskip}{\\parskip + #2\\baselineskip} > + }% > + {} > +\\newcommand{\\cslblock}[1]{#1\\hfill\\break} > +\\newcommand{\\cslleftmargin}[1]{\\parbox[t]{\\csllabelsep + \\csllabelw= idth}{#1}} > +\\newcommand{\\cslrightinline}[1] > + {\\parbox[t]{\\linewidth - \\csllabelsep - \\csllabelwidth}{#1}\\break} > +\\newcommand{\\cslindent}[1]{\\hspace{\\cslhangindent}#1} > +\\makeatletter > +\\newcommand{\\citeprocitem}[2] > + {\\protect\\hyper@linkstart{cite}{citeproc_bib_item_#1}#2\\hyper@linken= d} > +\\makeatother" > + "LaTeX preamble content inserted by the `csl' citation processor. > + > +The placeholders [CSL-HANGINDENT], [CSL-LABELSEP], > +[CSL-LABELWIDTH-PER-CHAR] and [CSL-MAXLABEL-CHARS] are replaced, > +respectively, by the contents of the customizable variables > +`org-cite-csl-latex-hanging-indent', `org-cite-csl-latex-label-separator= ', > +`org-cite-csl-latex-label-width-per-char', and the maximal label length > +in the bibliography measured in characters." > + :group 'org-cite > + :type 'string > + :package-version '(Org . "9.6")) > + I have two comments here: 1. Where are all these new commands coming from? They are not used directly in the code. Are you tweaking citeproc.el output this way? May it be better to use customizations provided by citeproc.el itself? 2. You are declaring this variable as defcustom, but it is not clear what is going to happen if the user changes it. It is not how to change this template in meaningful ways either. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at