LaTeX and 2D structural mechanics diagrams
Sometimes it's necessary to add to your reports several drawings in order to facilitate the comprehension of the calculus and data. LaTeX can solve this issue without using any external software but only through the Graphics packages. I show you how TikZ-MEC, a custom library written by Francesco Clemente, can help in the description of mechanical problems related to (internally and externaly) loaded structures.
- quick creation of simple graphics;
- precise positioning, quoting and scaling.
However only writing the small project for the Structure Standing Still: The Statics of Everyday Objects course promoted by Coursera and University of Florida, I have had the chance to learn and try TikZ and TikZ-MEC. In actual fact it exists and it's more complete: pst-stru, a PSTricks package to draw structural schemes in civil engineering analysis (beams, portals, archs, piles), yet it does not work with pdftex nor with any other driver that produces anything but PostScript code1 , in fact it is necessary to use latex+dvips+ps2pdf in order to generate a PDF. Also in my opinion the learning curve is steeper and the code is more logical and readable than PSTricks.
Typically TikZ is included in the texlive-pictures3 package, but if you want to use TikZ-MEC, you have to download it and following the instructions in the README.txt in order to generate the library file tikzlibrarymec.code.tex and the documentation file tikz-mec.pdf. Thus avoiding warnings and errors, I suggest you to install these packages: texlive-science3 (it contains SIunits), cm-super3 and cm-super-minimal3 . Although I have installed all the packages, I always obtained a lot of errors and warnings while generating the documentation file, but keep calm and carry on: I put this problematic PDF file in my repository on GitHub.
How to learn it
The first impact with TikZ and TikZ-MEC is problematic, but if you read the Part I: Tutorials and Guidelines of the manual1 , you can understand quickly the code and the power of this Graphics Package.
- 1 a b c TikZ and pgf - Manual for version 1.18 - downloadable here
- 2Because at the moment writeLaTeX removes all but the last dot in file names (in order to avoid a bug in includegraphics with files that contain multiple dots) and so it also broke custom TikZ libraries like "tikzlibrarymec.code.tex" that becomes after uploading "tikzlibrarymec_code.tex".
In Ubuntu and derivatives a faster method to install packages is writing this command in the terminal:
sudo apt-get install PACKAGE_NAME