From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id AAzICL4MlWFnwwAAgWs5BA (envelope-from ) for ; Wed, 17 Nov 2021 15:07:58 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id MMNYBL4MlWFlCwAAbx9fmQ (envelope-from ) for ; Wed, 17 Nov 2021 14:07:58 +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 C908727BB6 for ; Wed, 17 Nov 2021 15:07:56 +0100 (CET) Received: from localhost ([::1]:52906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mnLbP-0002pR-Uh for larch@yhetil.org; Wed, 17 Nov 2021 09:07:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnLai-0002or-Ia for emacs-orgmode@gnu.org; Wed, 17 Nov 2021 09:07:12 -0500 Received: from [2a00:1450:4864:20::334] (port=36715 helo=mail-wm1-x334.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mnLae-0002bv-QX for emacs-orgmode@gnu.org; Wed, 17 Nov 2021 09:07:12 -0500 Received: by mail-wm1-x334.google.com with SMTP id i8-20020a7bc948000000b0030db7b70b6bso4917081wml.1 for ; Wed, 17 Nov 2021 06:07:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=andrew.cmu.edu; s=google-2021; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=LmjjaMS66h8KVMtMuG2Nq2uPRc8ulDQgs6g8YA+AkTk=; b=hTnPYw9RFXYMwvAZzzdu2UwCkQCQTsXs1YaPsT/3+gWVcihAEt2bqhNW6ttilG6ats 6iHnjoLGS5qLFkLPYzctdHoIJTDW6IU47+iyGV4UmI0c35GkMbP3O7LkutfP1RmVHhoK TLKXdCYAtpf32tT6fsdQHZNWPYhuh96Xbk819Ud0s8wYsrwzimxN+xK/7BvhmPnlOUsY xA0TUW8JEirTTiCdZmpsIAYrAtcSMNtkxtdnXSzj6G7gCgGvrFb0edyKQVA7GD5x/FrD IehQJtQl7I2eS9YCuOQw1WF/ZYAxNn6o5njVwdhX4mgOzsObYqzNjz7bi7m5pDvRaM6z AVyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=LmjjaMS66h8KVMtMuG2Nq2uPRc8ulDQgs6g8YA+AkTk=; b=gZHDoNihaAnWOmOg+MbJAb32ioc9+WMTgiu3g6xQcQ6Uh6clil+OcMFVR/57WUrlN4 NiVEY68KiGNauCyUxO5DONbv5uib++2bvkXJcBcc7yYDEX+/HURyvjCWiqlq6UWBqfDh SRi9zP45mtqY0lyNmaYrW4PYp/A35DSGBSGkPdiP1BWoOYywFPZb78JKSbLt6mFlAiqW rjme3aR+a4fm14Tm/kNX693Xbi8lAUzrZshiTrQDaUbKLzWimZXMNrg+GCsIeJKs3LDG YNtNDoDermPuuy1EmiBsbiwShEhsYzj9Ot7NkpPyXpMrknIoVMzHlQeNc6HA3xBRQaOp lPcg== X-Gm-Message-State: AOAM532VX73IASUhS+Z/hdbmx/4opx4lCpWYh8qyWwE9Srhqxa6eVDJO 1IR07tV/teGMKFSqEmEIIXDTq5iy6Y7CBI+dmw4qmg912gM= X-Google-Smtp-Source: ABdhPJzlgfM+g/fjSxxsd+5NtbLafi+bg8Q7fZkpbi6mfRSp16/IUxBhs74UCj8Fc6EhTelp4sKQ7hs01jIZgYBKTZ8= X-Received: by 2002:a05:600c:21c3:: with SMTP id x3mr17892582wmj.13.1637158025894; Wed, 17 Nov 2021 06:07:05 -0800 (PST) MIME-Version: 1.0 References: <877dd7mdx7.fsf@mat.ucm.es> <87r1bfnln2.fsf@ucl.ac.uk> <87o86ilw9a.fsf@mat.ucm.es> In-Reply-To: <87o86ilw9a.fsf@mat.ucm.es> From: John Kitchin Date: Wed, 17 Nov 2021 09:06:54 -0500 Message-ID: Subject: Re: insert automatically a reference to a section header and a link To: org-mode-email Content-Type: multipart/alternative; boundary="000000000000931f6e05d0fc8e3f" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::334 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=johnrkitchin@gmail.com; helo=mail-wm1-x334.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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" 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=1637158077; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=LmjjaMS66h8KVMtMuG2Nq2uPRc8ulDQgs6g8YA+AkTk=; b=OFEGDLYH+Y1YL1ZxRqGVdSznbEc2X+Ntc9pX4s/kG5HLWeEfjy/4Js0VYR6nEYbyRheLQA 4HLKFN76nalBj5vl1WgI0qLoV7MPGwyrwS8ECGhZM62szLwOnF3z1lGR9EWth+XCpjrg/E ZbigzpilO/jzkzEzKTVCkZqSxiZyNUpLdKmb6f1prdJiRQhdB05T6k9+n+SmonPy7GPTNW AgjSssnMAS+MeWTRS24WloVDWPUI8PlMy1G5pC2z+Ou0KeZgSObHtx2D0o6FeFfYiTvPg7 U9i83J3sQHEIVYDx180mWA9MhlqFz18LNAIZ5ahPHZF9LgjKxyHSzmwoF2nIQA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637158077; a=rsa-sha256; cv=none; b=mOgGKAmy8XpJl462gJJrRRci7H+2ux/zpiSX7bHWp4o4OBgWRat+cW1A7xhuJtwtuSKfSI SkfzNHmUjdQz/4XDcdu4KR0kxp+/GzgJgtpZ7rCS7rWextdIlSiRO3srQl6Tj8P/lrstxo lftdY1uOEWNyliGZ5jnl85BosffIoKGuBRzeIVqYM0n+mk79aei77EDqQMepYcbHkh0SVw ZR6RSTHHPLAMPdkEvJK2WSB4qfo9UfJhnLEgOcvhWF0XrIS9ZMa2TeT9pti9nzKmBRTm68 xlLfJeQNMibH4jDYQEil7r0wN4XFEwiJGLp5Hcl5nCrPl/RfRVUPWZ/1Vhf6Mg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=andrew.cmu.edu header.s=google-2021 header.b=hTnPYw9R; 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: -4.55 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=andrew.cmu.edu header.s=google-2021 header.b=hTnPYw9R; 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: C908727BB6 X-Spam-Score: -4.55 X-Migadu-Scanner: scn0.migadu.com X-TUID: 3ZnYNZCVxrIO --000000000000931f6e05d0fc8e3f Content-Type: text/plain; charset="UTF-8" there is nothing like that that I know of. You can write your own, in org (following Eric's use of radio targets) it might look like this. (defun my-heading () (interactive) (let* ((title (string-trim (read-string "title: "))) (tokens (split-string title " " t)) (label (format "<>" (string-join (seq-take tokens (min 3 (length tokens))) "-")))) (insert (format "%s %s" label title)))) you could also insert the leading * if you prefer. John ----------------------------------- Professor John Kitchin (he/him/his) Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Wed, Nov 17, 2021 at 8:59 AM Uwe Brauer wrote: > > >>> "ESF" == Eric S Fraga writes: > > > On Wednesday, 17 Nov 2021 at 08:36, Uwe Brauer wrote: > >> In auctex+reftex it is possible that when I insert a new section header > >> a reference label is inserted automatically: > > > I do the following usually: > > > * <> Introduction > > Right, but how do you do this automatically? > > Maybe I did not explain this clearly enough: in auctex+reftex, when I > fire up the command LaTeX-section, I am > > 1. Asked for the title > > 2. And then the title *and* a label is inserted automatically. (I > can configure what is inserted to a certain extend). Usually I > obtain \section{Alternativa de Fredholm} > \label{sec:altern-de-fredh} > > > I am looking for a similar functionality in org mode > > > In section [[introduction]], I show something. > > > I prefer visible labels instead of custom IDs although the latter works > > as well but you need to say [[id:introduction]]. > > > HTH, > > eric > > > --000000000000931f6e05d0fc8e3f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
there is nothing like that that I know of. You can write y= our own, in org (following Eric's use of radio targets) it might look l= ike this.

(defun my-heading ()
=C2=A0 (interactive)=C2=A0 (let* ((title (string-trim (read-string "title: ")))
= (tokens (split-string title " " t))
(label (format "&= lt;<sec:%s>>"
(string-join
(seq-take tokens (min= 3 (length tokens)))
"-"))))
=C2=A0 =C2=A0 (insert (for= mat "%s %s" label title))))

you could=C2=A0also insert the leading * if you= prefer.

John

-----------------= ------------------
Professor John Kitchin (he/him/his)
Doherty Hall A= 207F
Department of Chemical Engineering
Carnegie Mellon UniversityPittsburgh, PA 15213
412-268-7803

=
= On Wed, Nov 17, 2021 at 8:59 AM Uwe Brauer <oub@mat.ucm.es> wrote:

>>> "ESF" =3D=3D Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> On Wednesday, 17 Nov 2021 at 08:36, Uwe Brauer wrote:
>> In auctex+reftex it is possible that when I insert a new section h= eader
>> a reference label is inserted automatically:

> I do the following usually:

> * <<introduction>> Introduction

Right, but how do you do this automatically?

Maybe I did not explain this clearly enough: in auctex+reftex, when I
fire up the command LaTeX-section, I am

=C2=A0 =C2=A0 1. Asked for the title

=C2=A0 =C2=A0 2. And then the title *and* a label is inserted automatically= . (I
=C2=A0 =C2=A0 =C2=A0 =C2=A0can configure what is inserted to a certain exte= nd). Usually I
=C2=A0 =C2=A0 =C2=A0 =C2=A0obtain \section{Alternativa de Fredholm}
=C2=A0 =C2=A0 =C2=A0 =C2=A0\label{sec:altern-de-fredh}


I am looking for a similar functionality in org mode

> In section [[introduction]], I show something.

> I prefer visible labels instead of custom IDs although the latter work= s
> as well but you need to say [[id:introduction]].

> HTH,
> eric


--000000000000931f6e05d0fc8e3f--