Dear ConTeXters, 1/ I would like to use a named formula with a reference containing several subformulae each with a reference. The closer I can get to is to add an empty namedformula followed by subformulae (see test file below). How can I get rid of the empty line with a number in the pdf ? 2/ I'm using bookmarks but abbreviations in heads do not work properly. I've used a workaround some 3 years ago but I cannot remember which. Any suggestion ? (see test file below) 3/ What should I do to get the bookmarks numbered with their chapter/section/ etc. number ? (see test file below) 4/ How can I redefine the \vec command in my formulae without having a warning "system : command \vec is already defined" 5/ I do like a lot the minimum distribution so easy to install. It would be even better if bibtex can be added. It's only 82.8 KiB Thanks for ConTeXt (special thanks to Hans and Taco of course), it's really a pleasure to work with it. Regards, Seb test.tex %%%%% %>< %>< %>< %%%%% \setupinteraction[state=start] \placebookmarks[chapter,section,subsection] \abbreviation [UK] {UK} {United Kingdom of Great Britain and Northern Ireland} \starttext \placelist[formula] \chapter{Math formulae} \placenamedformula [eq:well_known] {Well known equalities} \startformula \stopformula \placesubformula[eq:first]{a} \startformula 1+0=1 \stopformula \placesubformula[eq:second]{b} \startformula 1+1=2 \stopformula \chapter{Weather in the \UK} \dorecurse {2} {\input dawkins \par} \stoptext
On Sun, 29 Oct 2006, Sebastian Rooks wrote:
Dear ConTeXters,
1/ I would like to use a named formula with a reference containing several subformulae each with a reference. The closer I can get to is to add an empty namedformula followed by subformulae (see test file below). How can I get rid of the empty line with a number in the pdf ?
I took a different approach to this. I had written some macros that do automatic subformula numbering, and I added a macro there to do have a named subformulas. See the code at the end.
4/ How can I redefine the \vec command in my formulae without having a warning "system : command \vec is already defined"
\def\vec#1{whatever} will not give you a warning. You get a warning only if you use \define.
5/ I do like a lot the minimum distribution so easy to install. It would be even better if bibtex can be added. It's only 82.8 KiB
bibtex is part of the minimal distribution for windows. It is in texmf-mswin/bin/ Now, coming back to the code for subformulas. I defined a \startnamedsubformulas[tag]{name} to take care of "named" subformulas. This is build on top of an existing \startsubformulas ... \stopsubformulas that do automatic numbering of subformulas. See the examples in the end. \unprotect \definesystemvariable {fn} % subForMulas % Suggestion by Hans to use fn %D \macros{setupsubformulas} \def\setupsubformulas {\dodoubleargument\getparameters[\??fn]} \definenumber [parent\v!formula] \def\subformulaconversion#1% {\getnumber[parent\v!formula]% \@@fnseparator% \convertnumber{\@@fnconversion}{#1}} \defineconversion[sub\v!formula\c!conversion][\subformulaconversion] %D \macros{startsubformulas} \def\startsubformulas% {\dosingleempty\dostartsubformulas} \def\dostartsubformulas[#1]% {\incrementnumber[\v!formula] \makesectionnumber[\v!formula] \iffirstargument \rawreference{\s!for}{#1}{\composedsectionnumber} \fi \expanded{\setupnumber [parent\v!formula] [start={\rawnumber[\v!formula]}, \c!way=\@@fmway, conversion=\@@fmconversion]} \savenumber[\v!formula] \bgroup \setupformulas[\c!conversion=sub\v!formula\c!conversion,\c!way=\v!by\v!text] \resetnumber[\v!formula]} \def\stopsubformulas% {\restorenumber[\v!formula] \resetlastlinewidth \nonoindentation \dochecknextindentation{\??fn}% \egroup \dorechecknextindentation} % here ? % I have just copied the indentation checking from \stopformulas. I am not % sure on how this works. I did not change this to take care of side % floats %D Named subformulas \def\startnamedsubformulas% {\dosingleempty\dostartnamedsubformulas} \def\dostartnamedsubformulas[#1]#2% {\iffirstargument \def\next{\startsubformulas[#1]}% \else \let\next\startsubformulas \fi \setformulalistentry{#2}% \next} \def\stopnamedsubformulas{\stopsubformulas} \setupsubformulas [\c!conversion=\v!character, \c!separator=\@@fmseparator, \c!indentnext=\@@fmindentnext] \protect %D Possible features %D * One should be able to refer to the subformula number, without the formula %D number, e.g., see equations 3a--c. %D * Allow %D a = b 1 %D c = d 2.a %D e = f 2.b %D g = h 3 %D Algorithm do do this automatically %D flag = previous_subnumbered ; %D \let\afterNR\relax %D previous_subnumbered = false ; %D for (each row) %D if (subnumber_present_row == true) %D if (previous_subnumbered == true) %D \def\afterNR{\decrementnumber[formula]} %D end %D previous_subnumbered = true ; %D else %D previous_subnumbered = false ; %D end % Examples \starttext \placelist[formula] \section{Math Formulas} \startnamedsubformulas[eq:well_known]{Well Known Equalities} \placeformula[eq:first] \startformula 1 + 0 = 1 \stopformula \placeformula[eq:second] \startformula 1 + 1 = 2 \stopformula \stopnamedsubformulas \page Other examples from an email discussion with Mojca. \startbuffer \placeformula \startformula a^2 + b^2 = c^2 \stopformula \stopbuffer \setupsubformulas [conversion=romannumerals] \startsubformulas[Maxwell] \placeformula \startformulas \startformula \startalign \NC \nabla\cdot\bf E \NC = \frac{\rho}{\varepsilon_0} \NR[Maxwell 1] \NC \nabla\times\bf E \NC = - \frac{\partial\bf B}{\partial t} \NR[Maxwell II] \stopalign \stopformula \startformula \startalign \NC \nabla\cdot \bf B \NC = 0 \NR[Maxwell III] \NC \nabla\times\bf B \NC = \mu_0{\bf j}+\varepsilon_0\mu_0\frac{\partial\bf E}{\partial t} \NR[Maxwell IV] \stopalign \stopformula \stopformulas \stopsubformulas Maxwell : \in [Maxwell] II : \in [Maxwell II] \section{conversion} \setupformulas [conversion=character] \setupsubformulas [conversion=n] \getbuffer \startsubformulas[subformula] \dorecurse{2}{\getbuffer} \placeformula[my x formula] \startformula x \stopformula \stopsubformulas \placeformula[my y formula] \startformula y \stopformula reference for subformula: \in [subformula] reference for x: \in [my x formula] reference for y: \in [my y formula] \setupformulas[way=bysection] \section{a} \getbuffer \startsubformulas \dorecurse{2}{\getbuffer} \placeformula[my x2 formula] \startformula x \stopformula \stopsubformulas \placeformula[my y2 formula] \startformula y \stopformula reference for x: \in [my x2 formula] reference for y: \in [my y2 formula] \stoptext
Hi Aditya, Aditya Mahajan wrote:
1/ I would like to use a named formula with a reference containing several subformulae each with a reference. The closer I can get to is to add an empty namedformula followed by subformulae (see test file below). How can I get rid of the empty line with a number in the pdf ?
I took a different approach to this. I had written some macros that do automatic subformula numbering, and I added a macro there to do have a named subformulas. See the code at the end. Works very well thank you. Can I add this to the wiki ?
5/ I do like a lot the minimum distribution so easy to install. It would be even better if bibtex can be added. It's only 82.8 KiB
bibtex is part of the minimal distribution for windows. It is in texmf-mswin/bin/ It's not in texmf-linux for the stable release.
Thank you for your help. Regards, Sebastian
On Sun, 29 Oct 2006, Sebastian Rooks wrote:
Hi Aditya,
Aditya Mahajan wrote:
1/ I would like to use a named formula with a reference containing several subformulae each with a reference. The closer I can get to is to add an empty namedformula followed by subformulae (see test file below). How can I get rid of the empty line with a number in the pdf ?
I took a different approach to this. I had written some macros that do automatic subformula numbering, and I added a macro there to do have a named subformulas. See the code at the end. Works very well thank you. Can I add this to the wiki ?
Sure, but with a note that this will end up in the core eventually. Aditya
Hi Sebastian,
2006/10/29, Sebastian Rooks
Dear ConTeXters,
1/ I would like to use a named formula with a reference containing several subformulae each with a reference. The closer I can get to is to add an empty namedformula followed by subformulae (see test file below). How can I get rid of the empty line with a number in the pdf ?
2/ I'm using bookmarks but abbreviations in heads do not work properly. I've used a workaround some 3 years ago but I cannot remember which. Any suggestion ? (see test file below)
\setupinteraction[state=start] \appendtoks \def\UK{UK} \to \simplifiedcommands \placebookmarks[chapter,section,subsection] \abbreviation [UK] {UK} {United Kingdom of Great Britain and Northern Ireland} \starttext \chapter{Weather in the \UK} \dorecurse {2} {\input dawkins \par} \stoptext 3/ What should I do to get the bookmarks numbered with their
chapter/section/ etc. number ? (see test file below)
4/ How can I redefine the \vec command in my formulae without having a warning "system : command \vec is already defined"
5/ I do like a lot the minimum distribution so easy to install. It would be even better if bibtex can be added. It's only 82.8 KiB
Thanks for ConTeXt (special thanks to Hans and Taco of course), it's really a pleasure to work with it.
Regards,
Seb
test.tex %%%%% %>< %>< %>< %%%%%
\setupinteraction[state=start]
\placebookmarks[chapter,section,subsection]
\abbreviation [UK] {UK} {United Kingdom of Great Britain and Northern Ireland}
\starttext \placelist[formula] \chapter{Math formulae}
\placenamedformula [eq:well_known] {Well known equalities} \startformula \stopformula \placesubformula[eq:first]{a} \startformula 1+0=1 \stopformula
\placesubformula[eq:second]{b} \startformula 1+1=2 \stopformula
\chapter{Weather in the \UK} \dorecurse {2} {\input dawkins \par}
\stoptext _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Wolfgang
On Tue, 31 Oct 2006, Wolfgang Schuster wrote:
2006/10/29, Sebastian Rooks
: 2/ I'm using bookmarks but abbreviations in heads do not work properly. I've used a workaround some 3 years ago but I cannot remember which. Any suggestion ? (see test file below)
\appendtoks \def\UK{UK} \to \simplifiedcommands
Why doesn't \doglobal\appendtoks\setvalue{#2}{#2}\to\simplifiedcommands line in the definition of dodocomplexsynonym do this automatically? Aditya
On Tue, 31 Oct 2006 15:55:08 -0500 (EST)
Aditya Mahajan
On Tue, 31 Oct 2006, Wolfgang Schuster wrote:
2006/10/29, Sebastian Rooks
: 2/ I'm using bookmarks but abbreviations in heads do not work properly. I've used a workaround some 3 years ago but I cannot remember which. Any suggestion ? (see test file below)
\appendtoks \def\UK{UK} \to \simplifiedcommands
Why doesn't
\doglobal\appendtoks\setvalue{#2}{#2}\to\simplifiedcommands
line in the definition of dodocomplexsynonym do this automatically?
Hi Aditya, this was new to me. You are right, this did work as expected but only when you place the definition of the abbreviation and the \placebookmarks command in the right order. The following order in the souce works. \abbreviation [UK] {UK} {United Kingdom of Great Britain and Northern Ireland} \placebookmarks[chapter,section,subsection] The problems is, the token register \simplifiedcommands is called by the \placebookmarks command and every abbreviations, that follows after the command is ignored. Wolfgang
On Thu, 2 Nov 2006, Wolfgang Schuster wrote:
On Tue, 31 Oct 2006 15:55:08 -0500 (EST) Aditya Mahajan
wrote: On Tue, 31 Oct 2006, Wolfgang Schuster wrote:
2006/10/29, Sebastian Rooks
: 2/ I'm using bookmarks but abbreviations in heads do not work properly. I've used a workaround some 3 years ago but I cannot remember which. Any suggestion ? (see test file below)
\appendtoks \def\UK{UK} \to \simplifiedcommands
Why doesn't
\doglobal\appendtoks\setvalue{#2}{#2}\to\simplifiedcommands
line in the definition of dodocomplexsynonym do this automatically?
Hi Aditya,
this was new to me.
You are right, this did work as expected but only when you place the definition of the abbreviation and the \placebookmarks command in the right order.
The following order in the souce works.
\abbreviation [UK] {UK} {United Kingdom of Great Britain and Northern Ireland}
\placebookmarks[chapter,section,subsection]
The problems is, the token register \simplifiedcommands is called by the \placebookmarks command and every abbreviations, that follows after the command is ignored.
I will call this a bug. Typically, in my workflow, \placebookmark will go in the environment file (or the module) and \abbreviation will be in the main file. Hans, is there someway to make sure that this works even when abbreviations are defined after \placebookmark. Postponing to processing to everystarttext comes to mind, but I do not know how rugged that will be. Aditya
Thank you ! Any tip for getting numbered bookmarks (question 3) ? Regards, Seb Wolfgang Schuster wrote:
Hi Sebastian,
2006/10/29, Sebastian Rooks
mailto:sebastian.rooks@free.fr>: Dear ConTeXters,
1/ I would like to use a named formula with a reference containing several subformulae each with a reference. The closer I can get to is to add an empty namedformula followed by subformulae (see test file below). How can I get rid of the empty line with a number in the pdf ?
2/ I'm using bookmarks but abbreviations in heads do not work properly. I've used a workaround some 3 years ago but I cannot remember which. Any suggestion ? (see test file below)
\setupinteraction[state=start]
\appendtoks \def\UK{UK} \to \simplifiedcommands
\placebookmarks[chapter,section,subsection]
\abbreviation [UK] {UK} {United Kingdom of Great Britain and Northern Ireland}
\starttext
\chapter{Weather in the \UK} \dorecurse {2} {\input dawkins \par}
\stoptext
3/ What should I do to get the bookmarks numbered with their chapter/section/ etc. number ? (see test file below)
4/ How can I redefine the \vec command in my formulae without having a warning "system : command \vec is already defined"
5/ I do like a lot the minimum distribution so easy to install. It would be even better if bibtex can be added. It's only 82.8 KiB
Thanks for ConTeXt (special thanks to Hans and Taco of course), it's really a pleasure to work with it.
Regards,
Seb
test.tex %%%%% %>< %>< %>< %%%%%
\setupinteraction[state=start]
\placebookmarks[chapter,section,subsection]
\abbreviation [UK] {UK} {United Kingdom of Great Britain and Northern Ireland}
\starttext \placelist[formula] \chapter{Math formulae}
\placenamedformula [eq:well_known] {Well known equalities} \startformula \stopformula \placesubformula[eq:first]{a} \startformula 1+0=1 \stopformula
\placesubformula[eq:second]{b} \startformula 1+1=2 \stopformula
\chapter{Weather in the \UK} \dorecurse {2} {\input dawkins \par}
\stoptext _______________________________________________ ntg-context mailing list ntg-context@ntg.nl mailto:ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context http://www.ntg.nl/mailman/listinfo/ntg-context
Wolfgang
------------------------------------------------------------------------
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
On Wed, 01 Nov 2006 23:57:21 +0000
Sebastian Rooks
Thank you ! Any tip for getting numbered bookmarks (question 3) ? Regards,
Seb
Wolfgang Schuster wrote:
Hi Sebastian,
2006/10/29, Sebastian Rooks
mailto:sebastian.rooks@free.fr>: Dear ConTeXters,
1/ I would like to use a named formula with a reference containing several subformulae each with a reference. The closer I can get to is to add an empty namedformula followed by subformulae (see test file below). How can I get rid of the empty line with a number in the pdf ?
2/ I'm using bookmarks but abbreviations in heads do not work properly. I've used a workaround some 3 years ago but I cannot remember which. Any suggestion ? (see test file below)
\setupinteraction[state=start]
\appendtoks \def\UK{UK} \to \simplifiedcommands
\placebookmarks[chapter,section,subsection]
\abbreviation [UK] {UK} {United Kingdom of Great Britain and Northern Ireland}
\starttext
\chapter{Weather in the \UK} \dorecurse {2} {\input dawkins \par}
\stoptext
3/ What should I do to get the bookmarks numbered with their chapter/section/ etc. number ? (see test file below)
4/ How can I redefine the \vec command in my formulae without having a warning "system : command \vec is already defined"
5/ I do like a lot the minimum distribution so easy to install. It would be even better if bibtex can be added. It's only 82.8 KiB
Thanks for ConTeXt (special thanks to Hans and Taco of course), it's really a pleasure to work with it.
Regards,
Seb
test.tex %%%%% %>< %>< %>< %%%%%
\setupinteraction[state=start]
\placebookmarks[chapter,section,subsection]
\abbreviation [UK] {UK} {United Kingdom of Great Britain and Northern Ireland}
\starttext \placelist[formula] \chapter{Math formulae}
\placenamedformula [eq:well_known] {Well known equalities} \startformula \stopformula \placesubformula[eq:first]{a} \startformula 1+0=1 \stopformula
\placesubformula[eq:second]{b} \startformula 1+1=2 \stopformula
\chapter{Weather in the \UK} \dorecurse {2} {\input dawkins \par}
\stoptext _______________________________________________ ntg-context mailing list ntg-context@ntg.nl mailto:ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context http://www.ntg.nl/mailman/listinfo/ntg-context
Wolfgang
Hi Sebastian, I found now solution to your problem. There was the same question on the list 1998 and Hans gave only a not working solution, dont't know if there was also working one. The original message: <message> Berend de Boer wrote:
Is it possible (and how) to have the chapter and paragraph numbers in the bookmark (outline) for pdf output?
Now I only get the text of the chapter but I would like the part.chapter.paragraph number as well.
(did you ever try \tracebookmarkstrue?) \def\doinsertsomebookmark#1#2#3#4#5#6% {\global\utilitydonetrue \global\let\localbookmark=\gobbleoneargument \global\let\flushbookmark=\relax \doifinstringelse{#1}{\openbookmarklist} {\chardef\openbookmark=1} {\chardef\openbookmark=0}% \iftracebookmarks(#6: #4)\quad(\the\openbookmark)\par\fi \doinsertbookmark{#2}{#3}{#4}{#5}{\openbookmark}} Can you try: \doinsertbookmark{#2}{#3}{#6 #4}{#5}{\openbookmark}} I can add an option: sectionnumber=yes/no to a yet non existing setup command, but first I wanna make sure what way to go. Hans </message> A rather old problem and no solution and no setup. Wolfgang
participants (3)
-
Aditya Mahajan
-
Sebastian Rooks
-
Wolfgang Schuster