4

I think this was never asked, or at least from what I saw questions have been asked more than 15 years ago and has become obsolete (I found this recent link but it did not work for me). I want to tell you that recently I started using the AutoCAD program (version 2016) in 2 dimensions, so for the moment the 3 dimensions will be left for later. For those who do not know what the program is about, it is a software for 2D drawing or 3D models, with different options for printing, conversion to other files, design, colors, etc., all in a reliable and friendly environment.

My intention is for you to help me decide if it is possible to convert a .DWG file to .PDF using exclusively TeX or LaTeX, and if possible do it in the easiest way possible (for a beginner who does not understand converting files to the LaTeX environment). But for this I have some "conditions", since I did not even use the \includegraphics command but I do everything by hand, so this is something new (and interesting) for me (and for you too!). These conditions are that I use the TeXnicCenter program with the output "LaTeX -> PS -> PDF" and that I do not use the programming structures that LaTeX provides (such as conditionals, loops, etc.). Yes, the question is simple enough but the answer seems difficult.

I attached a .DWG file (via Google Drive) with the drawing of some lines that form the well-known A4 sheet (210.00mm x 297.00mm), and the basic LaTeX code that should be used:

\documentclass{article}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{graphicx}
\usepackage{vmargin}

\setpapersize{A4}
\setmargins{2.2cm}
{0.5cm}
{16.5cm}
{23.42cm}
{30pt}
{1cm}
{0pt}
{2cm}

\begin{document}
Example of how I would like it to look:

\newpage

\includegraphics{Example.dwg} % With the possibility of maintaining the original characteristics, such as the size of the drawing, the colors, the thickness of the lines, etc.
\end{document}

And the output:

Example in LaTeX

Will it be easy to implement it?

If it is a question that does not correspond to the essence of the forum please indicate it to me and I will eliminate it as soon as possible.

Thank you in advance!

manooooh
  • 3,203
  • 2
  • 21
  • 46
  • 4
    You should be able to make an EPS from AutoCAD, and that should import into your LaTeX->PS->PDF workflow. But most people would probably just export a PDF from AutoCAD and go straight from LaTeX->PDF with no PS intermediate step. – Mike Renfro Apr 30 '18 at 02:05
  • 4
    In addition you could convert it to SVG and then include it into a TikZ picture (\usetikzlibrary{svg.path}). This would allow you to use the same fonts for the labels as in the ambient document. –  Apr 30 '18 at 02:12
  • 2
    DWG is a binary format with many versions. So converting it exclusively with TeX or LaTeX is close to impossible (i.e. it would just take too much time to write the necessary macros). – Mike Apr 30 '18 at 03:49
  • @MikeRenfro You know that while I was taking a shower I thought about what you say to me, because AutoCAD has that option. And I thought "Who will say it first?" hahaha, thank you, it seems to be the best option to convert it to EPS and then insert it into the document. – manooooh Apr 30 '18 at 18:43
  • Hello @marmot! Good idea. I'll see how I try, and if I get it wrong you know who I'm going to turn to ;). – manooooh Apr 30 '18 at 18:43
  • @Mike It's what I was afraid for... Thank you. – manooooh Apr 30 '18 at 18:44
  • Note that there are some limitations, see section 69 of the pgfmanual. –  Apr 30 '18 at 18:47
  • @marmot I do not understand what you mean. Section 69 talks about the mathematical engine (pgfmath package) and that if mathematical expressions are not required the expression is prefixed by a +. If you thought I was going to use the algorithms that LaTeX is going to take me a long time to learn and use them correctly :P. – manooooh Apr 30 '18 at 18:57
  • You must be reading a really old version ;-) Please update your installation. TeXLive 2018 is out just now. –  Apr 30 '18 at 18:58
  • @marmot Oh yes you are right (when not), I had not noticed the manual on the CTAN page. It seems that the biggest problems are those of the arc command and uniqueness in the dimension (only pt), right? – manooooh Apr 30 '18 at 19:08
  • I dunno if these will be problematic, just want to warn you not to be overly optimistic. There is also the issue that the number cannot be arbitrarily large. –  Apr 30 '18 at 19:10
  • @marmot Ok, I'm going to keep it in mind. – manooooh Apr 30 '18 at 19:14

0 Answers0