From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/79320 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Manuel_Gonz=E1lez_Su=E1rez?= Newsgroups: gmane.comp.tex.context Subject: Re: Latex to ConTeXt Date: Mon, 19 Nov 2012 09:16:54 +0100 Message-ID: References: <50A6C82F.9020002@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0210882082==" X-Trace: ger.gmane.org 1353313417 28505 80.91.229.3 (19 Nov 2012 08:23:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Nov 2012 08:23:37 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Nov 19 09:23:46 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TaMcF-0002n3-Fn for gctc-ntg-context-518@m.gmane.org; Mon, 19 Nov 2012 09:22:03 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C1AAD10206; Mon, 19 Nov 2012 09:21:52 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 3XPwjdXFrjlQ; Mon, 19 Nov 2012 09:21:49 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id B05401020A; Mon, 19 Nov 2012 09:21:49 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E36781022B for ; Mon, 19 Nov 2012 09:16:56 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id sjrGj4U8MEML for ; Mon, 19 Nov 2012 09:16:55 +0100 (CET) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id 7E95810215 for ; Mon, 19 Nov 2012 09:16:55 +0100 (CET) Original-Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id qAJ8GsZv002520 for ; Mon, 19 Nov 2012 09:16:54 +0100 Original-Received: by mail-la0-f41.google.com with SMTP id m15so2019949lah.14 for ; Mon, 19 Nov 2012 00:16:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=VboDUxggpjYuWoUw4/sKLz1y+ecEy8XDQOFWiTavGFY=; b=V7xFAzGKp9VknYkcsO4Zaw0f90SfFFnKn6vzaeoxrpeAbc8X0r1Wd9BSMvMbh1d9Vk 3DzRPuVnsTfr/u/XKF6S6JExxGFqgua/6dFnh0XlMphrgVADjawj7SAcXlF3EXnj79i7 3uK6xmhsoJnEvQXTq8HurQHL6iNPLur5XGgkG/2CNoNRhVW60GtmmtzlBUOkMyNB2RfH CYWgpSnPwLk/aQa/4SNfas72sXrG25Gf6CwHf3czXK8dOUTa/CGpw4QKEJkb3prOlirM MV+rRwf9mH1YV98ZVs88eoMBtLoHxKJ7O8Dz7NVKXi8Oc9XBImNyZsmEAE3/D+hDZ9Qn DWCg== Original-Received: by 10.152.105.33 with SMTP id gj1mr10827290lab.49.1353313014104; Mon, 19 Nov 2012 00:16:54 -0800 (PST) Original-Received: by 10.112.163.169 with HTTP; Mon, 19 Nov 2012 00:16:54 -0800 (PST) In-Reply-To: <50A6C82F.9020002@wxs.nl> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.215.41; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03IpkgSb8 - 8cb87caec5ce - 20121119 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.71 X-Mailman-Approved-At: Mon, 19 Nov 2012 09:21:49 +0100 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 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-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:79320 Archived-At: --===============0210882082== Content-Type: multipart/alternative; boundary=f46d040716e379c20b04ced4bd8c --f46d040716e379c20b04ced4bd8c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks very much, Hans. The second solution is very good. Manuel 2012/11/17 Hans Hagen > On 11/15/2012 9:20 AM, Proch=C3=A1zka Luk=C3=A1=C5=A1 Ing. - Pontex s. r.= o. wrote: > >> On Thu, 15 Nov 2012 09:07:55 +0100, MANUEL GONZALEZ SUAREZ >> wrote: >> >> >>> Hello. >>> >>> I wish someone would help me "translate" this code LaTeX to ConTeXt. >>> It is a >>> command to do word by word translations, so that a word appears under >>> another. >>> >>> Here's the code: >>> >>> \newcommand\dos[2]{\begin{**tabular}{@{}c}{\textDidot{\** >>> footnotesize#1}}\\{\**scriptsize\em#2}\end{tabular}} >>> >>> >> A picture of the result would be nice - we probably won't know what to >> reach. >> >> >>> >>> Thanks >>> >> >> Something like this? >> >> ---- >> % >> \newcommand\dos[2]{\begin{**tabular}{@{}c}{\textDidot{\** >> footnotesize#1}}\\{\**scriptsize\em#2}\end{tabular}} >> >> >> \define[2]\dos{% >> \bTABLE >> \setupTABLE[align=3Dmiddle] >> \setupTABLE[r][1][style=3D\**small] >> \setupTABLE[r][2][style=3D{\**small\small\em}] >> \bTR\bTD#1\eTD\eTR >> \bTR\bTD#2\eTD\eTR >> \eTABLE >> } >> >> \starttext >> Some text \dos{Abc}{Def} >> \stoptext >> > > more efficient: > > \unexpanded\def\dos#1#2% > {\dontleavehmode > \begingroup > \setbox0\struttedbox{#1}% > \setbox2\struttedbox{#2}% > \ifdim\wd0>\wd2 > \setbox2\hbox to \wd0{\hss\box2\hss}% > \else > \setbox0\hbox to \wd2{\hss\box0\hss}% > \fi > \box0 > \kern-\wd2 > \raise\lineheight\box2 > \endgroup} > > > > -- > > ------------------------------**------------------------------**----- > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com > | www.pragma-pod.nl > ------------------------------**------------------------------**----- > ______________________________**______________________________** > _______________________ > 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 > ______________________________**______________________________** > _______________________ > --f46d040716e379c20b04ced4bd8c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks very much, Hans.
The second solution is very good.
Man= uel

2012/11/17 Hans Hagen <pragma@wxs.nl= >
On 11/15/2012 9:20 AM, Proch=C3=A1zka Luk=C3= =A1=C5=A1 Ing. - Pontex s. r. o. wrote:
On Thu, 15 Nov 2012 09:07:55 +0100, MANUEL GONZALEZ SUAREZ
<gonzalez= smanuel@uniovi.es> wrote:


Hello.

I wish someone would help me "translate" this code LaTeX to ConTe= Xt.
It is a
command to do word by word translations, so that a word appears under
another.

Here's the code:

\newcommand\dos[2]{\begin{tabular}{@{}c}{\textDidot{\footnote= size#1}}\\{\scriptsize\em#2}\end{tabular}}


A picture of the result would be nice - we probably won't know what to<= br> reach.



Thanks

Something like this?

----
%
\newcommand\dos[2]{\begin{tabular}{@{}c}{\textDidot{\footnote= size#1}}\\{\scriptsize\em#2}\end{tabular}}


\define[2]\dos{%
=C2=A0 =C2=A0\bTABLE
=C2=A0 =C2=A0 =C2=A0\setupTABLE[align=3Dmiddle]
=C2=A0 =C2=A0 =C2=A0\setupTABLE[r][1][style=3D\small]
=C2=A0 =C2=A0 =C2=A0\setupTABLE[r][2][style=3D{\small\small\em}]
=C2=A0 =C2=A0 =C2=A0\bTR\bTD#1\eTD\eTR
=C2=A0 =C2=A0 =C2=A0\bTR\bTD#2\eTD\eTR
=C2=A0 =C2=A0\eTABLE
}

\starttext
=C2=A0 =C2=A0Some text \dos{Abc}{Def}
\stoptext

more efficient:

\unexpanded\def\dos#1#2%
=C2=A0 {\dontleavehmode
=C2=A0 =C2=A0\begingroup
=C2=A0 =C2=A0\setbox0\struttedbox{#1}%
=C2=A0 =C2=A0\setbox2\struttedbox{#2}%
=C2=A0 =C2=A0\ifdim\wd0>\wd2
=C2=A0 =C2=A0 =C2=A0\setbox2\hbox to \wd0{\hss\box2\hss}%
=C2=A0 =C2=A0\else
=C2=A0 =C2=A0 =C2=A0\setbox0\hbox to \wd2{\hss\box0\hss}%
=C2=A0 =C2=A0\fi
=C2=A0 =C2=A0\box0
=C2=A0 =C2=A0\kern-\wd2
=C2=A0 =C2=A0\raise\lineheight\box2
=C2=A0 =C2=A0\endgroup}



--

-------------------------------------------------------------= ----
=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 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 H= ans Hagen | PRAGMA ADE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Ridderstraat 27 | 8061 GH = Hasselt | The Netherlands
=C2=A0 =C2=A0 tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
=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 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0| www.p= ragma-pod.nl
-------------------------------------------------------------= ----
_____________________________________________________________= ______________________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage =C2=A0:
http= ://www.pragma-ade.nl / http://tex.aanhet.net
archive =C2=A0: http://foundry.supelec.fr/projects/contextrev/=
wiki =C2=A0 =C2=A0 : http://contextgarden.net
_____________________________________________________________= ______________________

--f46d040716e379c20b04ced4bd8c-- --===============0210882082== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0210882082==--