Fwd: Migrations: exactly LaTeX margins --> ConTeXt margins
---------- Forwarded message ----------
From: Xan xan
On 29-8-2010 7:11, Xan xan wrote:
Hi,
I want to "migrate" one LaTeX document to ConTeXt document. I only want to put the _exact_ margins LaTeX use for \documentclass[12pt,a4paper]{article}.
Anyone could say me the exact values I have to put in **layout**?
You first have to figure out what the exact latex values are. I suppose that they are documented somewhere or can be deduced from the document class (maybe make a list for more popular document classes).
At some point there can be a module doing things like
\definelayout[latex-article][...]
Hans
----------------------------------------------------------------- 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 -----------------------------------------------------------------
On 30-8-2010 11:23, Xan xan wrote:
There is a technical explanation in "The Not so Short Introduction to LaTeX" [tobi.oetiker.ch/lshort/lshort.pdf] (page 129)
It's too much for me. I supose there are equivalencies in ConTeXt but too bit tech for me.
sure, setuplayout can be used to define any layout I guess but I'm not going to read latex manuals (not even short ones) and reverse latex dimensions myself so it's up to other users then Hans ----------------------------------------------------------------- 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 -----------------------------------------------------------------
Xan xan wrote:
---------- Forwarded message ---------- From: Xan xan
Date: 2010/8/30 Subject: Re: [NTG-context] Migrations: exactly LaTeX margins --> ConTeXt margins To: Hans Hagen There is a technical explanation in "The Not so Short Introduction to LaTeX" [tobi.oetiker.ch/lshort/lshort.pdf] (page 129)
It's too much for me. I supose there are equivalencies in ConTeXt but too bit tech for me. You can \show (\showthe? I don't remember) vairous LaTeX dimensions:
Also look at http://www.mccme.ru/free-books/llang/newllang.pdf page 166. It is in Russian but the scheme should be self-explanatory. "дюйм" means "inch". I'm too lazy to find such scheme in English.
On Mon, Aug 30, 2010 at 16:02, Yury G. Kudryashov wrote:
Xan xan wrote:
There is a technical explanation in "The Not so Short Introduction to LaTeX" [tobi.oetiker.ch/lshort/lshort.pdf] (page 129)
It's too much for me. I supose there are equivalencies in ConTeXt but too bit tech for me. You can \show (\showthe? I don't remember) vairous LaTeX dimensions:
Also look at http://www.mccme.ru/free-books/llang/newllang.pdf page 166. It is in Russian but the scheme should be self-explanatory. "дюйм" means "inch". I'm too lazy to find such scheme in English.
Comparing with page 129 (143) of http://www.ctan.org/tex-archive/info/lshort/english/lshort.pdf ... (which is almost the same as the Russian drawing) it is possible to reverse-engineer the dimensions, but I crossed against something I don't understand straight away. The distance between paper border and text is [1]+[3]=1 inch + 0pt + 22pt (but that doesn't seem to be the case in A4 paper setting anyway), while width of left margin in [10] = 106pt which makes the margin stick out of paper, right? One could experiment with settings like these: \setuplayout [backspace=\dimexpr 1in+22pt\relax, % [1] + [3] = (1 inch + \hoffset=0pt) + \oddsidemargin=22pt leftmargindistance=7pt, % [9] = \marginparsep=7pt leftmargin=106pt, % [10] = \marginparwidth=106pt ] % etc. \starttext \showlayout \inleft{some text very very very very long margin} \input tufte \stoptext but the drawing in TNSS is lying a bit (or maybe ConTeXt is wrong ... :). Mojca
On 30-8-2010 5:03, Mojca Miklavec wrote:
it is possible to reverse-engineer the dimensions, but I crossed against something I don't understand straight away. The distance between paper border and text is [1]+[3]=1 inch + 0pt + 22pt (but that doesn't seem to be the case in A4 paper setting anyway), while width of left margin in [10] = 106pt which makes the margin stick out of paper, right?
That drawing on p 129 is somewhat puzzling. I get the impression that somehow these old-time 1in built-in dvi offsets are being used; in context these have been zeroed out right from the start
but the drawing in TNSS is lying a bit (or maybe ConTeXt is wrong ... :).
how can you doubt ! Hans ----------------------------------------------------------------- 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 -----------------------------------------------------------------
Al 30/08/10 17:03, En/na Mojca Miklavec ha escrit:
On Mon, Aug 30, 2010 at 16:02, Yury G. Kudryashov wrote:
Xan xan wrote:
There is a technical explanation in "The Not so Short Introduction to LaTeX" [tobi.oetiker.ch/lshort/lshort.pdf] (page 129)
It's too much for me. I supose there are equivalencies in ConTeXt but too bit tech for me.
You can \show (\showthe? I don't remember) vairous LaTeX dimensions:
Also look at http://www.mccme.ru/free-books/llang/newllang.pdf page 166. It is in Russian but the scheme should be self-explanatory. "дюйм" means "inch". I'm too lazy to find such scheme in English.
Comparing with page 129 (143) of http://www.ctan.org/tex-archive/info/lshort/english/lshort.pdf ... (which is almost the same as the Russian drawing)
it is possible to reverse-engineer the dimensions, but I crossed against something I don't understand straight away. The distance between paper border and text is [1]+[3]=1 inch + 0pt + 22pt (but that doesn't seem to be the case in A4 paper setting anyway), while width of left margin in [10] = 106pt which makes the margin stick out of paper, right?
One could experiment with settings like these:
\setuplayout [backspace=\dimexpr 1in+22pt\relax, % [1] + [3] = (1 inch + \hoffset=0pt) + \oddsidemargin=22pt leftmargindistance=7pt, % [9] = \marginparsep=7pt leftmargin=106pt, % [10] = \marginparwidth=106pt ] % etc. \starttext \showlayout \inleft{some text very very very very long margin} \input tufte \stoptext
but the drawing in TNSS is lying a bit (or maybe ConTeXt is wrong ... :).
Mojca
Thanks Mojca for trying it.... now you check that this was very difficult for a newbee as me ;-) If the exact way is too complicated, is there any **approximate** way to obtain the usually margins in LaTeX article in 10 pt? Thanks a lot, Xan.
On 08/31/2010 09:39 AM, xancorreu wrote:
\setuplayout [backspace=\dimexpr 1in+22pt\relax, % [1] + [3] = (1 inch + \hoffset=0pt) + \oddsidemargin=22pt
Mojca
Thanks Mojca for trying it.... now you check that this was very difficult for a newbee as me ;-)
You probably have to add another 1in to the backspace, for the \hoffset.
If the exact way is too complicated, is there any **approximate** way to obtain the usually margins in LaTeX article in 10 pt?
Sure there is: print an article.cls output pdf and measure the distances with a ruler (that is what I do when I need to mimic a layout). Best wishes, Taco
On Tue, Aug 31, 2010 at 09:42, Taco Hoekwater wrote:
On 08/31/2010 09:39 AM, xancorreu wrote:
\setuplayout [backspace=\dimexpr 1in+22pt\relax, % [1] + [3] = (1 inch + \hoffset=0pt) + \oddsidemargin=22pt
Mojca
Thanks Mojca for trying it.... now you check that this was very difficult for a newbee as me ;-)
You probably have to add another 1in to the backspace, for the \hoffset.
If the exact way is too complicated, is there any **approximate** way to obtain the usually margins in LaTeX article in 10 pt?
The exact way would be to read the LaTeX class and figure out what dimensions are being used there. The approximate way would be to visually compare the output of LaTeX and ConTeXt.
Sure there is: print an article.cls output pdf and measure the distances with a ruler (that is what I do when I need to mimic a layout).
Or take Adobe Acrobat and use measuring tool, or compare visually (aligning two documents in pdf viewer). If you print out the material there's always a chance that printer won't align the edges properly. The third option is to use the following in LaTeX to figure out what dimensions are being used in LaTeX, compare that with figure in The Not So Short Introduction to LaTeX and then use these numbers in ConTeXt (properly adjusted for the differences): hoffset=\the\hoffset\par oddsidemargin=\the\oddsidemargin\par marginparwidth=\the\marginparwidth\par textwidth=\the\textwidth\par But after I have managed to guess somehow that the horizontal dimensions were matching [backspace=\dimexpr 1in+31pt\relax width=\dimexpr 390pt\relax, in latex,12pt (but for some unknow reason hyphenation in ConTeXt was off, or at least at different penalty values, so I didn't manage to compare the line breaks) ... I realized that margins change if you try to use \documentclass[10pt,a4paper]{article} instead of 12pt, so one would need to account for that change as well. Mojca
Mojca Miklavec wrote:
On Tue, Aug 31, 2010 at 09:42, Taco Hoekwater wrote: to use \documentclass[10pt,a4paper]{article} instead of 12pt, so one would need to account for that change as well.
One more warning: AFAIR, [10pt,a4paper] != [a4paper,10pt].
On 31-8-2010 10:09, Mojca Miklavec wrote:
in latex,12pt (but for some unknow reason hyphenation in ConTeXt was off, or at least at different penalty values, so I didn't manage to compare the line breaks) ... I realized that margins change if you try to use \documentclass[10pt,a4paper]{article} instead of 12pt, so one would need to account for that change as well.
you can be pretty sure that defaults in context differe from those in latex, if only because latex never was the starting point Hans ----------------------------------------------------------------- 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 -----------------------------------------------------------------
I follow your suggestion: rule but I'm in trouble: with \setuplayout[topspace=3cm,leftmargin=3cm,rightmargin=3cm,header=2cm,footer=2cm,width=12cm,height=fit,backspace=3cm,rightedge=5cm,leftedge=5cm] I obtained a non-centered layout!!! leftedge and rightedge are the margins between the final of the paper and the {left,right}margin, isn't? How to center the layout with topspace=3cm, leftmargin=3cm, rightmargin=3cm, header=2cm, footer=2cm, width=12cm, height=fit, backspace=3cm ??? Thanks
On 31-8-2010 11:20, xancorreu wrote:
I follow your suggestion: rule but I'm in trouble: with
\setuplayout[topspace=3cm,leftmargin=3cm,rightmargin=3cm,header=2cm,footer=2cm,width=12cm,height=fit,backspace=3cm,rightedge=5cm,leftedge=5cm]
I obtained a non-centered layout!!! leftedge and rightedge are the margins between the final of the paper and the {left,right}margin, isn't?
How to center the layout with topspace=3cm, leftmargin=3cm, rightmargin=3cm, header=2cm, footer=2cm, width=12cm, height=fit, backspace=3cm
width=middle ----------------------------------------------------------------- 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 -----------------------------------------------------------------
Al 31/08/10 11:23, En/na Hans Hagen ha escrit:
On 31-8-2010 11:20, xancorreu wrote:
I follow your suggestion: rule but I'm in trouble: with
\setuplayout[topspace=3cm,leftmargin=3cm,rightmargin=3cm,header=2cm,footer=2cm,width=12cm,height=fit,backspace=3cm,rightedge=5cm,leftedge=5cm]
I obtained a non-centered layout!!! leftedge and rightedge are the margins between the final of the paper and the {left,right}margin, isn't?
How to center the layout with topspace=3cm, leftmargin=3cm, rightmargin=3cm, header=2cm, footer=2cm, width=12cm, height=fit, backspace=3cm
width=middle
----------------------------------------------------------------- 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 -----------------------------------------------------------------
WIth \setuplayout[topspace=3cm,leftmargin=3cm,rightmargin=3cm,header=2cm,footer=2cm,width=middle,height=fit,backspace=3cm,rightedge=5cm,leftedge=5cm] leftedge and rightedge are ignored. Arghhhh!!! Thanks, Xan.
On 31-8-2010 11:33, xancorreu wrote:
Al 31/08/10 11:23, En/na Hans Hagen ha escrit:
On 31-8-2010 11:20, xancorreu wrote:
I follow your suggestion: rule but I'm in trouble: with
\setuplayout[topspace=3cm,leftmargin=3cm,rightmargin=3cm,header=2cm,footer=2cm,width=12cm,height=fit,backspace=3cm,rightedge=5cm,leftedge=5cm]
I obtained a non-centered layout!!! leftedge and rightedge are the margins between the final of the paper and the {left,right}margin, isn't?
How to center the layout with topspace=3cm, leftmargin=3cm, rightmargin=3cm, header=2cm, footer=2cm, width=12cm, height=fit, backspace=3cm
width=middle
----------------------------------------------------------------- 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 -----------------------------------------------------------------
WIth
\setuplayout[topspace=3cm,leftmargin=3cm,rightmargin=3cm,header=2cm,footer=2cm,width=middle,height=fit,backspace=3cm,rightedge=5cm,leftedge=5cm]
leftedge and rightedge are ignored. Arghhhh!!!
margins and edges are sort of virtual; they only are used for putting stuff into (and then the dimensions determins the width etc) ... backspace and cutspace are the ones to use Hans ----------------------------------------------------------------- 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 -----------------------------------------------------------------
Simple case: % Margins \setuplayout[topspace=3cm,leftmargin=5cm,rightmargin=5cm,header=2cm,footer=2cm,width=middle,height=fit,backspace=3cm] the left and rightmargin values are ignored: 5cm, 2cm no matter... always the same.
On 31-8-2010 9:39, xancorreu wrote:
Thanks Mojca for trying it.... now you check that this was very difficult for a newbee as me ;-)
Seems difficult for anyone so I think that Taco's approach: "just measure" is the safest. After all, you will never get 100% compatible output. Hans ----------------------------------------------------------------- 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 -----------------------------------------------------------------
Al 31/08/10 11:16, En/na Hans Hagen ha escrit:
On 31-8-2010 9:39, xancorreu wrote:
Thanks Mojca for trying it.... now you check that this was very difficult for a newbee as me ;-)
Seems difficult for anyone so I think that Taco's approach: "just measure" is the safest. After all, you will never get 100% compatible output.
Hans
Yeah but it's a little bit "chapucero" (spanish) ;-) Xan.
participants (6)
-
Hans Hagen
-
Mojca Miklavec
-
Taco Hoekwater
-
Xan xan
-
xancorreu
-
Yury G. Kudryashov