ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [***SPAM***] Two-language environment and page breaking
@ 2013-05-21  6:01 "H. Özoguz"
  2013-05-22 19:51 ` Peter Münster
  0 siblings, 1 reply; 3+ messages in thread
From: "H. Özoguz" @ 2013-05-21  6:01 UTC (permalink / raw)
  To: ntg-context

Hi,

one more question to my arabic-german table environment. See this code:

\definefont[amiri][file:UthmanTN1Ver10.ttf*arabic at 11 pt] % or 
amiri-regular.ttf
\define[1]\Arab{\setupalign[r2l]\amiri#1}
%\showgrid
\startsetups[arde]
\setupTABLE[c][1][rightframe=on]
\stopsetups
\def\startarde
{\bTABLE[frame=off,width=.5\textwidth,setups=arde,split=yes]}
\def\stoparde
{\eTABLE}
\define[2]\arde
{\bTR
\bTD [align={tolerant, stretch}, 
roffset=1ex,style={\setupinterlinespace[line=3ex]}] #1\eTD
\bTD[align={r2l,tolerant,stretch}, 
loffset=1ex,style={\amiri\setupinterlinespace[line=5.4ex]}] #2 \eTD
\eTR}
\starttext
\startarde
\arde{%
Dies ist nur ein vollkommen sinnfreier Text und hat rein gar nichts mit 
dem Arabischen auf der rechten Seiten zutun. Wirklich gar nichts. 
Glauben Sie es mir? Also versuchen Sie nicht den Sinn des Arabischen 
hierdurch zu erfassen.
}
{%
اللهُمَّ ارْزُقْنِي حَجَّ بَيْتِك الحَرامِ فِي عامِي هذا وَفِي كُلِّ عامٍ ما أَبْقَيْتَنِي فِي يُسْرٍ مِنْكَ 
وَعافِيَةٍ وَسَعَةِ رِزْقِ، وَلا تُخْلِنِي

مِنْ تِلْكَ المَواقِفِ الكَرِيِمَةِ وَالمَشاهِدِ الشَّرِيفَةِ، وَزِيارَةِ قَبْرِ نَبِيِّكَ صَلَواتُكَ عَلَيْهِ 
وَآلِهِ، وَفِي جَمِيعِ حَوائِجِ الدُّنْيا وَالآخرةِ فَكُنْ
}
\stoparde
\blank
{\bf Should be the same like:}\blank
\startarde
\arde{%
Dies ist nur ein vollkommen sinnfreier Text und hat rein gar nichts mit 
dem Arabischen auf der rechten Seiten zutun.
}
{%
اللهُمَّ ارْزُقْنِي حَجَّ بَيْتِك الحَرامِ فِي عامِي هذا وَفِي كُلِّ عامٍ ما أَبْقَيْتَنِي فِي يُسْرٍ مِنْكَ 
وَعافِيَةٍ وَسَعَةِ رِزْقِ، وَلا تُخْلِنِي
}
\arde{Wirklich gar nichts. Glauben Sie es mir? Also versuchen Sie nicht 
den Sinn des Arabischen hierdurch zu erfassen.}{مِنْ تِلْكَ المَواقِفِ الكَرِيِمَةِ 
وَالمَشاهِدِ الشَّرِيفَةِ، وَزِيارَةِ قَبْرِ نَبِيِّكَ صَلَواتُكَ عَلَيْهِ وَآلِهِ، وَفِي جَمِيعِ حَوائِجِ 
الدُّنْيا وَالآخرةِ فَكُنْ }
\stoparde
\stoptext

In the code you see two \startarde\stoparde blocks. The first block is 
the example, the correct setting. But the first block can not be broken 
over pages. This is fixed by the second block, where I seperated the 
text into two "\arde", so now it can be broken over pages, because they 
are now two different tables. But if they are NOT broken over pages, 
they sould be set as if they were only one table, so as in the first 
"\startarde\stoparde" block. But the are not. You see the small distance 
between them.

Is there a way to produce the behavior I descibed? It would be a 
workaround to get natural tables, which can be broken over pages (my 
manually sperating them). (Only natural tables are possible for this 
environment, and not normales tables, because of the needed different 
interlinespace of the two columns).

Thanks.
Huseyin













___________________________________________________________________________________
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] 3+ messages in thread

* Re: Two-language environment and page breaking
  2013-05-21  6:01 [***SPAM***] Two-language environment and page breaking "H. Özoguz"
@ 2013-05-22 19:51 ` Peter Münster
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Münster @ 2013-05-22 19:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

On Tue, May 21 2013, H. Özoguz wrote:

> But if they are NOT broken over pages, they sould be set as if they
> were only one table, so as in the first "\startarde\stoparde" block.
> But the are not. You see the small distance between them.

Hi,

I don't know a real solution, just 2 workarounds:

1.) A \vskip-3pt between the 2 paragraphs.

2.) My cld-hack, as shown in the 2 attached files.

-- 
           Peter

[-- Attachment #2: german-arab.cld --]
[-- Type: application/octet-stream, Size: 2606 bytes --]

local C = context
local format = string.format

local function create_environment()
  local fp = io.open("env.tex", "w")
  fp:write([[
\startenvironment env

\def\GermanText{\dorecurse{10}
  {Dies ist nur ein vollkommen sinnfreier Text und hat rein gar nichts mit dem
   Arabischen auf der rechten Seiten zutun. Wirklich gar nichts. Glauben Sie es
   mir? Also versuchen Sie nicht den Sinn des Arabischen hierdurch zu
   erfassen.\par}}
\def\ArabText{\dorecurse{10}
  {اللهُمَّ ارْزُقْنِي حَجَّ بَيْتِك الحَرامِ فِي عامِي هذا وَفِي كُلِّ عامٍ ما أَبْقَيْتَنِي فِي
   يُسْرٍ مِنْكَ وَعافِيَةٍ وَسَعَةِ رِزْقِ، وَلا تُخْلِنِي

   مِنْ تِلْكَ المَواقِفِ الكَرِيِمَةِ وَالمَشاهِدِ الشَّرِيفَةِ، وَزِيارَةِ قَبْرِ نَبِيِّكَ صَلَواتُكَ
   عَلَيْهِ وَآلِهِ، وَفِي جَمِيعِ حَوائِجِ الدُّنْيا وَالآخرةِ فَكُنْ
   \par}}
\def\Fig{%
  \placefigure[none]{}{\externalfigure[cow.pdf][width=\textwidth]}\par}
\definefont[amiri][file:UthmanTN1Ver10.otf*arabic at 11 pt]
\setupexternalfigures[location=default]
\def\ColumnDistance{1cm}

\startmode[columns]
  \definepapersize[columns][
    width=\dimexpr (\textwidth - \ColumnDistance) / 2 \relax,
    height=\textheight]
  \setuppapersize[columns]
  \setuplayout[page]
  \setuppagenumbering[location=]
  \setupalign[verytolerant, stretch, line]
  \setupwhitespace[small]
\stopmode

\startbuffer[german]
  \GermanText\Fig\GermanText
\stopbuffer

\startbuffer[arab]
  \setupalign[r2l, tolerant, stretch]
  \amiri\setupinterlinespace[line=5.4ex]
  \ArabText\Fig\ArabText
\stopbuffer

\stopenvironment
]])
  fp:close()
end

local function create_pages(s)
  local fp = io.open("pages.tex", "w")
  fp:write(format([[
\enablemode[columns]
\environment env
\starttext
\getbuffer[%s]
\stoptext
]], s))
  fp:close()
  os.execute(format("context --result=pages-%s pages", s))
end

local function create_columns(l, r)
  local function pdf(x) return "pages-" .. x .. ".pdf" end
  create_pages(l)
  create_pages(r)
  local pdfobj = epdf.open(pdf(l))
  local n = pdfobj:getNumPages()
  for i = 1, n do
    C.dontleavehmode()
    C.externalfigure({pdf(l)}, {page = i})
    C"\\hskip\\ColumnDistance"
    C.externalfigure({pdf(r)}, {page = i})
    C.page()
  end
end

create_environment()
C.environment(false, "env ")
C.starttext()
C"Before"
C.page()
create_columns("german", "arab")
C"After"
C.stoptext()

[-- Attachment #3: german-arab.pdf --]
[-- Type: application/pdf, Size: 76240 bytes --]

[-- Attachment #4: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Two-language environment and page breaking
@ 2013-05-23 11:02 Eslamica
  0 siblings, 0 replies; 3+ messages in thread
From: Eslamica @ 2013-05-23 11:02 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1516 bytes --]

Just to try another attempt for getting hints from you: You can see in 
the examples, the the middle vertical line (which is just the right 
frame of the left cell) is not exactly as high as the text needs. It is 
a bit higher and stick a little bit out, at the beginning (top) and at 
the end (bottom) of the natural table. How to fix this, so that the 
vertical line (right border frame) exactly ends and begins with the 
textline? That would help to get an exact connection to the next block.

Of course the alternative would be to set frame=off for the tables and 
to place an vertical line as overlay on every single page (as 
background). But for that I would have to use the length of the text on 
a page, to adjust the line as long, as needed, not longer, not over the 
complete page every time.

Thanks!
Huseyin



-- 

*Hüseyin Özoguz
**
Verlag Eslamica -- www.eslamica.de <http://www.eslamica.de>**
**m-haditec * GmbH &Co. KG
Georg-Wulf-Str. 15
D-28199 Bremen
Telefon+49 (0) 421 1611 2763
Fax+49 (0) 421 3331667
e-Mail: h.oezoguz@m-haditec.de
www.mhaditec.de <http://www.m-haditec.de/>


Sitz der Gesellschaft Bremen
Amtsgericht Bremen, HRA 23526
Ust-IdNr.: 237875374

Persönlich haftende Gesellschafterin
m-haditec GmbH
Sitz der Gesellschaft Bremen
Amtsgericht Bremen, HRA 22270
Geschäftsführer:
Dr.-Ing. Yavuz Özoguz
Dr.-Ing. Gürhan Özoguz

Raiffeisen-Volksbank
BLZ: 280 671 70, Kto. Nr.: 711 894 500
IBAN: DE70 2806 7170 0711 8945 00
BIC: GENODEF1GSC


[-- Attachment #1.2: Type: text/html, Size: 3469 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2013-05-23 11:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-21  6:01 [***SPAM***] Two-language environment and page breaking "H. Özoguz"
2013-05-22 19:51 ` Peter Münster
2013-05-23 11:02 Eslamica

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