[NTG-context] Re: setuphead in connection with the command argument

2024-05-30 Thread Tomáš Hála
Hi Gebrion,

> ## Font size + ## Bold text

for font size etc., you can use 
  \setuphead [chapter] [style={\setupbodyfont[11pt]}]  or
  \setuphead [chapter] [style=\tf]

  \setuphead [chapter] [style=\bf]

> ## Line breaks + ## Framed
> How can I achieve line breaks?

\define[2]\MyChapter{%
  \framedtext{%
 #1 #2:\\
 \structureuservariable{subtitle}\\
 (\structureuservariable{intro})
  }
}

> I also want to set everything except of the intro in a flushright environment 
> but do not know how. I tried:

As above: 
  \framedtext[align=flushright]{%

The best,

Tomáš

--

On Thu, May 30, 2024 at 02:15:01PM +, Gerion Entrup wrote:
> Hi,
> 
> I'm trying to adapt the format of chapters in my document and have a few 
> questions regarding setuphead.
> My aim is to have the chapter (title) on a separate page with an additional 
> intro in different text sizes for title, subtitle and the intro.
> I chose to use the "command=" argument in setuphead for that.
> However, I'm not quite sure about it's internals.
> 
> Let's begin with a minimal example:
> ```
> \define[2]\MyChapter{%
>   #1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
> }
> 
> \setuphead[title, chapter][command=\MyChapter]
> 
> \setupbodyfont[11pt]
> 
> \starttext
> \startchapter[title=foo][subtitle=bar, intro={some explanation}]
> some text
> \stopchapter
> \stoptext
> ```
> This produces 1.pdf.
> 
> 
> ## Font size
> 
> What is the reason that that the font of the chapter is bigger? How can I 
> reset it to normal size? This does not work at all:
> ```
> \define[2]\MyChapter{%
>   \setupbodyfont[11pt] #1 #2: \structureuservariable{subtitle} 
> (\structureuservariable{intro})
> }
> ```
> However, changing to a bigger font works somehow. Is there a factor applied 
> to the font size internally? For example:
> ```
> \define[2]\MyChapter{%
>   \setupbodyfont[20pt] #1 #2: \structureuservariable{subtitle} 
> (\structureuservariable{intro})
> }
> ```
> produces 2.pdf (the chapter font is not 20pt).
> 
> 
> ## Line breaks
> 
> How can I achieve line breaks?
> This does not work:
> ```
> \define[2]\MyChapter{%
> #1 #2:\\
> \structureuservariable{subtitle}\\
> (\structureuservariable{intro})
> }
> ```
> (see 3.pdf)
> 
> I also want to set everything except of the intro in a flushright environment 
> but do not know how. I tried:
> ```
> \define[2]\MyChapter{%
> \startalignment[flushright]
> #1 #2:\\
> \structureuservariable{subtitle}\\
> \stopalignment
> \structureuservariable{intro}
> }
> ```
> (see 4.pdf, no change)
> 
> 
> ## Bold text
> 
> I tried to get the text bold. However, `#1` and `#2` does not seem to follow 
> this.
> ```
> \define[2]\MyChapter{%
> \bold #1 #2: \structureuservariable{subtitle} 
> (\structureuservariable{intro})
> }
> ```
> 
> ## Makeups
> 
> The best solution, I had so far, was to define a makeup, but I don't get it 
> to work with text with mixed alignment and it does not solve the font size 
> problem:
> ```
> \definemakeup[chapter][align=left, top=]
> \define[2]\MyChapter{%
> \startmakeup[chapter]
> #1 #2:\\
> \structureuservariable{subtitle}\\
> \stopmakeup
> (\structureuservariable{intro})
> }
> ```
> (see 5.pdf)
> 
> ## Framed
> 
> I also have tried this but it does not bring any linebreaks:
> ```
> \define[2]\MyChapter{%
> \framed[frame=off, offset=0pt]{#1\\#2:\\ 
> \structureuservariable{subtitle}\\ (\structureuservariable{intro})}
> }
> ```
> (see 6.pdf)
> 
> I hope you can shed some light into setuphead with command. I search on the 
> wiki, Stackoverflow and the manuals but didn't really find anything.
> 
> Best,
> Gerion
> 







> % 1.pdf
> \define[2]\MyChapter{%
>   #1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
> }
> 
> % % 2.pdf
> % \define[2]\MyChapter{%
> % \setupbodyfont[20pt] #1 #2: \structureuservariable{subtitle} 
> (\structureuservariable{intro})
> % }
> 
> % % 3.pdf
> % \define[2]\MyChapter{%
> % #1 #2:\\
> % \structureuservariable{subtitle}\\
> % (\structureuservariable{intro})
> % }
> 
> % % 4.pdf
> % \define[2]\MyChapter{%
> % \startalignment[flushright]
> % #1 #2:\\
> % \structureuservariable{subtitle}\\
> % \stopalignment
> % \structureuservariable{intro}
> % }
> 
> % % 5.pdf
> % \definemakeup[chapter][align=left, top=]
> % \define[2]\MyChapter{%
> % \startmakeup[chapter]
> % #1 #2:\\
> % \structureuservariable{subtitle}\\
> % \stopmakeup
> % (\structureuservariable{intro})
> % }
> 
> 
> % % 6.pdf
> % \define[2]\MyChapter{%
> % \framed[frame=off, offset=0pt]{#1\\#2:\\ 
> \structureuservariable{subtitle}\\ (\structureuservariable{intro})}
> % }
> 
> \setuphead[title, chapter][command=\MyChapter]
> 
> \setupbodyfont[11pt]
> 
> \starttext
> \startchapter[title=foo][subtitle=bar, intro={some explanation}]
> some text
> \stopchapter
> \stoptext


> 

[NTG-context] Re: how to prevent item appearing in List of Figures

2024-05-30 Thread Tomáš Hála
Hi Charlie,

I guess that \starttplacefigure[location={none},...] might help you.

Or (older) \placefigure[none][,,,]{...}{...}

Best,

Tomáš

> I haven’t typeset a book before and various things are a challenge. The most 
> recent is the following.
> 
> I have \placelistoffigures some of which are logos (for the publisher and two 
> granting bodies) that I have placed with:
> 
>\setupcaptions[number=no]
> \starttplacefigure[
>  location={middle,high,low},
>  reference=fig:logo,
>  title=]
> {\externalfigure[FCLogo][width=0.045\textwidth]}
> \stopplacefigure 
> 
> These are not part of the text and I don’t want them to appear in the list.
> 
> The caption for the logo doesn’t appear in the List of Figures but the page 
> number does. How can I prevent these particular graphics from being listed in 
> the List of figures.
> 
> Thanks,
> Charlie
> 
> 
> 
> 
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: regular expression as lua pattern

2024-05-28 Thread Tomáš Hála
Hi Pablo,

unfortunately, that it is not possible:

http://lua-users.org/wiki/PatternsTutorial, section Limitations.

The best,

Tomáš


On Tue, May 28, 2024 at 06:12:51PM +0200, Pablo Rodriguez via ntg-context wrote:
> Dear list,
> 
> I have the following sample:
> 
>   \starttext
>   \startTEXpage[pagestate=start, offset=1em]
>   \startluacode
>   local str = "this is that"
>   context(str:match("(this|these)"))
>   \stopluacode
>   \stopTEXpage
>   \stoptext
> 
> In short, I would like to know whether it is possible to have the
> regular expression (this|these) as a Lua pattern.
> 
> I mean, I need complete strings and I haven’t found the way to do it.
> 
> Many thanks for your help,
> 
> Pablo
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: statistical charts module re-published

2024-04-29 Thread Tomáš Hála
Hi Hraban,

> published the new version to https://modules.contextgarden.net (i.e. 
> installation with
> "mtxrun --script install-modules --install > statistical-charts"

thank you, this is very userful.

Tomáš

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


Re: [NTG-context] Nuclear reactions

2023-04-16 Thread Tomáš Hála via ntg-context
Hi Gavin,

maybe you have solved your problem yet.

\startformula
 {\null}^^{194}__{38}{\rm Sr}
or  {\hbox{Xe}}^^{140}__{54}.
\stopformula

Better, ConTeXt way could be the variation on \chem:

\unexpanded\def\isotope#1#2#3{\dontleavehmode\begingroup\null\lohi[left]{#2}{#3}#1\endgroup}
\isotope{Sr}{38}{194}
or (with more logical order of parameters)
\unexpanded\def\isotope#1#2#3{\dontleavehmode\begingroup\null\lohi[left]{#1}{#2}#3\endgroup}
\isotope{38}{999}{Sr}

Or for text and math modes together:

\unexpanded\def\isotope#1#2#3{%
\ifmmode\begingroup\null^^{#1}__{#2}{\rm#3}\endgroup%
   \else\dontleavehmode\begingroup\null\lohi[left]{\tfx 
#1}{\tfx#2}\rm#3\endgroup%
\fi}

\isotope{999}{38}{Sr}
\startformula
\isotope{999}{38}{Sr}
\stopformula

You can do it either way, whichever way suits you better.

Tomáš



Od: ntg-context  za uživatele Hans Åberg via 
ntg-context 
Odesláno: sobota 15. dubna 2023 22:41
Komu: mailing list for ConTeXt users 
Kopie: Hans Åberg 
Předmět: Re: [NTG-context] Nuclear reactions


> On 15 Apr 2023, at 19:19, Gavin via ntg-context  wrote:
>
> I’m writing nuclear reactions. When add prescripts to atomic symbols with two 
> letters, (Be, Sr, Xe, etc.) the prescripts split the atoms!

One can use Unicode superscript and subscript numbers, as in ²³⁵₉₂U, which is 
easier to read. For input, an editor supporting text substitutions might be 
used.


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Question to footnote settings

2022-08-25 Thread Tomáš Hála via ntg-context
Hi all,
I am struggling with the width of a footnote number area. I would like to ask 
how can I set it dynamically based on the width of the largest number on a 
given page.

Without width I get two different footnote texts widths (compare #9+10).
With width there is a redundant space on the left (see p. 1).
(Number alignment to the right is required.)

Thanks in advance for some hints.

Tomáš

MWE:
\setupnotation[footnote][
  alternative=left,
  width=1em,
  numbercommand={\hfill\high},
]
\starttext
\showframe[text][text]
\dorecurse{6}{This is a text.\footnote{\dorecurse{12}{Blah blah blah. }} }
\page
\dorecurse{6}{This is a text.\footnote{\dorecurse{12}{Blah blah blah. }} }
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___