The imposition of the basic inscriptions GOST 2.104 (framework) for LaTeX documents
Despite the fact that many believe our state standards ESKD and the UNIFIED legacy, engineering and program documentation necessary to comply with them.
When I was very young "expert" with sadness I have watched Microsoft Office written specifications, programs and test methods. Sometimes these documents are very complicated and long. The most frightening were the main inscription placed in the footer. They did not correspond to GOST 2.104. In the vernacular they are called "framework". They were terrible. I have not seen that someone managed to do them correctly. Swam the sizes, thicknesses of lines. It was visible even without a ruler.
Imagine a software project without using any version control system. Sounds ridiculous. However, few people bother writing complex documents in Microsoft Office'means the file Format is binary, to keep track of any changes impossible. To establish the authorship of the lines is not possible. To work with multiple people on one document at a time is also impossible. Editing documents with a length of 500 pages, with many drawings, sometimes almost impossible. Modern computers with lots of RAM, of course, handle this much better than 5 years ago.
That's why I switched to LaTeX (more precisely XeTeX). All documents immediately began to fit in SVN. It was no problem to insert into the document vector of the image — it looked amazing. No problem set the author of each line. The document even it was possible to write comments, directly as in si.
There was one problem. Documents needed to put those same "frame". Maybe I'm bad looking, but at the time I found no ready-made solutions, or they did not suit me on quality. I know that LaTeX is Turing-complete and that with commands, you can draw anything. However, at that time my knowledge of C was 100 times better than LaTeX. In fact, the transition to LaTeX was not so painless.
I was full of determination, I needed whatever was to implement the plans. I knew about the existence of pdftk. With it you can overlay one PDF document over another. I just had to generate a document containing only "framework". Then I could overlay it on any PDF document.
I already loved inkscape. After reviewing the structure of the SVG file, I realized to generate it is not so difficult. It is not nearly as difficult generate HTML using PHP. inkscape can export SVG to PDF, including from the command line. A couple of days I wrote a C program that generates any formats for any design documents. You must specify the document type (text or drawing), sheet size, orientation and number of sheets. Each count sheet is numbered in accordance with GOST 2.104. For example, in field 11 fit the names of the persons signing the document. Data that needs to be filled in the appropriate column, I decided to store in a plain text file in a table with tab as delimiter.
Source file:
the
Result:

Was quickly-written makefile that automated this entire process. In General, the Assembly process was performed in the following way:
1. The required number of times is called LaTeX. Usually need two passes, very rarely three;
2. Using pdftk to extract the number of pages (N) from a PDF file generated by Latex ohms;
3. Runs the generator sheet. It turns out N SVG-files;
4. Every SVG file is converted to PDF format using inkscape. N it turns out PDF files;
So very beautiful with beautiful instruments "framework". However, there was one drawback. In order to impose a "frame" on the PDF-file (PDF-file) must be divided into separate pages. Then, after applying again to collect together. Consequently, the document size is increased almost N times, where N is the number of pages. As well stopped working to cross-reference and disappearing content (PDF).
To solve this problem, it was necessary to implement the imposition of a "framework" directly using LaTeX. Came to the aid of the command \AddToShipoutPicture. It allows you to put a background on the page. Everything was solved with the following piece of code:
the
A Form File.pdf is a multi-page document with a border.
Now everything was fine. The file size once again increased, the major labels looked as it should, and was in the right place with the right scale.
a Fragment of the text document:

the
There are a number of text documents (GOST 2.106), which represent a table. These documents include specifications and various statements. Also widespread lists of elements. I don't understand why these documents draw in Autocad E. it takes a lot of time.
Spending a little more time, I wrote a small console utility that convert normal CSV file to the specification or statement of purchased products, for example.
Sample list of items:

the
All written refers to 2009. After that, I honestly never tried to look for alternatives, as the decision was completely satisfied until now. Changes, if necessary, are made easy because everything is written with his own hand. During development were used only standard libraries C and C++. For a time it was used under Windows.
In the end made a build system for design documentation. The need to use any proprietary software has almost disappeared. With inkscape you can do quite complex drawings. Yeah, it wasn't designed for it, but it is absolutely free unlike AutoCAD, for example.
Packaging design documentation, just go to the directory and execute make. All documents are collected and stacked in a separate place. Automatically counts the number of sheets for each document separately and for the whole project. Sometimes these numbers are very necessary, and to count hands is not interesting, especially when documents are over 100 and they periodically change.
UPD: All of the above is available in a particular approach on github: github.com/kutelev/gost_forms
Article based on information from habrahabr.ru
When I was very young "expert" with sadness I have watched Microsoft Office written specifications, programs and test methods. Sometimes these documents are very complicated and long. The most frightening were the main inscription placed in the footer. They did not correspond to GOST 2.104. In the vernacular they are called "framework". They were terrible. I have not seen that someone managed to do them correctly. Swam the sizes, thicknesses of lines. It was visible even without a ruler.
Imagine a software project without using any version control system. Sounds ridiculous. However, few people bother writing complex documents in Microsoft Office'means the file Format is binary, to keep track of any changes impossible. To establish the authorship of the lines is not possible. To work with multiple people on one document at a time is also impossible. Editing documents with a length of 500 pages, with many drawings, sometimes almost impossible. Modern computers with lots of RAM, of course, handle this much better than 5 years ago.
That's why I switched to LaTeX (more precisely XeTeX). All documents immediately began to fit in SVN. It was no problem to insert into the document vector of the image — it looked amazing. No problem set the author of each line. The document even it was possible to write comments, directly as in si.
There was one problem. Documents needed to put those same "frame". Maybe I'm bad looking, but at the time I found no ready-made solutions, or they did not suit me on quality. I know that LaTeX is Turing-complete and that with commands, you can draw anything. However, at that time my knowledge of C was 100 times better than LaTeX. In fact, the transition to LaTeX was not so painless.
I was full of determination, I needed whatever was to implement the plans. I knew about the existence of pdftk. With it you can overlay one PDF document over another. I just had to generate a document containing only "framework". Then I could overlay it on any PDF document.
I already loved inkscape. After reviewing the structure of the SVG file, I realized to generate it is not so difficult. It is not nearly as difficult generate HTML using PHP. inkscape can export SVG to PDF, including from the command line. A couple of days I wrote a C program that generates any formats for any design documents. You must specify the document type (text or drawing), sheet size, orientation and number of sheets. Each count sheet is numbered in accordance with GOST 2.104. For example, in field 11 fit the names of the persons signing the document. Data that needs to be filled in the appropriate column, I decided to store in a plain text file in a table with tab as delimiter.
Source file:
the
Drawing A4 1 0 Detector 1 1 Assembly drawing 2 0 ABC.123456.001 SB 6 0 1:1 11 0 Ivanov 11 1 Sidorov 11 2 Petrov 11 4 falcons 11 5 Kuznetsov
Result:

Was quickly-written makefile that automated this entire process. In General, the Assembly process was performed in the following way:
1. The required number of times is called LaTeX. Usually need two passes, very rarely three;
2. Using pdftk to extract the number of pages (N) from a PDF file generated by Latex ohms;
3. Runs the generator sheet. It turns out N SVG-files;
4. Every SVG file is converted to PDF format using inkscape. N it turns out PDF files;
So very beautiful with beautiful instruments "framework". However, there was one drawback. In order to impose a "frame" on the PDF-file (PDF-file) must be divided into separate pages. Then, after applying again to collect together. Consequently, the document size is increased almost N times, where N is the number of pages. As well stopped working to cross-reference and disappearing content (PDF).
To solve this problem, it was necessary to implement the imposition of a "framework" directly using LaTeX. Came to the aid of the command \AddToShipoutPicture. It allows you to put a background on the page. Everything was solved with the following piece of code:
the
\ifdefined\overlaypass
\newcounter{overlaypage}
\setcounter{overlaypage}{1}
\AddToShipoutPicture{\AtPageLowerLeft{\includegraphics[page=\arabic{overlaypage}]
{./Form/Form.pdf}\stepcounter{overlaypage}}}
\fi
A Form File.pdf is a multi-page document with a border.
Now everything was fine. The file size once again increased, the major labels looked as it should, and was in the right place with the right scale.
a Fragment of the text document:

the
is not about LaTeX
There are a number of text documents (GOST 2.106), which represent a table. These documents include specifications and various statements. Also widespread lists of elements. I don't understand why these documents draw in Autocad E. it takes a lot of time.
Spending a little more time, I wrote a small console utility that convert normal CSV file to the specification or statement of purchased products, for example.
Sample list of items:

Source file
H Chokes L L1 D3 - 03 - 0.16 GOST 17597 - 78 1 L L2 D 25 - 0.08 - 1.1 GOST 17597 - 78 1 L H Capacitors L C1 КТ4 - 24 - 180мкФ burn suppliers: produc.460.021 TU 1 L S2 KM - 5 - 100µf ±10% burn suppliers: produc.460.021 TU 1 L S3 KM - 5 - 51мкФ ±10% burn suppliers: produc.460.021 TU 1 L C4 KM - 5 - 160мкФ ±10% burn suppliers: produc.460.021 TU 1 L C5 KM - 5 - 51мкФ ±10% burn suppliers: produc.460.021 TU 1 L C6, C7 KM - 5 - 36мкФ ±10% burn suppliers: produc.460.021 TU 2 L C8 KM - 5 - 0.15 µf ±10% burn suppliers: produc.460.021 TU 1 L C9 KM - 5 - 200мкФ ±10% burn suppliers: produc.460.021 TU 1 L C10 KM - 5 - 0.047 UF ±10% burn suppliers: produc.460.021 TU 1 L C11 K53 - 16 - 50mkf ± 20% burn suppliers: produc.460.021 TU 1 L H IC L DD1 К176ЛП2 GOST 9336-31 1
the
Conclusion
All written refers to 2009. After that, I honestly never tried to look for alternatives, as the decision was completely satisfied until now. Changes, if necessary, are made easy because everything is written with his own hand. During development were used only standard libraries C and C++. For a time it was used under Windows.
In the end made a build system for design documentation. The need to use any proprietary software has almost disappeared. With inkscape you can do quite complex drawings. Yeah, it wasn't designed for it, but it is absolutely free unlike AutoCAD, for example.
Packaging design documentation, just go to the directory and execute make. All documents are collected and stacked in a separate place. Automatically counts the number of sheets for each document separately and for the whole project. Sometimes these numbers are very necessary, and to count hands is not interesting, especially when documents are over 100 and they periodically change.
UPD: All of the above is available in a particular approach on github: github.com/kutelev/gost_forms
Комментарии
Отправить комментарий