Migrations: exactly LaTeX margins --> ConTeXt margins
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**? Thanks, 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 -----------------------------------------------------------------
Am 30.08.2010 um 08:33 schrieb Hans Hagen:
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][...]
I looked now in the files where the layout for the standard classes in latex is defined and it's a mess to reproduce them in context because all values depend on the papersize and fontsize and it takes a lot of code (even with etex’s \dimexpr) because there are checks whether a calculated dimensions exceeds a fixed limit. This is how the layout for a document with a fontsize of 10pt looks: \definelayout [latex10] [width=\ifdim\dimexpr\paperwidth-2in\relax>345pt\relax 345pt\else\dimexpr\paperwidth-2in\relax\fi, % \paperwidth-2in or 345pt, use the smaller value backspace=\dimexpr(\paperwidth-\textwidth)/2-1in\relax, leftmargindistance=7pt, leftmargin=, topspace=, header=12pt, headerdistance=.25in, height=, footer=, footerdistance=,] Wolfgang
Al 31/08/10 12:22, En/na Wolfgang Schuster ha escrit:
\definelayout [latex10] [width=\ifdim\dimexpr\paperwidth-2in\relax>345pt\relax 345pt\else\dimexpr\paperwidth-2in\relax\fi, % \paperwidth-2in or 345pt, use the smaller value backspace=\dimexpr(\paperwidth-\textwidth)/2-1in\relax, leftmargindistance=7pt, leftmargin=, topspace=, header=12pt, headerdistance=.25in, height=, footer=, footerdistance=,]
Thank you very much for your effort, but it does not work for me: ! Missing number, treated as zero. <to be read again> \global \dorecalculatelayout ...ter \c!leftmargin \global \rightmarginwidth \layoutp... \dosetuplayout ...#1}}}\fi \fi \recalculatelayout \checkcurrentlayout \prese... <to be read again> \par l.36 ? x No pages of output. Transcript written on arxiv.log. For now, I use % Margins \setuplayout[topspace=3cm,leftmargin=3cm,rightmargin=3cm,header=2cm,footer=2cm,width=middle,height=fit,backspace=4.4cm] with approximate the latex in 10.
Am 31.08.2010 um 18:33 schrieb xancorreu:
Al 31/08/10 12:22, En/na Wolfgang Schuster ha escrit:
\definelayout [latex10] [width=\ifdim\dimexpr\paperwidth-2in\relax>345pt\relax 345pt\else\dimexpr\paperwidth-2in\relax\fi, % \paperwidth-2in or 345pt, use the smaller value backspace=\dimexpr(\paperwidth-\textwidth)/2-1in\relax, leftmargindistance=7pt, leftmargin=, topspace=, header=12pt, headerdistance=.25in, height=, footer=, footerdistance=,]
Thank you very much for your effort, but it does not work for me:
This was just a example to show you how difficult it is to emulate latex’s layout in context because the values depend on different paramaters like the fontsize and the papersize. The example does not work because a few value like topspace or height are missing and this is why you get the error messages. Wolfgang
Al 31/08/10 22:29, En/na Wolfgang Schuster ha escrit:
Am 31.08.2010 um 18:33 schrieb xancorreu:
Al 31/08/10 12:22, En/na Wolfgang Schuster ha escrit:
\definelayout [latex10] [width=\ifdim\dimexpr\paperwidth-2in\relax>345pt\relax 345pt\else\dimexpr\paperwidth-2in\relax\fi, % \paperwidth-2in or 345pt, use the smaller value backspace=\dimexpr(\paperwidth-\textwidth)/2-1in\relax, leftmargindistance=7pt, leftmargin=, topspace=, header=12pt, headerdistance=.25in, height=, footer=, footerdistance=,]
Thank you very much for your effort, but it does not work for me:
This was just a example to show you how difficult it is to emulate latex’s layout in context because the values depend on different paramaters like the fontsize and the papersize. The example does not work because a few value like topspace or height are missing and this is why you get the error messages.
Wolfgang
Yes, it's true but I thought that because all is TeX based then there are similar in basic elements (like this). But definitely, they are very differents.... Xan.
Yes, it's true but I thought that because all is TeX based then there are similar in basic elements (like this). But definitely, they are very differents....
TeX is the typesetting engine, it acts as a much lower level than this. The similarities are in the line-breaking and paragraph-shaping algorithms, macro expansion, etc., not in the way the layout of the text is controlled (text width, margins and the like). In fact, the latter even is one of the areas where ConTeXt is *totally different* from LaTeX since, as was hinted, LaTeX never was considered when ConTeXt started. Arthur
participants (5)
-
Arthur Reutenauer
-
Hans Hagen
-
Wolfgang Schuster
-
Xan xan
-
xancorreu