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.
Since I had been written my master thesis, I wanted to understand how to instruct LaTeX for drawing directly, taking all the advantages of the "TeX-approach to Typesetting" for my graphics[fn value="1"]TikZ and pgf - Manual for version 1.18 - downloadable here[/fn]:
- 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 code[fn value="1"]TikZ and pgf - Manual for version 1.18 - downloadable here[/fn], 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.
As usual I put the instruction to install it in your system (Ubuntu and derivatives only) and the possibility to try it online thanks to writeLaTeX and an edited code written by John Lees-Miller[fn]Because 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".[/fn].
Installation
Typically TikZ is included in the texlive-pictures[fn value="3"]In Ubuntu and derivatives a faster method to install packages is writing this command in the terminal:
sudo apt-get install PACKAGE_NAME
[/fn]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-science[fn value="3"][/fn](it contains SIunits), cm-super[fn value="3"][/fn] and cm-super-minimal[fn value="3"][/fn]. 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 manual[fn value="1"]TikZ and pgf - Manual for version 1.18 - downloadable here[/fn], you can understand quickly the code and the power of this Graphics Package.
Aggiungi un commento