Re: [NTG-context] font size and style

2023-05-26 Thread Wolfgang Schuster via ntg-context

Hans van der Meer via ntg-context schrieb am 26.05.2023 um 21:38:
Calling "\bf\tfa  TEXT" for example leaves the TEXT not in bold 
because \tfa does not respect the current style. As does \small, etc.

Shown by looking at the meaning of for example \small:

\small=protected macro:\triggergroupedcommand {\setsmallbodyfont \tf }

and

\tx=protected macro:\currentxfontsize \plusone \ifmmode \scriptstyle 
\orelse \ifconditional \c_font_inherit_scale \font_scale_inherit_x 
\else \font_scale_defined_x \fi \al­ ways\let \tx \txx


Thus in contrast \tx and \txx do respect the current style setting.

My question: It seems most convenient if I could retrieve the current 
style and reset that after a size command. I rather would refrain from 
tinkering with those. Since there is a \currentxfontsize is there an 
analogue for the style?




\tf is the switch for the normal upright style and when you have \bf\tfa 
the first font switch is just replaced by the second switch.


To get a larger text in bold style you can use \bfa.

\starttext

text {\tfa\bf text} text

text {\bfa text} text

\stoptext

Wolfgang

___
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] \doifelseoddpage not working as expected

2023-05-26 Thread Berend de Boer via ntg-context

Dear all,

I need something like \doifelseoddpage, but this does not work as
expected. See below example. You will notice that on page two you
still get the ODD text, with page number 1.

What's going on? Is there a proper way to detect what page I'm on?


Example:

\starttext

\dorecurse{70}{\doifelseoddpage{ODD \currentpage\par}{EVEN \currentpage\par}}

\stoptext


My system:

   context --version
   mtx-context | ConTeXt Process Management 1.04
   mtx-context |
   mtx-context | main context file: 
/home/berend/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
   mtx-context | current version: 2023.05.08 17:39
   mtx-context | main context file: 
/home/berend/context/tex/texmf-context/tex/context/base/mkxl/context.mkxl
   mtx-context | current version: 2023.05.08 17:39


--
All the best,

Berend de Boer
___
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] Can ConTeXt write its pdf to a different directory?

2023-05-26 Thread Max Chernoff via ntg-context
Hi Peter,

> My .tex file is in a directory within my working directory. I would like 
> ConTeXt to write its output in the same directory as my .tex file. But it 
> writes to the working directory.
> 
> This was asked 10 years ago:
> `tex.stackexchange.com/questions/67928/how-to-set-output-directory-in-context-command`
> 
> The answer given then was to use:
> `context filename --result=output-directory/filename`
> 
> But this doesn't work now. When I compile my .tex file, I get a message:
> `results are to be on the running path, not on 'output-directory', ignoring 
> --result`

This seems to work, although I'm not sure that I would call it a "good"
solution:

   \startluacode
   local function absolute(path)
   return file.collapsepath(dir.expandname(path))
   end
   
   local texfile = absolute(environment.filename)
   local pdffile = file.addsuffix(
   absolute(environment.inputfilebarename),
   "pdf"
   )
   
   luatex.wrapup(function()
   os.rename(pdffile, file.replacesuffix(texfile, "pdf"))
   end)
   \stopluacode
   
   \starttext
   Hello!
   \stoptext

-- Max
___
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] Can ConTeXt write its pdf to a different directory?

2023-05-26 Thread peter.hopcroft--- via ntg-context
My .tex file is in a directory within my working directory. I would like 
ConTeXt to write its output in the same directory as my .tex file. But it 
writes to the working directory.

This was asked 10 years ago:
`tex.stackexchange.com/questions/67928/how-to-set-output-directory-in-context-command`
 

The answer given then was to use:
`context filename --result=output-directory/filename`

But this doesn't work now. When I compile my .tex file, I get a message:
`results are to be on the running path, not on 'output-directory', ignoring 
--result`

I've looked in the wiki:
`https://wiki.contextgarden.net/Context`

Thank you,
Peter

___
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] font size and style

2023-05-26 Thread Hans van der Meer via ntg-context
Calling "\bf\tfa  TEXT" for example leaves the TEXT not in bold because \tfa 
does not respect the current style. As does \small, etc.
Shown by looking at the meaning of for example \small:
\small=protected macro:\triggergroupedcommand {\setsmallbodyfont \tf }

and

\tx=protected macro:\currentxfontsize \plusone \ifmmode \scriptstyle \orelse 
\ifconditional \c_font_inherit_scale \font_scale_inherit_x \else 
\font_scale_defined_x \fi \al­ ways\let \tx \txx

Thus in contrast \tx and \txx do respect the current style setting.

My question: It seems most convenient if I could retrieve the current style and 
reset that after a size command. I rather would refrain from tinkering with 
those. Since there is a \currentxfontsize is there an analogue for the style?

dr. Hans van der Meer
___
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
___