ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* setupinmargin, setupmargindata ; page numbers ; fonts
@ 2014-11-25  2:47 Richard Sherman
  2014-11-25  5:35 ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Sherman @ 2014-11-25  2:47 UTC (permalink / raw)
  To: ntg-context

Hi all,

I am having trouble with the control of fonts in \inmargin{} and in page
numbers. I'm also having trouble with the alignment in \inmargin{}, and with
font sizes generally.

I've used what I know about \setupmargindata and \setupinmargin(and
\setuppagenumbering).

Below is an example that (almost) does what I want.

The two or three problems I've tried and failed to solve are

1. control over the font size of the marginal note (rather than just \small; I
want to choose a point-size)

2. control over the font and size of the page number. At first I used
\setuppagenumbering[location={header, right, inmargin}] (yes, one of 'right' and
'inmargin' seems to be redundant).  Getting a sans-serif page number, I assumed
that \setupmargindata was controlling that, so I just switched to 'right', but
my page number is still sans-serif. I've tried such things as [location={header,
right}, style={normal, small}], as well as variants {\small}, {normal},
{\normal}, serif, \serif, etc. with not luck

3. in \setupmargindata and \setupinmargin, none of the 'align=' options seems to
have any effect.

More generally, I have trouble understanding how to specify font sizes in
ConTeXt, how to set up the font and font-size of page elements, how to include
comma-separated lists following 'style=', where even within braces all but the
first option seems to be ignored (at least in my margin setup commands).

I also can't figure out why, though the default (location) for
\setuppagenumbering is {header, center} (and (font style) normal?), my page
numbers default to sans, and when 'location=right' is specified without
'header', the page number is on the right in the ... footer (?!)

Thanks for any help. -Richard


\setuplayout[width=5in, header=.5in, footer=.5in, backspace=2in, location=right]
\setupwhitespace[big] \setupindenting[none] \setupmargindata[location=left,
align=outer, style={\ss \small}] \setuppagenumbering[location={header, right}]


\definefontfamily [myfamily] [serif] [baskervaldx] \definefontfamily [myfamily]
[italic] [baskervaldxita] \definefontfamily [myfamily] [bold] [baskervaldxbol]
\definefontfamily [myfamily] [sans] [gillsansstd] \definefontfamily [myfamily]
[mono] [CourierNew] \setupbodyfont [myfamily]

\starttext

ConTeXt is software\inmargin{A brief description of \ConTeXt} for typesetting
high-quality documents. Unlike familiar word processors where the
\emph{formatting} of the final document is crafted while writing the content,
ConTeXt documents are written \bold{without} formatting, in \mono{plain text},
using a macro language. This means that the document's content can change
independently of its formatting and vice versa.

ConTeXt is software for typesetting high-quality documents.\inmargin{This
repeats the brief description above} Unlike familiar word processors where the
formatting of the final document is crafted while writing the content, ConTeXt
documents are written without formatting, in plain text, using a macro language.
This means that the document's content can change independently of its
formatting and vice versa.

\stoptext

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: setupinmargin, setupmargindata ; page numbers ; fonts
  2014-11-25  2:47 setupinmargin, setupmargindata ; page numbers ; fonts Richard Sherman
@ 2014-11-25  5:35 ` Wolfgang Schuster
  2014-11-25  9:14   ` Richard Sherman
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2014-11-25  5:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 25.11.2014 um 03:47 schrieb Richard Sherman <rss.pdx@gmail.com>:
> 
> Hi all,
> 
> I am having trouble with the control of fonts in \inmargin{} and in page
> numbers. I'm also having trouble with the alignment in \inmargin{}, and with
> font sizes generally.
> 
> I've used what I know about \setupmargindata and \setupinmargin(and
> \setuppagenumbering).
> 
> Below is an example that (almost) does what I want.
> 
> The two or three problems I've tried and failed to solve are
> 
> 1. control over the font size of the marginal note (rather than just \small; I
> want to choose a point-size)
> 
> 2. control over the font and size of the page number. At first I used
> \setuppagenumbering[location={header, right, inmargin}] (yes, one of 'right' and
> 'inmargin' seems to be redundant).  Getting a sans-serif page number, I assumed
> that \setupmargindata was controlling that, so I just switched to 'right', but
> my page number is still sans-serif. I've tried such things as [location={header,
> right}, style={normal, small}], as well as variants {\small}, {normal},
> {\normal}, serif, \serif, etc. with not luck
> 
> 3. in \setupmargindata and \setupinmargin, none of the 'align=' options seems to
> have any effect.
> 
> More generally, I have trouble understanding how to specify font sizes in
> ConTeXt, how to set up the font and font-size of page elements, how to include
> comma-separated lists following 'style=', where even within braces all but the
> first option seems to be ignored (at least in my margin setup commands).
> 
> I also can't figure out why, though the default (location) for
> \setuppagenumbering is {header, center} (and (font style) normal?), my page
> numbers default to sans, and when 'location=right' is specified without
> 'header', the page number is on the right in the ... footer (?!)


1. The font for the pagenumber can be changed with \setuppagenumbering[style=…].

2. To use a certain font size for the margin text you can either use the \switchtobodyfont
   command or define a font command with \definefont and use this name as argument
   for the style key in \setupmargindata.

3. The alignment in the margin text can be set with \setupmarginframed or the second
   optional argument of \inmargin.

\setuppagenumbering[style=\ttc]

\setuplayout[backspace=4cm]

\showframe

\setupmarginframed[inmargin][align=flushleft]
\setupmargindata  [inmargin][style={\switchtobodyfont[ss,18]}]

% Faster method to switch the font for \inmargin
%\definefont[InmarginStyle][Sans at 18pt]
%\setupmargindata[inmargin][style=InmarginStyle]

\starttext

\dorecurse{10}
  {\inmargin{Ward}
   \input ward\par
   \inmargin[][align=flushleft]{Knuth}
   \input knuth\par
   \inmargin[][align=flushright]{Tufte}
   \input tufte\par
   \inmargin[][align=middle]{Zapf}
   \input zapf\par}

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re:  setupinmargin, setupmargindata ; page numbers ; fonts
  2014-11-25  5:35 ` Wolfgang Schuster
@ 2014-11-25  9:14   ` Richard Sherman
  2014-11-25 16:00     ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Sherman @ 2014-11-25  9:14 UTC (permalink / raw)
  To: ntg-context

Wolfgang Schuster <schuster.wolfgang <at> gmail.com> writes:

...
> \setuppagenumbering[style=\ttc]
> 
> \setuplayout[backspace=4cm]
> 
> \showframe
> 
> \setupmarginframed[inmargin][align=flushleft]
> \setupmargindata  [inmargin][style={\switchtobodyfont[ss,18]}]
> 
> % Faster method to switch the font for \inmargin
> %\definefont[InmarginStyle][Sans at 18pt]
> %\setupmargindata[inmargin][style=InmarginStyle]
> 
> \starttext
> 
> \dorecurse{10}
>   {\inmargin{Ward}
>    \input ward\par
>    \inmargin[][align=flushleft]{Knuth}
>    \input knuth\par
>    \inmargin[][align=flushright]{Tufte}
>    \input tufte\par
>    \inmargin[][align=middle]{Zapf}
>    \input zapf\par}
> 
> \stoptext

---

Thank you, this is beginning to look good. 

Your first method, uncommented, does not work for me. I get an error at 
the first occurrence of \inmargin.

Using the method you commented out, I get what I want. I'm a little 
perplexed at why I can't include align=flushleft as in \setupmargindata[inmargin]
[style=InMarginStyle, align=flushleft]. I'm unable to find any reference 
to \setupmarginframed via Google. 

Using \setuppagenumbering[style=\rmx, location={header, inmargin}, align=right], 
I'm able to get close to what I want, though 'align=right' has no effect.

Oddly (?), my system knows no Ward, nor Tufte, nor Zapf, nor any 
of the rest of them. :)

Thanks, -Richard


___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: setupinmargin, setupmargindata ; page numbers ; fonts
  2014-11-25  9:14   ` Richard Sherman
@ 2014-11-25 16:00     ` Wolfgang Schuster
  2014-11-26  1:39       ` Richard Sherman
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2014-11-25 16:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 25.11.2014 um 10:14 schrieb Richard Sherman <rss.pdx@gmail.com>:
> 
> Wolfgang Schuster <schuster.wolfgang <at> gmail.com> writes:
> 
> ...
>> \setuppagenumbering[style=\ttc]
>> 
>> \setuplayout[backspace=4cm]
>> 
>> \showframe
>> 
>> \setupmarginframed[inmargin][align=flushleft]
>> \setupmargindata  [inmargin][style={\switchtobodyfont[ss,18]}]
>> 
>> % Faster method to switch the font for \inmargin
>> %\definefont[InmarginStyle][Sans at 18pt]
>> %\setupmargindata[inmargin][style=InmarginStyle]
>> 
>> \starttext
>> 
>> \dorecurse{10}
>>  {\inmargin{Ward}
>>   \input ward\par
>>   \inmargin[][align=flushleft]{Knuth}
>>   \input knuth\par
>>   \inmargin[][align=flushright]{Tufte}
>>   \input tufte\par
>>   \inmargin[][align=middle]{Zapf}
>>   \input zapf\par}
>> 
>> \stoptext
> 
> ---
> 
> Thank you, this is beginning to look good. 
> 
> Your first method, uncommented, does not work for me. I get an error at 
> the first occurrence of \inmargin.

The first line is a comment which says

\definefont[InmarginStyle][Sans at 18pt]
\setupmargindata[inmargin][style=InmarginStyle]

takes less time to change the font than

\setupmargindata[inmargin][style={\switchtobodyfont[ss,18]}]

but you won’t notice the difference unless your document has thousands of pages
and even then you will notice it only will large fonts (e.g. chinese fonts).

> Using the method you commented out, I get what I want. I'm a little 
> perplexed at why I can't include align=flushleft as in \setupmargindata[inmargin]
> [style=InMarginStyle, align=flushleft]. I'm unable to find any reference 
> to \setupmarginframed via Google. 
> 
> Using \setuppagenumbering[style=\rmx, location={header, inmargin}, align=right], 
> I'm able to get close to what I want, though 'align=right' has no effect.

The command has no align option but you can use the command key to use a alignment command.

\setuppagenumbering
  [location={header,inmargin},
   alternative=doublesided,
   command={\alignedline{outer}{right}}] % command=\doalignline{outer}

\showframe

\starttext
\dorecurse{20}{\input knuth\par}
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re:  setupinmargin, setupmargindata ; page numbers ; fonts
  2014-11-25 16:00     ` Wolfgang Schuster
@ 2014-11-26  1:39       ` Richard Sherman
  2014-11-26  6:01         ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Sherman @ 2014-11-26  1:39 UTC (permalink / raw)
  To: ntg-context

Wolfgang Schuster <schuster.wolfgang <at> gmail.com> writes:

> The first line is a comment which says
> 
> \definefont[InmarginStyle][Sans at 18pt]
> \setupmargindata[inmargin][style=InmarginStyle]
> 
> takes less time to change the font than
> 
> \setupmargindata[inmargin][style={\switchtobodyfont[ss,18]}]
> 


Thank you again, very much.

I understood what you meant regarding the two methods. What I meant was that
this method:

\setupmargindata[inmargin][style={\switchtobodyfont[ss,18]}]

results in an error, causing Context to stop executing, when it first encounters 
the \inmargin{} statement.

-Richard


___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: setupinmargin, setupmargindata ; page numbers ; fonts
  2014-11-26  1:39       ` Richard Sherman
@ 2014-11-26  6:01         ` Wolfgang Schuster
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2014-11-26  6:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 26.11.2014 um 02:39 schrieb Richard Sherman <rss.pdx@gmail.com>:
> 
> Wolfgang Schuster <schuster.wolfgang <at> gmail.com> writes:
> 
>> The first line is a comment which says
>> 
>> \definefont[InmarginStyle][Sans at 18pt]
>> \setupmargindata[inmargin][style=InmarginStyle]
>> 
>> takes less time to change the font than
>> 
>> \setupmargindata[inmargin][style={\switchtobodyfont[ss,18]}]
>> 
> 
> 
> Thank you again, very much.
> 
> I understood what you meant regarding the two methods. What I meant was that
> this method:
> 
> \setupmargindata[inmargin][style={\switchtobodyfont[ss,18]}]
> 
> results in an error, causing Context to stop executing, when it first encounters 
> the \inmargin{} statement.

Replace “18” with “18pt”.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2014-11-26  6:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-25  2:47 setupinmargin, setupmargindata ; page numbers ; fonts Richard Sherman
2014-11-25  5:35 ` Wolfgang Schuster
2014-11-25  9:14   ` Richard Sherman
2014-11-25 16:00     ` Wolfgang Schuster
2014-11-26  1:39       ` Richard Sherman
2014-11-26  6:01         ` Wolfgang Schuster

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).