Subject: mailing-list for TeXmacs Users
List archive
Re: [TeXmacs] Numbering of enumeration lists and numbering of references to labels
Chronological Thread
From : Giovanni Piredda <address@hidden>- To: address@hidden
- Subject: Re: [TeXmacs] Numbering of enumeration lists and numbering of references to labels
- Date: Wed, 27 Mar 2019 16:32:31 +0100
And by the way it is also possible to edit the file generated by
TeXmacs with a text editor and add the macro definition just after
the <\body> command. So the liens between (and excluding
:-) ) %%%%%%, saved into a file, should be readable by TeXmacs: %%%%%% <TeXmacs|1.99.8>
%%%%%% As well the following should be a valid style file: %%%%%% <TeXmacs|1.99.8> <style|<tuple|source|german>> <\body> <assign|eqref|<macro|lab|Equation <reference|<arg|lab>>>> \; </body> <initial|<\collection> </collection>> %%%%%% Am 26.03.2019 um 22:44 schrieb Giovanni
Piredda:
It is possible to do it with a style file, to load, or it is also possible within the same document, to test things quickly: from the menu: tools, macros, edit preamble (not edit macros, I am not able to get that to work as well!), and then again deselect edit preamble to go back to normal editing.
I used the following guide for writing macros: http://www.texmacs.org/Tutorial/Editing/Chapter4.html and some help from this too: https://www.mindomo.com/de/mindmap/texmacs-b207992c90c046bdbe4053cbdf88b5d5and I have to fight a bit too because I can't get everything straight at the first attempt; but eventually it works :-) The definition with the style file has worked more promptly than the definition using the "edit preamble" menu item.
G. Am 26.03.2019 um 22:33 schrieb Marc
Mertens:
Thanks all for your solutions, I will try them out. To be honest I have never defined my own macros so I have first to learn how to define them. Am I correct that I first have to define my own style file to define a macro? I saw in tools a macro editor but I could not use it to define the eqref macro. Thanks in advance Marc Mertens On Tue, 2019-03-26 at 10:07 +0100, Massimiliano Gubinelli wrote: As for the first question. I did a small research, relevant macros to the handling of lists and enumerations are contained in TeXmacs/packages/standard/std-list.ts in particular a new counter is defined via <new-counter|item> which in turn defines a series of macros to handle the counter like <reset-item> <the-item> <inc-item> if you want to reset the counter at an arbitrary number, you have to add this at the beginning of the new environment <assign|<counter-item>|10> for example. Note that this has to really be at the beginning of the enumerate environment, in particular before the first item. Note also that <counter-item> is a macro which returns the name of the variable which contains the counter. Best MaxOn 26. Mar 2019, at 03:26, Giovanni Piredda <address@hidden> wrote: I know one way of getting what you want for the second question, but it is not completely automatic. You can define and load the following macro: <assign|eqref|<macro|lab|Equation <reference|<arg|lab>>>> (and similar ones for theorems, propositions and so on) and use it in place of the \reference macro. The advantange of using \eqref with respect to typing everytime "Equation \reference" is that it will ensure consistent formatting. I suspect there is a way to write a macro to automatically recognize the type of reference and format it according to type, like the cleveref package for LaTeX, but - at least for now - it is too complicated for me to figure it out. Giovanni Am 25.03.2019 um 19:49 schrieb Marc Mertens:Hello, I have two questions concerning TexMacs. The first is about the numbering of enumeration list, when I insert a enumeration it always start at 1, a, i etc. Is it possible to specify the start numbering at a different number. The second is of the numbering of references. When you insert a label for a theorem, proposition etc or a displayed formula and reference to it the references used the same x.y format for both. So sometimes you have to confusion that for example a reference displays the same number (for example 10.14) but in one case it refers to a theorem and in the other case it references to a displayed formula. You can not seen the difference. Is it somehow possible to display for the reference to display 'eq 10.14' if it refers to a displayed formula and 'theorem 10.14' if it refers to a theorem (and likewise for lemmas, propositions ...). I searched in the manual but could not found a way to do this two things. Thanks in advance for a possible answer and also for a excellent math editor. Marc Mertens |
- [TeXmacs] Numbering of enumeration lists and numbering of references to labels, Marc Mertens, 03/25/2019
- Re: [TeXmacs] Numbering of enumeration lists and numbering of references to labels, Giovanni Piredda, 03/26/2019
- Re: [TeXmacs] Numbering of enumeration lists and numbering of references to labels, Massimiliano Gubinelli, 03/26/2019
- Re: [TeXmacs] Numbering of enumeration lists and numbering of references to labels, Giovanni Piredda, 03/26/2019
- Re: [TeXmacs] Numbering of enumeration lists and numbering of references to labels, Marc Mertens, 03/26/2019
- Re: [TeXmacs] Numbering of enumeration lists and numbering of references to labels, Giovanni Piredda, 03/26/2019
- Re: [TeXmacs] Numbering of enumeration lists and numbering of references to labels, Giovanni Piredda, 03/27/2019
- Re: [TeXmacs] Numbering of enumeration lists and numbering of references to labels, Marc Mertens, 03/27/2019
- Re: [TeXmacs] Numbering of enumeration lists and numbering of references to labels, Giovanni Piredda, 03/27/2019
- Re: [TeXmacs] Numbering of enumeration lists and numbering of references to labels, Marc Mertens, 03/28/2019
- Re: [TeXmacs] Numbering of enumeration lists and numbering of references to labels, Massimiliano Gubinelli, 03/28/2019
- Re: [TeXmacs] Numbering of enumeration lists and numbering of references to labels, Marc Mertens, 03/27/2019
- Re: [TeXmacs] Numbering of enumeration lists and numbering of references to labels, Giovanni Piredda, 03/27/2019
- Re: [TeXmacs] Numbering of enumeration lists and numbering of references to labels, Giovanni Piredda, 03/26/2019
- Re: [TeXmacs] Numbering of enumeration lists and numbering of references to labels, Massimiliano Gubinelli, 03/26/2019
- Re: [TeXmacs] Numbering of enumeration lists and numbering of references to labels, Giovanni Piredda, 03/26/2019
Archive powered by MHonArc 2.6.19.