ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Style for captions
@ 2019-12-18  8:01 Otared Kavian
  2019-12-18 12:52 ` Aditya Mahajan
  0 siblings, 1 reply; 7+ messages in thread
From: Otared Kavian @ 2019-12-18  8:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi all,

In the example below, I would like to have the style of the figure's caption to be \itx, but the inline formula is set with a larger body font: is it possible to setup the caption of a float so that a smaller size applies also to the math formula?

Best regards: Otared
PS: here is the example (not so minimal, sorry…)
% begin example-caption.tex
\setupcaption[figure][
	headstyle={\bix},
	style={\itx}]
\starttext

\startluacode 
	function weierstrass(n,x)
		local S = 0
		for k = 0, n do
			S = S + 2^(-k)*math.cos(3^k*x)
		end
		return S
	end
\stopluacode

\startplacefigure[title={The Weierstrass function $\sum_{k=0}^n 2^{-k}\cos(3^kx)$}]
\startMPcode{doublefun} 
	draw lmt_function [
	xmin = 0, xmax = 4*355/113, xstep =.001, 
	ymin = -2, ymax = 2,
	sx = 1mm, xsmall = 80, xlarge = 20, 
	sy = 4mm, ysmall = 40, ylarge = 4,
	xlabels = "yes",
	ylabels = "yes",
	linewidth = .015mm, offset = .1mm,
	code = "weierstrass(5,x)",
	frame = "sticks",
	xcaption = "$n = 5$",
	functions = {
		[
			drawcolor = "darkred",
		]
		}
	] xsized .5TextWidth ;
\stopMPcode
\stopplacefigure

\stoptext
% begin example-caption.tex

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Style for captions
  2019-12-18  8:01 Style for captions Otared Kavian
@ 2019-12-18 12:52 ` Aditya Mahajan
  2019-12-18 15:11   ` Otared Kavian
  2019-12-18 16:32   ` Wolfgang Schuster
  0 siblings, 2 replies; 7+ messages in thread
From: Aditya Mahajan @ 2019-12-18 12:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 555 bytes --]

On Wed, 18 Dec 2019, Otared Kavian wrote:

> Hi all,
>
> In the example below, I would like to have the style of the figure's caption to be \itx, but the inline formula is set with a larger body font: is it possible to setup the caption of a float so that a smaller size applies also to the math formula?
>
> Best regards: Otared
> PS: here is the example (not so minimal, sorry…)
> % begin example-caption.tex
> \setupcaption[figure][
> 	headstyle={\bix},
> 	style={\itx}]

style={\switchtobodyfont[small]\setupinterlinespace\it}

Aditya

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Style for captions
  2019-12-18 12:52 ` Aditya Mahajan
@ 2019-12-18 15:11   ` Otared Kavian
  2019-12-18 16:11     ` Aditya Mahajan
  2019-12-18 16:32   ` Wolfgang Schuster
  1 sibling, 1 reply; 7+ messages in thread
From: Otared Kavian @ 2019-12-18 15:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thanks Aditya! That solve smy issue.
However, it is a bit of magic to know that \setupinterlinespace makes also the math font small, even for inline math.

Best regards: OK

> On 18 Dec 2019, at 13:52, Aditya Mahajan <adityam@umich.edu> wrote:
> 
> On Wed, 18 Dec 2019, Otared Kavian wrote:
> 
>> Hi all,
>> 
>> In the example below, I would like to have the style of the figure's caption to be \itx, but the inline formula is set with a larger body font: is it possible to setup the caption of a float so that a smaller size applies also to the math formula?
>> 
>> Best regards: Otared
>> PS: here is the example (not so minimal, sorry…)
>> % begin example-caption.tex
>> \setupcaption[figure][
>> 	headstyle={\bix},
>> 	style={\itx}]
> 
> style={\switchtobodyfont[small]\setupinterlinespace\it}
> 
> Aditya___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Style for captions
  2019-12-18 15:11   ` Otared Kavian
@ 2019-12-18 16:11     ` Aditya Mahajan
  2019-12-18 16:28       ` Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2019-12-18 16:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, 18 Dec 2019, Otared Kavian wrote:

> Thanks Aditya! That solve smy issue.
> However, it is a bit of magic to know that \setupinterlinespace makes also the math font small, even for inline math.

The magic bit is not \setupinterlinespace but using 
\switchtobodyfont[small] instead of \tfx.

\tf.. \bf.., etc. only change the text font; \switchtobodyfont changes the 
entire font family, including math.

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Style for captions
  2019-12-18 16:11     ` Aditya Mahajan
@ 2019-12-18 16:28       ` Wolfgang Schuster
  0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2019-12-18 16:28 UTC (permalink / raw)
  To: NTG-Context ConTeXt users

Aditya Mahajan schrieb am 18.12.2019 um 17:11:
> On Wed, 18 Dec 2019, Otared Kavian wrote:
>
>> Thanks Aditya! That solve smy issue.
>> However, it is a bit of magic to know that \setupinterlinespace makes 
>> also the math font small, even for inline math.
>
> The magic bit is not \setupinterlinespace but using 
> \switchtobodyfont[small] instead of \tfx.
>
> \tf.. \bf.., etc. only change the text font; \switchtobodyfont changes 
> the entire font family, including math.

Only \tx and \txx (and the combinations \tfx etc.) ignore math.

\starttext

xxx \m{xxx}

{\tfc xxx \m{xxx}}

{\tfx xxx \m{xxx}}

\stoptext

Wolfgang

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Style for captions
  2019-12-18 12:52 ` Aditya Mahajan
  2019-12-18 15:11   ` Otared Kavian
@ 2019-12-18 16:32   ` Wolfgang Schuster
  2019-12-18 20:19     ` Otared Kavian
  1 sibling, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2019-12-18 16:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Aditya Mahajan

Aditya Mahajan schrieb am 18.12.2019 um 13:52:
> On Wed, 18 Dec 2019, Otared Kavian wrote:
>
>> Hi all,
>>
>> In the example below, I would like to have the style of the figure's 
>> caption to be \itx, but the inline formula is set with a larger body 
>> font: is it possible to setup the caption of a float so that a 
>> smaller size applies also to the math formula?
>>
>> Best regards: Otared
>> PS: here is the example (not so minimal, sorry…)
>> % begin example-caption.tex
>> \setupcaption[figure][
>>     headstyle={\bix},
>>     style={\itx}]
>
> style={\switchtobodyfont[small]\setupinterlinespace\it}

\setupcaption
   [figure]
   [headstyle=bold,
    style=smallitalic]

Wolfgang

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Style for captions
  2019-12-18 16:32   ` Wolfgang Schuster
@ 2019-12-18 20:19     ` Otared Kavian
  0 siblings, 0 replies; 7+ messages in thread
From: Otared Kavian @ 2019-12-18 20:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Wolfgang and Aditya,

Thanks for the explanations: the confusion for me came from the fact that I had already use \tfa for a title containing inline maths, and could not imagine that \tfx does not apply to inline maths. Is there reason for this difference?

That said the solution with style=smallitalic makes sense and one can remember it.

Best regards: OK

> On 18 Dec 2019, at 17:32, Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote:
> 
> Aditya Mahajan schrieb am 18.12.2019 um 13:52:
>> On Wed, 18 Dec 2019, Otared Kavian wrote:
>> 
>>> Hi all,
>>> 
>>> In the example below, I would like to have the style of the figure's caption to be \itx, but the inline formula is set with a larger body font: is it possible to setup the caption of a float so that a smaller size applies also to the math formula?
>>> 
>>> Best regards: Otared
>>> PS: here is the example (not so minimal, sorry…)
>>> % begin example-caption.tex
>>> \setupcaption[figure][
>>>     headstyle={\bix},
>>>     style={\itx}]
>> 
>> style={\switchtobodyfont[small]\setupinterlinespace\it}
> 
> \setupcaption
>   [figure]
>   [headstyle=bold,
>    style=smallitalic]
> 
> Wolfgang
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-12-18 20:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18  8:01 Style for captions Otared Kavian
2019-12-18 12:52 ` Aditya Mahajan
2019-12-18 15:11   ` Otared Kavian
2019-12-18 16:11     ` Aditya Mahajan
2019-12-18 16:28       ` Wolfgang Schuster
2019-12-18 16:32   ` Wolfgang Schuster
2019-12-18 20:19     ` Otared Kavian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).