Difference between revisions of "Bauplan style"
Jump to navigation
Jump to search
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
+ | < [[Sample documents]] | ||
+ | |||
A little environment to integrate your construction plans in a document.<br /> | A little environment to integrate your construction plans in a document.<br /> | ||
Example pdf: [[Media:Carport.pdf|Carport.pdf]]<br /> | Example pdf: [[Media:Carport.pdf|Carport.pdf]]<br /> | ||
This example is the result of the following ConTeXt code: | This example is the result of the following ConTeXt code: | ||
− | < | + | |
+ | <texcode> | ||
\environment e-bauplan | \environment e-bauplan | ||
\starttext | \starttext | ||
Line 20: | Line 23: | ||
\Plan[prefix=photo,ech=100,mm=25000,titre=Photo (2)] | \Plan[prefix=photo,ech=100,mm=25000,titre=Photo (2)] | ||
\stoptext | \stoptext | ||
− | </ | + | </texcode> |
And here the environment file: | And here the environment file: | ||
− | < | + | <texcode> |
\startenvironment e-bauplan | \startenvironment e-bauplan | ||
Line 44: | Line 47: | ||
%% Usage: \Plan[prefix=...,ech=...,mm=...,titre=...,projet=...,auteur=...] | %% Usage: \Plan[prefix=...,ech=...,mm=...,titre=...,projet=...,auteur=...] | ||
%% prefix: the name of the file is "prefix-mm.{eps,pdf,jpg}" | %% prefix: the name of the file is "prefix-mm.{eps,pdf,jpg}" | ||
− | %% ech: the scale | + | %% ech: the scale |
%% mm: the width of the image in mm | %% mm: the width of the image in mm | ||
%% titre: the titel of the page | %% titre: the titel of the page | ||
Line 52: | Line 55: | ||
\def\Plan[#1]{% | \def\Plan[#1]{% | ||
\getparameters[PL][#1] | \getparameters[PL][#1] | ||
− | \Width=\dimexpr(\the\numexpr(20*\PLmm/\PLech)mm/20) | + | \Width=\the\dimexpr(\the\numexpr(20*\PLmm/\PLech)mm/20) |
− | \def\myFig{\externalfigure[\PLprefix-\PLmm][width=\Width]}% | + | \def\myFig{\externalfigure[\PLprefix-\PLmm][width=\the\Width]}% |
\setbox\scratchbox\hbox{\myFig}\Height=\ht\scratchbox | \setbox\scratchbox\hbox{\myFig}\Height=\ht\scratchbox | ||
\ifdim\Width>1.2\Height | \ifdim\Width>1.2\Height | ||
Line 67: | Line 70: | ||
\stopstandardmakeup} | \stopstandardmakeup} | ||
\stopenvironment | \stopenvironment | ||
− | </ | + | </texcode> |
+ | |||
+ | An up to date version of this module can be found at http://pmrb.free.fr/work/OS/ConTeXt/ | ||
+ | |||
+ | [[Category:Sample documents]] |
Latest revision as of 21:10, 5 August 2022
A little environment to integrate your construction plans in a document.
Example pdf: Carport.pdf
This example is the result of the following ConTeXt code:
\environment e-bauplan \starttext \Plan[prefix=situ,ech=20000,mm=4150000,titre=Plan de situation, projet=Abri voiture,auteur=Peter Münster] \Plan[ech=2000,mm=351000,titre=Plan de situation (détail)] \Plan[prefix=masse,ech=500,mm=60800,titre=Plan de masse] \Plan[prefix=coupe,ech=100,mm=19620,titre=Coupe] \Plan[prefix=plan,ech=50,mm=10080,titre=Plan] \Plan[prefix=povray,ech=60,mm=15000,titre=Simulation (1)] \Plan[prefix=photo,ech=100,mm=25000,titre=Photo (2)] \stoptext
And here the environment file:
\startenvironment e-bauplan %% It's a French document: \useregime[il9] \enableregime[il9] \useencoding[ffr] \definehspace[fr][:][.16667em] \definehspace[fr][;][.16667em] \definehspace[fr][!][.16667em] \definehspace[fr][?][.16667em] \mainlanguage[fr] %% We need a lot of space: \setuplayout[header=0pt,footer=0pt,backspace=2cm,width=middle, topspace=1cm,height=middle] \setuppagenumbering[state=stop]% Doing it on our own. %% Usage: \Plan[prefix=...,ech=...,mm=...,titre=...,projet=...,auteur=...] %% prefix: the name of the file is "prefix-mm.{eps,pdf,jpg}" %% ech: the scale %% mm: the width of the image in mm %% titre: the titel of the page %% projet: the name of the project %% auteur: the name of the author; as "projet" only neccessary for the 1. page \newdimen\Width \newdimen\Height \def\Plan[#1]{% \getparameters[PL][#1] \Width=\the\dimexpr(\the\numexpr(20*\PLmm/\PLech)mm/20) \def\myFig{\externalfigure[\PLprefix-\PLmm][width=\the\Width]}% \setbox\scratchbox\hbox{\myFig}\Height=\ht\scratchbox \ifdim\Width>1.2\Height \setuppapersize[A4,landscape,rotated][A4] \else \setuppapersize[A4][A4] \fi \startstandardmakeup \midaligned{\myFig}\vfil {\tx Projet: \PLprojet, Auteur: \PLauteur, Date: \currentdate}\hfill \framed[align=lohi,offset=2ex]{{\bfc\PLtitre}\blank Échelle: 1/\PLech\quad\hfill(\currentpage/\lastpage)}\vskip0pt plus -1fil \stopstandardmakeup} \stopenvironment
An up to date version of this module can be found at http://pmrb.free.fr/work/OS/ConTeXt/