From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/93695 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: font switches: bold, slanted, etc. Date: Sat, 13 Feb 2016 10:53:22 +0100 Message-ID: <56BEFD12.5040700@gmail.com> References: <20160212162306.42e612a9@cea.fr> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3902289953306163629==" X-Trace: ger.gmane.org 1455357254 14323 80.91.229.3 (13 Feb 2016 09:54:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Feb 2016 09:54:14 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Feb 13 10:54:01 2016 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aUWts-0004Hq-Q6 for gctc-ntg-context-518@m.gmane.org; Sat, 13 Feb 2016 10:54:00 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id CBBE3696F; Sat, 13 Feb 2016 10:53:37 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lWDCoQaklZVD; Sat, 13 Feb 2016 10:53:37 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 0AC9E698F; Sat, 13 Feb 2016 10:53:37 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id D49F6697A for ; Sat, 13 Feb 2016 10:53:35 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YSbXZWTjDksU for ; Sat, 13 Feb 2016 10:53:34 +0100 (CET) Original-Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id DD9BA696F for ; Sat, 13 Feb 2016 10:53:24 +0100 (CET) Original-Received: by mail-wm0-f43.google.com with SMTP id g62so48979949wme.0 for ; Sat, 13 Feb 2016 01:53:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=7L/Y7/xtlwjBAdQQ8lCqDOW2JX2IGDB+8pNS4O/gxCM=; b=yFg24cL1QxkvTRB+N5Zz7Kx+VfBap2VwPJCbSZhnasPbeiINreE2o5COvbLcg030tS ceEXxXHNei0TGYLy1asyy76g65cERtV8XBfi6i+zACd23Jo4BnZleUGEq9YxzhNQTuys m3XkiQ56S1uTLtLH4BcVBM1uBaxZmqMqRlhrCfk9BBjSyM+mWrbMy8NPGr3Y6XXnJhM6 e4WkzcFb72SNqwntWpGbV5uiRlOshaKNS9LaQ/7mR4oNVXvLWxvbMvJAAgdxndhKqKXi 3QkVlXtTlGjSdCApaue9JhLC73DStGkhXxLugsB2ynXXTshkMexvaPB3XxGCp2HSNgiG Aauw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type; bh=7L/Y7/xtlwjBAdQQ8lCqDOW2JX2IGDB+8pNS4O/gxCM=; b=b+Qm/mOLXr+DO1RWzDWpxu633hgjQLqw2AZoLBxWCVis4lnXsLsZ/2GeQGCUSL/MkK rKRLW+B7oHStAnuKR72SXIbzn6B6q0LosKbnYVvoTrK5x7A7ca9ncy9srHjx7KHz/rUq R3J3eyB9pXMJN7wZz4Lspj+JTtgO0y2m9WEWNv2jCm6Ang3moj8xtuD5+xIQZtG93G+w kD5kP7bX9JoOemRsg8ZYyyxZPv4llY3TY6owwRxyh4W3cWxW5gc1EX+Q14Z8eKsY5ELi mbsgXXB7MA33MAwgITBhYgl0gpMw0AfBxD/Lm7CtRxB+FK0PP8o/eqJkYj+3FOcyTcso 1+Sg== X-Gm-Message-State: AG10YOTAA4wyRQ1M+k/KLYO/kBIY3Y2f8sZKH+2drvXxAwkhrhKLy1PxKMAEb0HGFgbAKw== X-Received: by 10.28.172.193 with SMTP id v184mr2591837wme.94.1455357203684; Sat, 13 Feb 2016 01:53:23 -0800 (PST) Original-Received: from keima.localdomain (x2f2ed47.dyn.telefonica.de. [2.242.237.71]) by smtp.gmail.com with ESMTPSA id g1sm11466265wmc.0.2016.02.13.01.53.22 for (version=TLSv1/SSLv3 cipher=OTHER); Sat, 13 Feb 2016 01:53:22 -0800 (PST) User-Agent: Postbox 4.0.8 (Macintosh/20151105) In-Reply-To: <20160212162306.42e612a9@cea.fr> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:93695 Archived-At: This is a multi-part message in MIME format. --===============3902289953306163629== Content-Type: multipart/alternative; boundary="------------070108020306020109070003" This is a multi-part message in MIME format. --------------070108020306020109070003 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable > Alan BRASLAU > 13. Februar 2016 um 00:23 > Hi, > > Basic font switches are bold (\bf), italic (\it), slanted (\sl), ... > and one can have bolditalic (\bi), boldslated (\bs), etc. > We also have style=3Dbold, style=3Dslanted, etc. > > Is there some way to manipulate font switches so that > \bold{This text is \slated{bold}} > for example, would put the word "bold" into boldslanted? > > A natural use of this is, e.g. headers that get typeset in bold. What > if the title contains a word, say, in slanted (or, worse, some > mathematics)? There are a few font switches which change the style dependant on the=20 current style \starttext \starttabulate[|l|f{\tf}l|f{\it}l|f{\sl}l|f{\bf}l|f{\bi}l|f{\bs}l|] \NC \NC \tttf \tex{tf} \NC \tttf \tex{it} \NC \tttf=20 \tex{sl} \NC \tttf \tex{bf} \NC \tttf \tex{bi} \NC \tttf \tex{bs} \NC\NR \NC \NC Text \NC Text \NC =20 Text \NC Text \NC Text \NC Text \NC\NR \NC \tex{em} \NC \em Text \NC \em Text \NC \em =20 Text \NC \em Text \NC \em Text \NC \em Text \NC\NR \NC \tex{boldface} \NC \boldface Text \NC \boldface Text \NC \boldface=20 Text \NC \boldface Text \NC \boldface Text \NC \boldface Text \NC\NR \NC \tex{typeface} \NC \typeface Text \NC \typeface Text \NC \typeface=20 Text \NC \typeface Text \NC \typeface Text \NC \typeface Text \NC\NR \NC \tex{swapface} \NC \swapface Text \NC \swapface Text \NC \swapface=20 Text \NC \swapface Text \NC \swapface Text \NC \swapface Text \NC\NR \stoptabulate \stoptext but I guess you=E2=80=99re looking for something like this (similar to th= e LaTeX=20 font system): \unprotect \def\texttf_direct {\ifx\fontalternative\s!it \tf \else \ifx\fontalternative\s!sl \tf \else \ifx\fontalternative\s!bi \bf \else \ifx\fontalternative\s!bs \bf \fi\fi\fi\fi} \def\textbf_direct {\ifx\fontalternative\s!tf \bf \else \ifx\fontalternative\s!it \bi \else \ifx\fontalternative\s!sl \bs \fi\fi\fi} \def\textit_direct {\ifx\fontalternative\s!tf \it \else \ifx\fontalternative\s!sl \it \else \ifx\fontalternative\s!bf \bi \else \ifx\fontalternative\s!bs \bi \fi\fi\fi\fi} \def\textsl_direct {\ifx\fontalternative\s!tf \sl \else \ifx\fontalternative\s!it \it \else \ifx\fontalternative\s!bf \bs \else \ifx\fontalternative\s!bi \bs \fi\fi\fi\fi} \def\textem_direct {\ifx\fontalternative\s!tf \it \else \ifx\fontalternative\s!it \tf \else \ifx\fontalternative\s!sl \tf \else \ifx\fontalternative\s!bf \bi \else \ifx\fontalternative\s!bi \bf \else \ifx\fontalternative\s!bs \bf \fi\fi\fi\fi\fi\fi} \def\texttf_indeed{\bgroup\texttf_direct\let\nexttoken} \def\textbf_indeed{\bgroup\textbf_direct\let\nexttoken} \def\textit_indeed{\bgroup\textit_direct\let\nexttoken} \def\textsl_indeed{\bgroup\textsl_direct\let\nexttoken} \def\textem_indeed{\bgroup\textem_direct\let\nexttoken} \unexpanded\def\texttf{\doifelsenextbgroup\texttf_indeed\texttf_direct} \unexpanded\def\textbf{\doifelsenextbgroup\textbf_indeed\textbf_direct} \unexpanded\def\textit{\doifelsenextbgroup\textit_indeed\textit_direct} \unexpanded\def\textsl{\doifelsenextbgroup\textsl_indeed\textsl_direct} \unexpanded\def\textem{\doifelsenextbgroup\textem_indeed\textem_direct} \protect \starttext text {\textbf text \textit text \texttf text \textsl text} text {\textit text \textbf text \textsl text \texttf text} text \textbf{text \textit{text} \textsl{text \texttf{text} text}} text {\textem text \textem text} {\bf text \textem text \textem text} \stoptext Wolfgang --------------070108020306020109070003 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
13= .=20 Februar 2016 um 00:23
Hi,

Basic font=20 switches are bold (\bf), italic (\it), slanted (\sl), ...
and one can have bolditalic (\bi), boldslated (\bs), etc.
We also have=20 style=3Dbold, style=3Dslanted, etc.

Is there some way to manipulat= e=20 font switches so that
\bold{This text is \slated{bold}}
for=20 example, would put the word "bold" into boldslanted?

A natural=20 use of this is, e.g. headers that get typeset in bold. What
if the=20 title contains a word, say, in slanted (or, worse, some
mathematics)?<= br>

There are a few font switches which change the style dependant on the=20 current style


\starttext

\starttabulate[|l|f{\tf}l|f{\it}l|f{\sl}l|f{\bf}l|f{\bi}l|f{\bs}l|]
\NC=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 \NC \tttf \tex{tf} \NC \tttf \tex{it} \NC \tttf=20 \tex{sl} \NC \tttf \tex{bf} \NC \tttf \tex{bi} \NC \tttf \tex{bs} \NC\NR<= br> \NC=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 \NC=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 Text \NC=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 Text \NC=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=20 Text \NC=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Text= \NC=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Text \NC= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Text \NC\NR<= br> \NC \tex{em}=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 \NC \em=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 Text \NC \em=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Text = \NC \em=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=20 Text \NC \em=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Text \NC \em=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 Text \NC \em=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= Text \NC\NR
\NC \tex{boldface} \NC \boldface Text \NC \boldface Text \NC \boldface=20 Text \NC \boldface Text \NC \boldface Text \NC \boldface Text \NC\NR
\NC \tex{typeface} \NC \typeface Text \NC \typeface Text \NC \typeface=20 Text \NC \typeface Text \NC \typeface Text \NC \typeface Text \NC\NR
\NC \tex{swapface} \NC \swapface Text \NC \swapface Text \NC \swapface=20 Text \NC \swapface Text \NC \swapface Text \NC \swapface Text \NC\NR
\stoptabulate

\stoptext


but I guess you=E2=80=99re looking for something like this (similar to th= e LaTeX font system):


\unprotect

\def\texttf_direct
=C2=A0 {\ifx\fontalternative\s!it \tf \else
=C2=A0=C2=A0 \ifx\fontalternative\s!sl \tf \else
=C2=A0=C2=A0 \ifx\fontalternative\s!bi \bf \else
=C2=A0=C2=A0 \ifx\fontalternative\s!bs \bf \fi\fi\fi\fi}

\def\textbf_direct
=C2=A0 {\ifx\fontalternative\s!tf \bf \else
=C2=A0=C2=A0 \ifx\fontalternative\s!it \bi \else
=C2=A0=C2=A0 \ifx\fontalternative\s!sl \bs \fi\fi\fi}

\def\textit_direct
=C2=A0 {\ifx\fontalternative\s!tf \it \else
=C2=A0=C2=A0 \ifx\fontalternative\s!sl \it \else
=C2=A0=C2=A0 \ifx\fontalternative\s!bf \bi \else
=C2=A0=C2=A0 \ifx\fontalternative\s!bs \bi \fi\fi\fi\fi}

\def\textsl_direct
=C2=A0 {\ifx\fontalternative\s!tf \sl \else
=C2=A0=C2=A0 \ifx\fontalternative\s!it \it \else
=C2=A0=C2=A0 \ifx\fontalternative\s!bf \bs \else
=C2=A0=C2=A0 \ifx\fontalternative\s!bi \bs \fi\fi\fi\fi}

\def\textem_direct
=C2=A0 {\ifx\fontalternative\s!tf \it \else
=C2=A0=C2=A0 \ifx\fontalternative\s!it \tf \else
=C2=A0=C2=A0 \ifx\fontalternative\s!sl \tf \else
=C2=A0=C2=A0 \ifx\fontalternative\s!bf \bi \else
=C2=A0=C2=A0 \ifx\fontalternative\s!bi \bf \else
=C2=A0=C2=A0 \ifx\fontalternative\s!bs \bf \fi\fi\fi\fi\fi\fi}

\def\texttf_indeed{\bgroup\texttf_direct\let\nexttoken}
\def\textbf_indeed{\bgroup\textbf_direct\let\nexttoken}
\def\textit_indeed{\bgroup\textit_direct\let\nexttoken}
\def\textsl_indeed{\bgroup\textsl_direct\let\nexttoken}
\def\textem_indeed{\bgroup\textem_direct\let\nexttoken}

\unexpanded\def\texttf{\doifelsenextbgroup\texttf_indeed\texttf_direct} \unexpanded\def\textbf{\doifelsenextbgroup\textbf_indeed\textbf_direct} \unexpanded\def\textit{\doifelsenextbgroup\textit_indeed\textit_direct} \unexpanded\def\textsl{\doifelsenextbgroup\textsl_indeed\textsl_direct} \unexpanded\def\textem{\doifelsenextbgroup\textem_indeed\textem_direct}
\protect

\starttext

text {\textbf text \textit text \texttf text \textsl text}

text {\textit text \textbf text \textsl text \texttf text}

text \textbf{text \textit{text} \textsl{text \texttf{text} text}}

text {\textem text \textem text} {\bf text \textem text \textem text}

\stoptext


Wolfgang
--------------070108020306020109070003-- --===============3902289953306163629== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============3902289953306163629==--