From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id KDZBBqqPw146ZQAA0tVLHw (envelope-from ) for ; Tue, 19 May 2020 07:50:02 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id yKThAaqPw152GwAAbx9fmQ (envelope-from ) for ; Tue, 19 May 2020 07:50:02 +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 80304940363 for ; Tue, 19 May 2020 07:50:01 +0000 (UTC) Received: from localhost ([::1]:57952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jax0i-0005y2-GX for larch@yhetil.org; Tue, 19 May 2020 03:50:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jax0I-0005xg-J5 for emacs-orgmode@gnu.org; Tue, 19 May 2020 03:49:34 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:40274) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jax0H-00074E-GJ for emacs-orgmode@gnu.org; Tue, 19 May 2020 03:49:34 -0400 Received: by mail-pg1-x536.google.com with SMTP id j21so6003032pgb.7 for ; Tue, 19 May 2020 00:49:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:message-id:in-reply-to:references:subject :mime-version; bh=ZSrBYwunRnC6YHqM6kpY5nJSzR5bHJSe3/c0IM4QaPQ=; b=J3+Hnkx6J+5uJWDEZDQ/j6AHmSP7VyzjzwDV2wTirWBgQbkQUFiWUTOcwJkf9Gv3Aw YqGeVtMJJGfvPxVpagTUy+0QWjBSdiqucAJyeoosXxM8TP34xw9srO2LblRwvW9p3Ay0 w/BWb0XpEnDJxAFgTgZTMTd2SdQ3je2gmlBGttEtSfj8YIU0vdiOYoc+sTkpGFQqCUrq AJecSyXwiYrv1YiWkvCMUgwcTTUe7I7Oce2LyJv/fBvSuEVNYChHXEdGrj2JAA7wyHAq fF7G0Hv4i00IDKtknRMiSUsDbhEUGk4o0Fu0HsV1ZITLsp8N8DqX+1uYi8rKHm+Vkn7f FTIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to :references:subject:mime-version; bh=ZSrBYwunRnC6YHqM6kpY5nJSzR5bHJSe3/c0IM4QaPQ=; b=mzW/+8if1lq6afak7XQylKePKYTNIgnj+tDpdFBX0EfJDC7r9BTb+l2GN0VdzRNg8j elCgwMuOOCwiho+1Y54zyvcJeFc6Y1vw3pulm/gpX+fgHpn+xDMB7ip3eRppaeadEGo8 FdWUBfOkmdvs8B1ZbTy6QACAWly2Tto9SHhFd2BpJ37jVIr/hEimwaYF0nYkuGbq+VFC qjro19ID5YmL5N8Y7woev2TRltDRej066Pi4jCw7PcdPBL5ye0RZ/i9zlMMqxI5PCC0a ApOuDQKC0l47A++Cd2eSZ585wDfDq3uJFrx1YidLELtSdfwds4toQ9UQJe8r9ylVvj3Y 4Sow== X-Gm-Message-State: AOAM533fknUzo21RpiYhwqcrAd4iBvNbOmTncrXA8xWSVE/wPqCV5w4W kOnACa5h9ZLNHPYhiFaM0ouT7OBh X-Google-Smtp-Source: ABdhPJx5XnzL4j+ufmPT0837kvnbIxs3lf3QL4rAclIwxD9x5vnszAlWJdR7bORwKkfT7Ye+EJvNNA== X-Received: by 2002:a62:34c1:: with SMTP id b184mr20143465pfa.73.1589874571499; Tue, 19 May 2020 00:49:31 -0700 (PDT) Received: from tranquillity (180-150-91-8.b4965b.per.nbn.aussiebb.net. [180.150.91.8]) by smtp.gmail.com with ESMTPSA id h4sm1465768pje.29.2020.05.19.00.49.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 May 2020 00:49:30 -0700 (PDT) Date: Tue, 19 May 2020 15:49:26 +0800 From: Timothy To: Nicolas Goaziou Message-ID: <6D5F9F2B-7450-4D15-B069-213255C2EC0F@getmailspring.com> In-Reply-To: <875zcsl712.fsf@nicolasgoaziou.fr> References: <875zcsl712.fsf@nicolasgoaziou.fr> Subject: Re: (Feature Request) customise LaTeX-preview regex X-Mailer: Mailspring MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="5ec38f86_778e45c9_8ce" Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=tecosaur@gmail.com; helo=mail-pg1-x536.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: , Cc: "=?utf-8?Q?emacs-orgmode=40gnu.org?=" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=J3+Hnkx6; dmarc=pass (policy=none) header.from=gmail.com; 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-Spam-Score: -0.50 X-TUID: +L90WDynsnR7 --5ec38f86_778e45c9_8ce Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Nicolas, Thanks for getting back to me on this. With regard to > I think you can preview =5Cce=7B...=7D just fine, with appropriate LaTe= X headers. I'm entirely likely to be missing something, however from a minimal test = in a document I'm unable to get org-latex-preview to do anything with the= following: =23+LATEX=5FHEADER: =5Cusepackage=7Bmhchem=7D =5Cce=7BCO2=7D =40=40latex:=5Cce=7BCO2=7D=40=40 > This should not be possible. Org cannot recognize all LaTeX syntax. If > you cannot preview it, Org does not understand it. IOW, it would be > a poor experience if you preview something that doesn't exist, e.g., > upon exporting the document. in a doc My thoughts were that perhaps what works for =5C( ... =5C) and =5C=5B ...= =5C=5D (in terms of org-latex-preview) could be extended to other forms = of inline LaTeX as well=3F Given your response I'm guessing there are technical challenges with this= =3F =46YI it seems to work fine for exporting (see image below), I'd just qui= te like to benefit from the visual tidiness achieved by the current LaTeX= maths fragment rendering. Oh, it just comes to mind that you may be referring to non-TeX-based outp= ut formats, where I can see that this could be a huge hassle. Once again, (at this point in time) I am very loosely familiar with the i= nnards of org (I've just stumbled around loking for specifics with C-h f = / C-h v), so if I look like I'm making any strange/outragous statements, please app= ly a substantial pinch of salt :D Timothy On May 19 2020, at 3:26 pm, Nicolas Goaziou wr= ote: > Hello, Timothy writes: > This time, I'm wanting to be able to use the l= ovely org latex preview functionality for more than just the default bloc= ks. > =46or instance, I'm interested in applying it to mhchem =5Cce=7B =E2= =80=A6 =7D > fragments, as well as siunitx =5CSI=7B =E2=80=A6 =7D=7B =E2=80= =A6 =7D. I think you can preview =5Cce=7B...=7D just fine, with appropria= te LaTeX headers. > I thought modifying org-latex-regexps may do the tric= k, yet despite > trying a few different things, I was confused when unabl= e to get it to > work. It looks like I'm being confounded by the fact tha= t > org-format-latex doesn't even reference org-latex-regexps, and instea= d > uses it's own hard-coded regexps. > Hopefully it may be possible to t= weak this so that once can preview > more than just the defaults hardcode= d into org-format-latex. This should not be possible. Org cannot recogniz= e all LaTeX syntax. If you cannot preview it, Org does not understand it.= IOW, it would be a poor experience if you preview something that doesn't= exist, e.g., upon exporting the document. OTOH, nothing prevents an exte= rnal library to allow previewing any LaTeX code (probably re-using AucTeX= facilities). Regards, -- Nicolas Goaziou --5ec38f86_778e45c9_8ce Content-Type: multipart/related; boundary="5ec38f86_4aeb4e3d_8ce" --5ec38f86_4aeb4e3d_8ce Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Hi Nicolas,

Thanks for getting back to me on this. Wit= h regard to
> I think you can preview =5Cc= e=7B...=7D just fine, with appropriate LaTeX headers.
=
I'm entirely likely to be missing something, however from a mini= mal test in a document I'm unable to get org-latex-preview to do anything with the following= :
=23+LATEX=5FHEADER: =5Cusepackage=7Bmhchem=7D
=5Cce=7BCO2=7D= =40=40latex:=5Cce=7BCO2=7D=40=40
>= This should not be possible. Org cannot recognize all LaTeX syntax. If
> you cannot preview it, Org = does not understand it. IOW, it would be
> a poor experience if you preview something that doesn't ex= ist, e.g.,
> upon exporting = the document.
in a doc
My thoughts were= that perhaps what works for =5C( ... =5C) and =5C=5B ... =5C=5D (in term= s of org-latex-preview) could be extended to other forms of inline LaTeX = as well=3F
Given your response I'm guessing there are technical= challenges with this=3F
=46YI it seems to work fine for export= ing (see image below), I'd just quite like to benefit from the visual tid= iness achieved by the current LaTeX maths fragment rendering.
<= img alt=3D=22=22 src=3D=22cid:mcid-d4e31b73-07fa=22>
Oh, it jus= t comes to mind that you may be referring to non-TeX-based output formats= , where I can see that this could be a huge hassle.

Once ag= ain, (at this point in time) I am very loosely familiar with the innards = of org (I've just stumbled around loking for specifics with C-h f / C-h v= ),
so if I look like I'm making any strange/outragous statement= s, please apply a substantial pinch of salt :D

Timothy
On May 19 2020, at 3:26 pm, Nicolas Goaziou <mail=40nicolasgoazio= u.fr> wrote:
Hello, Timothy writes: > This ti= me, I'm wanting to be able to use the lovely org latex preview functional= ity for more than just the default blocks. > =46or instance, I'm inter= ested in applying it to mhchem =5Cce=7B =E2=80=A6 =7D > fragments, as = well as siunitx =5CSI=7B =E2=80=A6 =7D=7B =E2=80=A6 =7D. I think you can = preview =5Cce=7B...=7D just fine, with appropriate LaTeX headers. > I = thought modifying org-latex-regexps may do the trick, yet despite > tr= ying a few different things, I was confused when unable to get it to >= work. It looks like I'm being confounded by the fact that > org-forma= t-latex doesn't even reference org-latex-regexps, and instead > uses i= t's own hard-coded regexps. > Hopefully it may be possible to tweak th= is so that once can preview > more than just the defaults hardcoded in= to org-format-latex. This should not be possible. Org cannot recognize al= l LaTeX syntax. If you cannot preview it, Org does not understand it. IOW= , it would be a poor experience if you preview something that doesn't exi= st, e.g., upon exporting the document. OTOH, nothing prevents an external= library to allow previewing any LaTeX code (probably re-using AucTeX fac= ilities). Regards, -- Nicolas Goaziou
--5ec38f86_4aeb4e3d_8ce Content-Type: image/png Content-Transfer-Encoding: base64 Content-ID: Content-Disposition: inline; filename="Pasted File.png" iVBORw0KGgoAAAANSUhEUgAAAL8AAAA5CAIAAADoYW2UAAAHjElEQVR4Ae1bX0hTXxw/d+piXmvp xK0ViU2NSirC/lg6MjFiT9JLQW8ZYfWSlBD0FhU9FGQUVtBDhLSFIg1JSkLtISUroZpobaCtltiq Nbu1a/Oe6Hd+Xcbddrt/N28790HO+Z7v59zP53s+u7u750pACAE+cAUkVUAnCYVBuAK/K4Ddg30g vQLYPdJrh5HYPdgD0iuA3SO9dhiJ3YM9IL0C2D3Sa4eR2D3YA9IrgN0jvXYYid2DPSC9Atg90muH kdg92APSK4DdI712GIndgz0gvQLYPdJrh5HYPdgD0iuA3SO9dhiZnf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