ReportDiagrams
ENGR446
Dna

Description

The code is a LaTeX document that creates a simple diagram of a DNA strand using the TikZ package. The document class is "standalone" with an optional parameter "border=10pt" which sets the amount of white space around the diagram.

The TikZ package is loaded with the "shapes" and "decorations.pathmorphing" libraries. Inside the tikzpicture environment, there is a definition for the "dna" style which includes the "decorate" option for adding a decoration to the path, "thick" for setting the line thickness, and an additional decoration option that sets the aspect and the segment length of the decoration.

The main part of the diagram is drawn using two separate lines, each with a different amplitude for the decoration, to create a double helix shape. The "node" command is used to add a label "DNA" to the left side of the diagram.

Keywords

latex, tikz, decorations, dna, segment, length, amplitude, thickness, aspect.

Source Code

ReportDiagrams/ENGR446

\documentclass[border=10pt]{standalone}
 
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing, shapes}
\begin{document} 
 
\begin{tikzpicture}[decoration={coil},
dna/.style={decorate, thick, decoration={aspect=0, segment length=0.5cm}}]
 
%DNA
\draw[dna, decoration={amplitude=.15cm}] (.1,0) -- (11,0);
\draw[dna, decoration={amplitude=-.15cm}] (0,0) -- (11,0);
\node at (0,0.5) {DNA};
 
\end{tikzpicture}
\end{document}
Deploy to Overleaf