├── .gitignore ├── LICENSE ├── README.md ├── example.png ├── example.tex ├── pgflibraryshapes.dna.code.tex ├── tikzlibrarydna.code.tex └── tikzlibraryshapes.dna.code.tex /.gitignore: -------------------------------------------------------------------------------- 1 | *.hd 2 | *.exa 3 | *.sty 4 | *.pdf 5 | test/ 6 | 7 | # https://github.com/github/gitignore/blob/3bb7b4b767f3f8df07e362dfa03c8bd425f16d32/TeX.gitignore 8 | 9 | ## Core latex/pdflatex auxiliary files: 10 | *.aux 11 | *.lof 12 | *.log 13 | *.lot 14 | *.fls 15 | *.out 16 | *.toc 17 | *.fmt 18 | *.fot 19 | *.cb 20 | *.cb2 21 | .*.lb 22 | 23 | ## Intermediate documents: 24 | *.dvi 25 | *.xdv 26 | *-converted-to.* 27 | # these rules might exclude image files for figures etc. 28 | # *.ps 29 | # *.eps 30 | # *.pdf 31 | 32 | ## Generated if empty string is given at "Please type another file name for output:" 33 | .pdf 34 | 35 | ## Bibliography auxiliary files (bibtex/biblatex/biber): 36 | *.bbl 37 | *.bcf 38 | *.blg 39 | *-blx.aux 40 | *-blx.bib 41 | *.run.xml 42 | 43 | ## Build tool auxiliary files: 44 | *.fdb_latexmk 45 | *.synctex 46 | *.synctex(busy) 47 | *.synctex.gz 48 | *.synctex.gz(busy) 49 | *.pdfsync 50 | 51 | ## Build tool directories for auxiliary files 52 | # latexrun 53 | latex.out/ 54 | 55 | ## Auxiliary and intermediate files from other packages: 56 | # algorithms 57 | *.alg 58 | *.loa 59 | 60 | # achemso 61 | acs-*.bib 62 | 63 | # amsthm 64 | *.thm 65 | 66 | # beamer 67 | *.nav 68 | *.pre 69 | *.snm 70 | *.vrb 71 | 72 | # changes 73 | *.soc 74 | 75 | # comment 76 | *.cut 77 | 78 | # cprotect 79 | *.cpt 80 | 81 | # elsarticle (documentclass of Elsevier journals) 82 | *.spl 83 | 84 | # endnotes 85 | *.ent 86 | 87 | # fixme 88 | *.lox 89 | 90 | # feynmf/feynmp 91 | *.mf 92 | *.mp 93 | *.t[1-9] 94 | *.t[1-9][0-9] 95 | *.tfm 96 | 97 | #(r)(e)ledmac/(r)(e)ledpar 98 | *.end 99 | *.?end 100 | *.[1-9] 101 | *.[1-9][0-9] 102 | *.[1-9][0-9][0-9] 103 | *.[1-9]R 104 | *.[1-9][0-9]R 105 | *.[1-9][0-9][0-9]R 106 | *.eledsec[1-9] 107 | *.eledsec[1-9]R 108 | *.eledsec[1-9][0-9] 109 | *.eledsec[1-9][0-9]R 110 | *.eledsec[1-9][0-9][0-9] 111 | *.eledsec[1-9][0-9][0-9]R 112 | 113 | # glossaries 114 | *.acn 115 | *.acr 116 | *.glg 117 | *.glo 118 | *.gls 119 | *.glsdefs 120 | *.lzo 121 | *.lzs 122 | 123 | # uncomment this for glossaries-extra (will ignore makeindex's style files!) 124 | # *.ist 125 | 126 | # gnuplottex 127 | *-gnuplottex-* 128 | 129 | # gregoriotex 130 | *.gaux 131 | *.glog 132 | *.gtex 133 | 134 | # htlatex 135 | *.4ct 136 | *.4tc 137 | *.idv 138 | *.lg 139 | *.trc 140 | *.xref 141 | 142 | # hyperref 143 | *.brf 144 | 145 | # knitr 146 | *-concordance.tex 147 | # TODO Uncomment the next line if you use knitr and want to ignore its generated tikz files 148 | # *.tikz 149 | *-tikzDictionary 150 | 151 | # listings 152 | *.lol 153 | 154 | # luatexja-ruby 155 | *.ltjruby 156 | 157 | # makeidx 158 | *.idx 159 | *.ilg 160 | *.ind 161 | 162 | # minitoc 163 | *.maf 164 | *.mlf 165 | *.mlt 166 | *.mtc[0-9]* 167 | *.slf[0-9]* 168 | *.slt[0-9]* 169 | *.stc[0-9]* 170 | 171 | # minted 172 | _minted* 173 | *.pyg 174 | 175 | # morewrites 176 | *.mw 177 | 178 | # newpax 179 | *.newpax 180 | 181 | # nomencl 182 | *.nlg 183 | *.nlo 184 | *.nls 185 | 186 | # pax 187 | *.pax 188 | 189 | # pdfpcnotes 190 | *.pdfpc 191 | 192 | # sagetex 193 | *.sagetex.sage 194 | *.sagetex.py 195 | *.sagetex.scmd 196 | 197 | # scrwfile 198 | *.wrt 199 | 200 | # sympy 201 | *.sout 202 | *.sympy 203 | sympy-plots-for-*.tex/ 204 | 205 | # pdfcomment 206 | *.upa 207 | *.upb 208 | 209 | # pythontex 210 | *.pytxcode 211 | pythontex-files-*/ 212 | 213 | # tcolorbox 214 | *.listing 215 | 216 | # thmtools 217 | *.loe 218 | 219 | # TikZ & PGF 220 | *.dpth 221 | *.md5 222 | *.auxlock 223 | 224 | # todonotes 225 | *.tdo 226 | 227 | # vhistory 228 | *.hst 229 | *.ver 230 | 231 | # easy-todo 232 | *.lod 233 | 234 | # xcolor 235 | *.xcp 236 | 237 | # xmpincl 238 | *.xmpi 239 | 240 | # xindy 241 | *.xdy 242 | 243 | # xypic precompiled matrices and outlines 244 | *.xyc 245 | *.xyd 246 | 247 | # endfloat 248 | *.ttt 249 | *.fff 250 | 251 | # Latexian 252 | TSWLatexianTemp* 253 | 254 | ## Editors: 255 | # WinEdt 256 | *.bak 257 | *.sav 258 | 259 | # Texpad 260 | .texpadtmp 261 | 262 | # LyX 263 | *.lyx~ 264 | 265 | # Kile 266 | *.backup 267 | 268 | # gummi 269 | .*.swp 270 | 271 | # KBibTeX 272 | *~[0-9]* 273 | 274 | # TeXnicCenter 275 | *.tps 276 | 277 | # auto folder when using emacs and auctex 278 | ./auto/* 279 | *.el 280 | 281 | # expex forward references with \gathertags 282 | *-tags.tex 283 | 284 | # standalone packages 285 | *.sta 286 | 287 | # Makeindex log files 288 | *.lpz 289 | 290 | # xwatermark package 291 | *.xwm 292 | 293 | # REVTeX puts footnotes in the bibliography by default, unless the nofootinbib 294 | # option is specified. Footnotes are the stored in a file with suffix Notes.bib. 295 | # Uncomment the next line to have this generated file ignored. 296 | #*Notes.bib 297 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The LaTeX Project Public License 2 | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 3 | 4 | LPPL Version 1.3c 2008-05-04 5 | 6 | Copyright 1999 2002-2008 LaTeX3 Project 7 | Everyone is allowed to distribute verbatim copies of this 8 | license document, but modification of it is not allowed. 9 | 10 | 11 | PREAMBLE 12 | ======== 13 | 14 | The LaTeX Project Public License (LPPL) is the primary license under 15 | which the LaTeX kernel and the base LaTeX packages are distributed. 16 | 17 | You may use this license for any work of which you hold the copyright 18 | and which you wish to distribute. This license may be particularly 19 | suitable if your work is TeX-related (such as a LaTeX package), but 20 | it is written in such a way that you can use it even if your work is 21 | unrelated to TeX. 22 | 23 | The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE', 24 | below, gives instructions, examples, and recommendations for authors 25 | who are considering distributing their works under this license. 26 | 27 | This license gives conditions under which a work may be distributed 28 | and modified, as well as conditions under which modified versions of 29 | that work may be distributed. 30 | 31 | We, the LaTeX3 Project, believe that the conditions below give you 32 | the freedom to make and distribute modified versions of your work 33 | that conform with whatever technical specifications you wish while 34 | maintaining the availability, integrity, and reliability of 35 | that work. If you do not see how to achieve your goal while 36 | meeting these conditions, then read the document `cfgguide.tex' 37 | and `modguide.tex' in the base LaTeX distribution for suggestions. 38 | 39 | 40 | DEFINITIONS 41 | =========== 42 | 43 | In this license document the following terms are used: 44 | 45 | `Work' 46 | Any work being distributed under this License. 47 | 48 | `Derived Work' 49 | Any work that under any applicable law is derived from the Work. 50 | 51 | `Modification' 52 | Any procedure that produces a Derived Work under any applicable 53 | law -- for example, the production of a file containing an 54 | original file associated with the Work or a significant portion of 55 | such a file, either verbatim or with modifications and/or 56 | translated into another language. 57 | 58 | `Modify' 59 | To apply any procedure that produces a Derived Work under any 60 | applicable law. 61 | 62 | `Distribution' 63 | Making copies of the Work available from one person to another, in 64 | whole or in part. Distribution includes (but is not limited to) 65 | making any electronic components of the Work accessible by 66 | file transfer protocols such as FTP or HTTP or by shared file 67 | systems such as Sun's Network File System (NFS). 68 | 69 | `Compiled Work' 70 | A version of the Work that has been processed into a form where it 71 | is directly usable on a computer system. This processing may 72 | include using installation facilities provided by the Work, 73 | transformations of the Work, copying of components of the Work, or 74 | other activities. Note that modification of any installation 75 | facilities provided by the Work constitutes modification of the Work. 76 | 77 | `Current Maintainer' 78 | A person or persons nominated as such within the Work. If there is 79 | no such explicit nomination then it is the `Copyright Holder' under 80 | any applicable law. 81 | 82 | `Base Interpreter' 83 | A program or process that is normally needed for running or 84 | interpreting a part or the whole of the Work. 85 | 86 | A Base Interpreter may depend on external components but these 87 | are not considered part of the Base Interpreter provided that each 88 | external component clearly identifies itself whenever it is used 89 | interactively. Unless explicitly specified when applying the 90 | license to the Work, the only applicable Base Interpreter is a 91 | `LaTeX-Format' or in the case of files belonging to the 92 | `LaTeX-format' a program implementing the `TeX language'. 93 | 94 | 95 | 96 | CONDITIONS ON DISTRIBUTION AND MODIFICATION 97 | =========================================== 98 | 99 | 1. Activities other than distribution and/or modification of the Work 100 | are not covered by this license; they are outside its scope. In 101 | particular, the act of running the Work is not restricted and no 102 | requirements are made concerning any offers of support for the Work. 103 | 104 | 2. You may distribute a complete, unmodified copy of the Work as you 105 | received it. Distribution of only part of the Work is considered 106 | modification of the Work, and no right to distribute such a Derived 107 | Work may be assumed under the terms of this clause. 108 | 109 | 3. You may distribute a Compiled Work that has been generated from a 110 | complete, unmodified copy of the Work as distributed under Clause 2 111 | above, as long as that Compiled Work is distributed in such a way that 112 | the recipients may install the Compiled Work on their system exactly 113 | as it would have been installed if they generated a Compiled Work 114 | directly from the Work. 115 | 116 | 4. If you are the Current Maintainer of the Work, you may, without 117 | restriction, modify the Work, thus creating a Derived Work. You may 118 | also distribute the Derived Work without restriction, including 119 | Compiled Works generated from the Derived Work. Derived Works 120 | distributed in this manner by the Current Maintainer are considered to 121 | be updated versions of the Work. 122 | 123 | 5. If you are not the Current Maintainer of the Work, you may modify 124 | your copy of the Work, thus creating a Derived Work based on the Work, 125 | and compile this Derived Work, thus creating a Compiled Work based on 126 | the Derived Work. 127 | 128 | 6. If you are not the Current Maintainer of the Work, you may 129 | distribute a Derived Work provided the following conditions are met 130 | for every component of the Work unless that component clearly states 131 | in the copyright notice that it is exempt from that condition. Only 132 | the Current Maintainer is allowed to add such statements of exemption 133 | to a component of the Work. 134 | 135 | a. If a component of this Derived Work can be a direct replacement 136 | for a component of the Work when that component is used with the 137 | Base Interpreter, then, wherever this component of the Work 138 | identifies itself to the user when used interactively with that 139 | Base Interpreter, the replacement component of this Derived Work 140 | clearly and unambiguously identifies itself as a modified version 141 | of this component to the user when used interactively with that 142 | Base Interpreter. 143 | 144 | b. Every component of the Derived Work contains prominent notices 145 | detailing the nature of the changes to that component, or a 146 | prominent reference to another file that is distributed as part 147 | of the Derived Work and that contains a complete and accurate log 148 | of the changes. 149 | 150 | c. No information in the Derived Work implies that any persons, 151 | including (but not limited to) the authors of the original version 152 | of the Work, provide any support, including (but not limited to) 153 | the reporting and handling of errors, to recipients of the 154 | Derived Work unless those persons have stated explicitly that 155 | they do provide such support for the Derived Work. 156 | 157 | d. You distribute at least one of the following with the Derived Work: 158 | 159 | 1. A complete, unmodified copy of the Work; 160 | if your distribution of a modified component is made by 161 | offering access to copy the modified component from a 162 | designated place, then offering equivalent access to copy 163 | the Work from the same or some similar place meets this 164 | condition, even though third parties are not compelled to 165 | copy the Work along with the modified component; 166 | 167 | 2. Information that is sufficient to obtain a complete, 168 | unmodified copy of the Work. 169 | 170 | 7. If you are not the Current Maintainer of the Work, you may 171 | distribute a Compiled Work generated from a Derived Work, as long as 172 | the Derived Work is distributed to all recipients of the Compiled 173 | Work, and as long as the conditions of Clause 6, above, are met with 174 | regard to the Derived Work. 175 | 176 | 8. The conditions above are not intended to prohibit, and hence do not 177 | apply to, the modification, by any method, of any component so that it 178 | becomes identical to an updated version of that component of the Work as 179 | it is distributed by the Current Maintainer under Clause 4, above. 180 | 181 | 9. Distribution of the Work or any Derived Work in an alternative 182 | format, where the Work or that Derived Work (in whole or in part) is 183 | then produced by applying some process to that format, does not relax or 184 | nullify any sections of this license as they pertain to the results of 185 | applying that process. 186 | 187 | 10. a. A Derived Work may be distributed under a different license 188 | provided that license itself honors the conditions listed in 189 | Clause 6 above, in regard to the Work, though it does not have 190 | to honor the rest of the conditions in this license. 191 | 192 | b. If a Derived Work is distributed under a different license, that 193 | Derived Work must provide sufficient documentation as part of 194 | itself to allow each recipient of that Derived Work to honor the 195 | restrictions in Clause 6 above, concerning changes from the Work. 196 | 197 | 11. This license places no restrictions on works that are unrelated to 198 | the Work, nor does this license place any restrictions on aggregating 199 | such works with the Work by any means. 200 | 201 | 12. Nothing in this license is intended to, or may be used to, prevent 202 | complete compliance by all parties with all applicable laws. 203 | 204 | 205 | NO WARRANTY 206 | =========== 207 | 208 | There is no warranty for the Work. Except when otherwise stated in 209 | writing, the Copyright Holder provides the Work `as is', without 210 | warranty of any kind, either expressed or implied, including, but not 211 | limited to, the implied warranties of merchantability and fitness for a 212 | particular purpose. The entire risk as to the quality and performance 213 | of the Work is with you. Should the Work prove defective, you assume 214 | the cost of all necessary servicing, repair, or correction. 215 | 216 | In no event unless required by applicable law or agreed to in writing 217 | will The Copyright Holder, or any author named in the components of the 218 | Work, or any other party who may distribute and/or modify the Work as 219 | permitted above, be liable to you for damages, including any general, 220 | special, incidental or consequential damages arising out of any use of 221 | the Work or out of inability to use the Work (including, but not limited 222 | to, loss of data, data being rendered inaccurate, or losses sustained by 223 | anyone as a result of any failure of the Work to operate with any other 224 | programs), even if the Copyright Holder or said author or said other 225 | party has been advised of the possibility of such damages. 226 | 227 | 228 | MAINTENANCE OF THE WORK 229 | ======================= 230 | 231 | The Work has the status `author-maintained' if the Copyright Holder 232 | explicitly and prominently states near the primary copyright notice in 233 | the Work that the Work can only be maintained by the Copyright Holder 234 | or simply that it is `author-maintained'. 235 | 236 | The Work has the status `maintained' if there is a Current Maintainer 237 | who has indicated in the Work that they are willing to receive error 238 | reports for the Work (for example, by supplying a valid e-mail 239 | address). It is not required for the Current Maintainer to acknowledge 240 | or act upon these error reports. 241 | 242 | The Work changes from status `maintained' to `unmaintained' if there 243 | is no Current Maintainer, or the person stated to be Current 244 | Maintainer of the work cannot be reached through the indicated means 245 | of communication for a period of six months, and there are no other 246 | significant signs of active maintenance. 247 | 248 | You can become the Current Maintainer of the Work by agreement with 249 | any existing Current Maintainer to take over this role. 250 | 251 | If the Work is unmaintained, you can become the Current Maintainer of 252 | the Work through the following steps: 253 | 254 | 1. Make a reasonable attempt to trace the Current Maintainer (and 255 | the Copyright Holder, if the two differ) through the means of 256 | an Internet or similar search. 257 | 258 | 2. If this search is successful, then enquire whether the Work 259 | is still maintained. 260 | 261 | a. If it is being maintained, then ask the Current Maintainer 262 | to update their communication data within one month. 263 | 264 | b. If the search is unsuccessful or no action to resume active 265 | maintenance is taken by the Current Maintainer, then announce 266 | within the pertinent community your intention to take over 267 | maintenance. (If the Work is a LaTeX work, this could be 268 | done, for example, by posting to comp.text.tex.) 269 | 270 | 3a. If the Current Maintainer is reachable and agrees to pass 271 | maintenance of the Work to you, then this takes effect 272 | immediately upon announcement. 273 | 274 | b. If the Current Maintainer is not reachable and the Copyright 275 | Holder agrees that maintenance of the Work be passed to you, 276 | then this takes effect immediately upon announcement. 277 | 278 | 4. If you make an `intention announcement' as described in 2b. above 279 | and after three months your intention is challenged neither by 280 | the Current Maintainer nor by the Copyright Holder nor by other 281 | people, then you may arrange for the Work to be changed so as 282 | to name you as the (new) Current Maintainer. 283 | 284 | 5. If the previously unreachable Current Maintainer becomes 285 | reachable once more within three months of a change completed 286 | under the terms of 3b) or 4), then that Current Maintainer must 287 | become or remain the Current Maintainer upon request provided 288 | they then update their communication data within one month. 289 | 290 | A change in the Current Maintainer does not, of itself, alter the fact 291 | that the Work is distributed under the LPPL license. 292 | 293 | If you become the Current Maintainer of the Work, you should 294 | immediately provide, within the Work, a prominent and unambiguous 295 | statement of your status as Current Maintainer. You should also 296 | announce your new status to the same pertinent community as 297 | in 2b) above. 298 | 299 | 300 | WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE 301 | ====================================================== 302 | 303 | This section contains important instructions, examples, and 304 | recommendations for authors who are considering distributing their 305 | works under this license. These authors are addressed as `you' in 306 | this section. 307 | 308 | Choosing This License or Another License 309 | ---------------------------------------- 310 | 311 | If for any part of your work you want or need to use *distribution* 312 | conditions that differ significantly from those in this license, then 313 | do not refer to this license anywhere in your work but, instead, 314 | distribute your work under a different license. You may use the text 315 | of this license as a model for your own license, but your license 316 | should not refer to the LPPL or otherwise give the impression that 317 | your work is distributed under the LPPL. 318 | 319 | The document `modguide.tex' in the base LaTeX distribution explains 320 | the motivation behind the conditions of this license. It explains, 321 | for example, why distributing LaTeX under the GNU General Public 322 | License (GPL) was considered inappropriate. Even if your work is 323 | unrelated to LaTeX, the discussion in `modguide.tex' may still be 324 | relevant, and authors intending to distribute their works under any 325 | license are encouraged to read it. 326 | 327 | A Recommendation on Modification Without Distribution 328 | ----------------------------------------------------- 329 | 330 | It is wise never to modify a component of the Work, even for your own 331 | personal use, without also meeting the above conditions for 332 | distributing the modified component. While you might intend that such 333 | modifications will never be distributed, often this will happen by 334 | accident -- you may forget that you have modified that component; or 335 | it may not occur to you when allowing others to access the modified 336 | version that you are thus distributing it and violating the conditions 337 | of this license in ways that could have legal implications and, worse, 338 | cause problems for the community. It is therefore usually in your 339 | best interest to keep your copy of the Work identical with the public 340 | one. Many works provide ways to control the behavior of that work 341 | without altering any of its licensed components. 342 | 343 | How to Use This License 344 | ----------------------- 345 | 346 | To use this license, place in each of the components of your work both 347 | an explicit copyright notice including your name and the year the work 348 | was authored and/or last substantially modified. Include also a 349 | statement that the distribution and/or modification of that 350 | component is constrained by the conditions in this license. 351 | 352 | Here is an example of such a notice and statement: 353 | 354 | %% pig.dtx 355 | %% Copyright 2005 M. Y. Name 356 | % 357 | % This work may be distributed and/or modified under the 358 | % conditions of the LaTeX Project Public License, either version 1.3 359 | % of this license or (at your option) any later version. 360 | % The latest version of this license is in 361 | % http://www.latex-project.org/lppl.txt 362 | % and version 1.3 or later is part of all distributions of LaTeX 363 | % version 2005/12/01 or later. 364 | % 365 | % This work has the LPPL maintenance status `maintained'. 366 | % 367 | % The Current Maintainer of this work is M. Y. Name. 368 | % 369 | % This work consists of the files pig.dtx and pig.ins 370 | % and the derived file pig.sty. 371 | 372 | Given such a notice and statement in a file, the conditions 373 | given in this license document would apply, with the `Work' referring 374 | to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being 375 | generated from `pig.dtx' using `pig.ins'), the `Base Interpreter' 376 | referring to any `LaTeX-Format', and both `Copyright Holder' and 377 | `Current Maintainer' referring to the person `M. Y. Name'. 378 | 379 | If you do not want the Maintenance section of LPPL to apply to your 380 | Work, change `maintained' above into `author-maintained'. 381 | However, we recommend that you use `maintained', as the Maintenance 382 | section was added in order to ensure that your Work remains useful to 383 | the community even when you can no longer maintain and support it 384 | yourself. 385 | 386 | Derived Works That Are Not Replacements 387 | --------------------------------------- 388 | 389 | Several clauses of the LPPL specify means to provide reliability and 390 | stability for the user community. They therefore concern themselves 391 | with the case that a Derived Work is intended to be used as a 392 | (compatible or incompatible) replacement of the original Work. If 393 | this is not the case (e.g., if a few lines of code are reused for a 394 | completely different task), then clauses 6b and 6d shall not apply. 395 | 396 | 397 | Important Recommendations 398 | ------------------------- 399 | 400 | Defining What Constitutes the Work 401 | 402 | The LPPL requires that distributions of the Work contain all the 403 | files of the Work. It is therefore important that you provide a 404 | way for the licensee to determine which files constitute the Work. 405 | This could, for example, be achieved by explicitly listing all the 406 | files of the Work near the copyright notice of each file or by 407 | using a line such as: 408 | 409 | % This work consists of all files listed in manifest.txt. 410 | 411 | in that place. In the absence of an unequivocal list it might be 412 | impossible for the licensee to determine what is considered by you 413 | to comprise the Work and, in such a case, the licensee would be 414 | entitled to make reasonable conjectures as to which files comprise 415 | the Work. 416 | 417 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | This is a LaTeX package for drawing genetic construct pictograms using 4 | [Ti*k*Z](https://www.ctan.org/pkg/pgf). **Under development, there are 5 | no reusable macros at the moment.** 6 | 7 | We provide a Ti*k*Z library called `dna` that installs one core macro, 8 | `\dnaplot`. 9 | ```latex 10 | \usetikzlibrary{dna} 11 | \begin{tikzpicture} 12 | \node (dox) at (0,1) {dox}; 13 | \dnaplot [] 14 | features 15 | { [name=segment 1] { 16 | promoter [name=p1], 17 | coding sequence [name=gA], 18 | terminator 19 | }, 20 | [anchor=north west, right=1cm of segment 1.base east] { 21 | promoter [name=p2], 22 | coding sequence [name=gB], 23 | terminator 24 | } 25 | } 26 | regulation { (dox) -| {gB -| p1, gA -| p2} }; 27 | \end{tikzpicture} 28 | ``` 29 | 30 | # Gallery 31 | 32 | ![Example plot](example.png "Example plot") 33 | 34 | Compare this image with [this gallery entry](https://github.com/VoigtLab/dnaplotlib/tree/master/gallery/xnor_truthtable) 35 | from dnaplotlib. The image above was drawn entirely in Ti*k*Z, the source 36 | is in [example.tex](example.tex). 37 | 38 | # License 39 | 40 | This package is under development and provided under the LaTeX Project 41 | Public License version 1.3c. A copy of the license can be found in `LICENSE`. 42 | 43 | Certain components of this package were built by reverse-engineering the 44 | Ti*k*Z `graphs` and `shapes.arrows` libraries. Under the terms of the Ti*k*Z 45 | license (the LaTeX Project Public License version 1.3c), these reverse-engineered 46 | components can be considered Derived Works not intended as replacements 47 | of the original Work. Ti*k*Z was created by Till Tantau and is available 48 | at . 49 | -------------------------------------------------------------------------------- /example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-tx/tikz-dna/d02545a727680ade91cdd793527ba22309939614/example.png -------------------------------------------------------------------------------- /example.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | 3 | \usepackage{helvet} 4 | % \renewcommand*\familydefault{\sfdefault} 5 | \usepackage{mathastext} 6 | \usepackage{isomath} 7 | \usepackage{sansmath} 8 | % \renewcommand*\familydefault{\rmdefault} % 9 | 10 | \newcommand{\mycap}{\raisebox{0pt}{\tikz[remember picture]{\node[inner sep=0, outer sep=0] (n1) {hollow};}}} 11 | 12 | \usepackage{pgfplots} 13 | \pgfplotsset{compat=1.17} 14 | 15 | \usepackage{tikz} 16 | \usetikzlibrary{decorations.markings,shapes.arrows,shapes.geometric,arrows.meta,shapes.dna,dna} 17 | 18 | \definecolor{color A}{rgb}{1.00, 0.75, 0.17} 19 | \definecolor{color B}{rgb}{0.38, 0.82, 0.32} 20 | \definecolor{color C}{rgb}{0.38, 0.65, 0.87} 21 | \definecolor{color D}{rgb}{0.95, 0.30, 0.25} 22 | 23 | \begin{document} 24 | \sansmath 25 | 26 | % pic 27 | \tikzset{ 28 | g label/.style={label={[white]center:\footnotesize\it {#1}}}, 29 | p label/.style={label={[anchor=base, yshift=-8pt]below:\scriptsize {#1}}}, 30 | circuit/.pic={ 31 | \draw [ 32 | postaction={decorate}, 33 | decoration={ 34 | markings, 35 | mark=at position 2mm with {\node [promoter, black!\pgfkeysvalueof{/tikz/p11 tint}, p label=\pgfkeysvalueof{/tikz/p1 label}] (-p11) {};}, 36 | mark=at position 5mm with {\node [promoter, black!\pgfkeysvalueof{/tikz/p12 tint}, p label=\pgfkeysvalueof{/tikz/p2 label}] (-p12) {};}, 37 | mark=at position 7mm with {\node [ribosome binding site] (-r1) {};}, 38 | mark=at position 9mm with {\node [coding sequence, color A, fill=\pgfkeysvalueof{/tikz/A fill}, g label=\pgfkeysvalueof{/tikz/A label}] (-gA) {};}, 39 | mark=at position 16mm with {\node [terminator] (-t1) {};}, 40 | mark=at position 18mm with {\node [promoter, black!\pgfkeysvalueof{/tikz/p21 tint}, p label=\pgfkeysvalueof{/tikz/p2 label}] (-p21) {};}, 41 | mark=at position 21mm with {\node [promoter, color A!\pgfkeysvalueof{/tikz/p22 tint}] (-p22) {};}, 42 | mark=at position 23mm with {\node [ribosome binding site] (-r2) {};}, 43 | mark=at position 25mm with {\node [coding sequence, color B, fill=\pgfkeysvalueof{/tikz/B fill}, g label=\pgfkeysvalueof{/tikz/B label}] (-gB) {};}, 44 | mark=at position 32mm with {\node [terminator] (-t2) {};}, 45 | mark=at position 34mm with {\node [promoter, black!\pgfkeysvalueof{/tikz/p31 tint}, p label=\pgfkeysvalueof{/tikz/p1 label}] (-p31) {};}, 46 | mark=at position 37mm with {\node [promoter, color A!\pgfkeysvalueof{/tikz/p32 tint}] (-p32) {};}, 47 | mark=at position 39mm with {\node [ribosome binding site] (-r3) {};}, 48 | mark=at position 41mm with {\node [coding sequence, color C, fill=\pgfkeysvalueof{/tikz/C fill}, g label=\pgfkeysvalueof{/tikz/C label}] (-gC) {};}, 49 | mark=at position 48mm with {\node [terminator] (-t3) {};}, 50 | mark=at position 50mm with {\node [promoter, color B!\pgfkeysvalueof{/tikz/p41 tint}] (-p41) {};}, 51 | mark=at position 53mm with {\node [promoter, color C!\pgfkeysvalueof{/tikz/p42 tint}] (-p42) {};}, 52 | mark=at position 55mm with {\node [ribosome binding site] (-r4) {};}, 53 | mark=at position 57mm with {\node [coding sequence, color D, fill=\pgfkeysvalueof{/tikz/D fill}, g label=\pgfkeysvalueof{/tikz/D label}] (-gD) {};}, 54 | mark=at position 64mm with {\node [terminator] (-t4) {};}, 55 | mark=at position 66mm with {\node [promoter, color D!\pgfkeysvalueof{/tikz/p5 tint}] (-p5) {};}, 56 | mark=at position 68mm with {\node [ribosome binding site] (-r5) {};}, 57 | mark=at position 70mm with {\node [coding sequence, black, fill=\pgfkeysvalueof{/tikz/O fill}, g label=\pgfkeysvalueof{/tikz/O label}] (-gO) {};}, 58 | mark=at position 77mm with {\node [terminator] (-t5) {};}, 59 | } 60 | ] (0,0) -- ++(79mm,0); 61 | }, 62 | A fill/.initial={color A}, 63 | A label/.initial={A}, 64 | B fill/.initial={color B}, 65 | B label/.initial={B}, 66 | C fill/.initial={color C}, 67 | C label/.initial={C}, 68 | D fill/.initial={color D}, 69 | D label/.initial={D}, 70 | O fill/.initial={black}, 71 | O label/.initial={Out}, 72 | p11 tint/.initial=100, 73 | p12 tint/.initial=100, 74 | p21 tint/.initial=100, 75 | p22 tint/.initial=100, 76 | p31 tint/.initial=100, 77 | p32 tint/.initial=100, 78 | p41 tint/.initial=100, 79 | p42 tint/.initial=100, 80 | p5 tint/.initial=100, 81 | p1 label/.initial=, 82 | p2 label/.initial=, 83 | } 84 | 85 | \def\ot{40} 86 | 87 | \begin{figure}[h] 88 | \centering 89 | \begin{tikzpicture}[ 90 | font=\sf, 91 | remember picture, 92 | line width=1pt, 93 | repression/.style={->, >=Bar, shorten <=2pt}, 94 | plot/.style={draw=black, line width=1pt}, 95 | ] 96 | \renewcommand*\familydefault{\sfdefault} 97 | \begin{semilogxaxis}[ 98 | font=\sf, 99 | axis lines*=left, 100 | axis line style={line width=1pt}, 101 | font={\small}, 102 | log origin=infty, 103 | width=4cm, 104 | height=7.5cm, 105 | xmin=0.001, 106 | xmax=2.5, 107 | xtick={0.001,0.01,0.1,1}, 108 | xticklabels={\empty, $10^{-2}$, $10^{-1}$, $10^{0}$}, 109 | xlabel style={font=\sf}, 110 | ylabel style={font=\sf}, 111 | ytick={4,...,1}, 112 | yticklabels={-/-,+/-,-/+,+/+}, 113 | yticklabel style={font=\tt}, 114 | enlarge y limits=0.2, 115 | xlabel={Output (RPU)}, 116 | ylabel={Input} 117 | ] 118 | \addplot [xbar, plot, fill=black] coordinates {(0.6, 1) (0.6, 4)}; 119 | \addplot [xbar, plot] coordinates {(0.0025, 2) (0.004, 3)}; 120 | \coordinate (A) at (axis cs:1,4); 121 | \coordinate (B) at (axis cs:1,3); 122 | \coordinate (C) at (axis cs:1,2); 123 | \coordinate (D) at (axis cs:1,1); 124 | \end{semilogxaxis} 125 | \pic [at={([yshift=-1mm]A)}, A fill=white, A label=, p11 tint=\ot, p12 tint=\ot, p21 tint=\ot, p31 tint=\ot, p41 tint=\ot, p42 tint=\ot] (A) {circuit}; 126 | \pic [at={([yshift=-1mm]B)}, B fill=white, B label=, O fill=white, O label=, p12 tint=\ot, p21 tint=\ot, p22 tint=\ot, p32 tint=\ot, p42 tint=\ot, p5 tint=\ot, p1 label={p1}] (B) {circuit}; 127 | \pic [at={([yshift=-1mm]C)}, C fill=white, C label=, O fill=white, O label=, p11 tint=\ot, p22 tint=\ot, p31 tint=\ot, p32 tint=\ot, p41 tint=\ot, p5 tint=\ot, p2 label={p2}] (C) {circuit}; 128 | \pic [at={([yshift=-1mm]D)}, D fill=white, D label=, p22 tint=\ot, p32 tint=\ot, p41 tint=\ot, p42 tint=\ot, p1 label={p1}, p2 label={p2}] (D) {circuit}; 129 | % A 130 | \draw [repression, color B] (A-gB.north) -- ++(0,12pt) -| (A-p41.crown); 131 | \draw [repression, color C] (A-gC.north) -- ++(0,9pt) -| (A-p42.crown); 132 | % B 133 | \draw [repression, color A] (B-gA.north) -- ++(0,9pt) coordinate (B-gA r1) -| (B-p32.crown); 134 | \draw [repression, color A, shorten <=0pt] (B-gA r1 -| B-p22.crown) -- (B-p22.crown); 135 | \draw [repression, color C] (B-gC.north) -- ++(0,9pt) -| (B-p42.crown); 136 | \draw [repression, color D] (B-gD.north) -- ++(0,9pt) -| (B-p5.crown); 137 | % C 138 | \draw [repression, color A] (C-gA.north) -- ++(0,9pt) coordinate (C-gA r1) -| (C-p32.crown); 139 | \draw [repression, color A, shorten <=0pt] (C-gA r1 -| C-p22.crown) -- (C-p22.crown); 140 | \draw [repression, color B] (C-gB.north) -- ++(0,12pt) -| (C-p41.crown); 141 | \draw [repression, color D] (C-gD.north) -- ++(0,9pt) -| (C-p5.crown); 142 | % D 143 | \draw [repression, color A] (D-gA.north) -- ++(0,9pt) coordinate (D-gA r1) -| (D-p32.crown); 144 | \draw [repression, color A, shorten <=0pt] (D-gA r1 -| D-p22.crown) -- (D-p22.crown); 145 | \draw [repression, color B] (D-gB.north) -- ++(0,12pt) -| (D-p41.crown); 146 | \draw [repression, color C] (D-gC.north) -- ++(0,9pt) -| (D-p42.crown); 147 | \begin{tikzdna} 148 | \addfeature [foo] {}; 149 | \end{tikzdna} 150 | \end{tikzpicture} 151 | \caption{This is an example plot of an \textsf{XNOR} genetic circuit. The {\protect\mycap} genes are repressed.} 152 | \label{fig:fig} 153 | \tikz[remember picture, overlay] \draw[->, very thick, shorten >=2pt, shorten <=2pt] (n1) to[out=90, in=-90] (D-gD); 154 | \end{figure} 155 | 156 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Erat pellentesque adipiscing commodo elit. Amet nisl suscipit adipiscing bibendum est ultricies integer quis auctor. Sed blandit libero volutpat sed cras. Risus feugiat in ante metus dictum. Tellus in hac habitasse platea dictumst vestibulum. Nullam non nisi est sit amet facilisis. Sagittis purus sit amet volutpat. Vestibulum morbi blandit cursus risus. Ac orci phasellus egestas tellus rutrum tellus. A iaculis at erat pellentesque adipiscing commodo elit at imperdiet. Odio ut sem nulla pharetra diam sit. Diam quis enim lobortis scelerisque. Sit amet consectetur adipiscing elit pellentesque habitant morbi tristique. Elementum tempus egestas sed sed. Etiam dignissim diam quis enim lobortis scelerisque. Pellentesque diam volutpat commodo sed egestas. At lectus urna duis convallis convallis tellus id. Pretium vulputate sapien nec sagittis aliquam malesuada bibendum arcu. 157 | 158 | \end{document} 159 | -------------------------------------------------------------------------------- /pgflibraryshapes.dna.code.tex: -------------------------------------------------------------------------------- 1 | % 2 | % Copyright © 2021 by Timothy S. Jones 3 | % 4 | % This work may be distributed and/or modified under the 5 | % conditions of the LaTeX Project Public License, either version 1.3 6 | % of this license or (at your option) any later version. 7 | % The latest version of this license is in 8 | % http://www.latex-project.org/lppl.txt 9 | % and version 1.3 or later is part of all distributions of LaTeX 10 | % version 2005/12/01 or later. 11 | % 12 | % This work has the LPPL maintenance status `maintained'. 13 | % 14 | % The Current Maintainer of this work is Timothy S. Jones. 15 | % 16 | % This work consists of the files: 17 | % 18 | % tikz-dna.dtx 19 | % tikz-dna.ins 20 | % tikzlibraryshapes.dna.code.tex 21 | % pgflibraryshapes.dna.code.tex 22 | % 23 | % and the derived file tikz-dna.sty. 24 | % 25 | 26 | \ProvidesFile{pgflibraryshapes.dna.code.tex} 27 | 28 | 29 | % keys for shape single bent arrow 30 | % 31 | % /pgf/single bent arrow tip angle 32 | % /pgf/single bent arrow head extend 33 | % /pgf/single bent arrow head indent 34 | 35 | \pgfkeys{/tikzdna/.cd, 36 | single bent arrow tip angle/.initial=90, 37 | single bent arrow head extend/.initial=.25cm, 38 | single bent arrow head indent/.initial=0cm, 39 | }% 40 | 41 | % Shape single bent arrow 42 | % 43 | % 44 | \pgfdeclareshape{single bent arrow}{% 45 | \savedmacro\getsinglearrowpoints{% 46 | % 47 | % Get the outer sep. 48 | % 49 | \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}% 50 | \edef\xoutersep{\the\pgf@x}% 51 | \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}% 52 | \edef\youtersep{\the\pgf@y}% 53 | % 54 | % Get the node dimensions. 55 | % 56 | \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/inner xsep}}% 57 | \advance\pgf@xa.5\wd\pgfnodeparttextbox% 58 | \advance\pgf@xa.5\pgflinewidth% 59 | \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/inner ysep}}% 60 | \advance\pgf@ya.5\ht\pgfnodeparttextbox% 61 | \advance\pgf@ya.5\dp\pgfnodeparttextbox% 62 | \advance\pgf@ya.5\pgflinewidth% 63 | \ifpgfshapeborderusesincircle% 64 | \ifdim\pgf@xa<\pgf@ya% 65 | \pgf@xa\pgf@ya% 66 | \fi% 67 | \pgf@xa1.41421\pgf@xa% 68 | \pgf@ya\pgf@xa% 69 | \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}% 70 | \ifdim\xoutersep>\youtersep\relax% 71 | \let\youtersep\xoutersep% 72 | \else% 73 | \let\xoutersep\youtersep% 74 | \fi% 75 | \else% 76 | % 77 | % Round the rotation. 78 | % 79 | \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}% 80 | \pgfmathmod@{\rotate}{360}% 81 | \afterassignment\pgfmath@gobbletilpgfmath@% 82 | \expandafter\c@pgf@counta\pgfmathresult\relax\pgfmath@% 83 | \advance\c@pgf@counta45\relax% 84 | \divide\c@pgf@counta90\relax% 85 | \multiply\c@pgf@counta90\relax% 86 | \ifnum\c@pgf@counta<0\relax% 87 | \advance\c@pgf@counta360\relax% 88 | \fi% 89 | \edef\rotate{\the\c@pgf@counta}% 90 | % 91 | % Calculate the width and height of the node 92 | % contents, according to any border rotation. 93 | % 94 | \ifnum\c@pgf@counta=90\relax% 95 | \pgf@x\pgf@xa% 96 | \pgf@xa\pgf@ya% 97 | \pgf@ya\pgf@x% 98 | \let\pgfmathresult\xoutersep% 99 | \let\xoutersep\youtersep% 100 | \let\youtersep\pgfmathresult% 101 | \else% 102 | \ifnum\c@pgf@counta=270\relax% 103 | \pgf@x\pgf@xa% 104 | \pgf@xa\pgf@ya% 105 | \pgf@ya\pgf@x% 106 | \let\pgfmathresult\xoutersep% 107 | \let\xoutersep\youtersep% 108 | \let\youtersep\pgfmathresult% 109 | \fi% 110 | \fi% 111 | \fi% 112 | \addtosavedmacro\rotate% 113 | % 114 | % Get some useful trig stuff. 115 | % 116 | \pgfmathdivide{\pgfkeysvalueof{/pgf/single bent arrow tip angle}}{2}% 117 | \let\halftipangle\pgfmathresult% 118 | \pgfmathcosec@{\halftipangle}% 119 | \let\cosechalftipangle\pgfmathresult% 120 | \pgfmathcos@{\halftipangle}% 121 | \pgfutil@tempdima\pgfmathresult pt\relax% 122 | \pgfutil@tempdima\cosechalftipangle\pgfutil@tempdima% 123 | \edef\cothalftipangle{\pgfmath@tonumber{\pgfutil@tempdima}}% 124 | \pgfmathreciprocal@{\pgfmathresult}% 125 | \let\sechalftipangle\pgfmathresult% 126 | \pgfmathsin@{\halftipangle}% 127 | \pgfutil@tempdima\pgfmathresult pt\relax% 128 | \pgfutil@tempdima\sechalftipangle\pgfutil@tempdima% 129 | \edef\tanhalftipangle{\pgfmath@tonumber{\pgfutil@tempdima}}% 130 | % 131 | % Get the single arrow head extend, and adjust for minimum width. 132 | % 133 | \pgf@xb\pgf@ya% 134 | \pgf@xb\cothalftipangle\pgf@xb% 135 | \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/single bent arrow head extend}}% 136 | \pgf@yc\pgf@xc% 137 | \advance\pgf@xc\pgf@ya% 138 | \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/minimum width}}% 139 | \ifdim\pgf@xc<.5\pgfutil@tempdimb% 140 | \pgfutil@tempdimb.5\pgfutil@tempdimb% 141 | \pgfmathdivide@{\pgfmath@tonumber{\pgfutil@tempdimb}}{\pgfmath@tonumber{\pgf@xc}}% 142 | \pgf@ya\pgfmathresult\pgf@ya% 143 | \pgf@xc\pgfmathresult\pgf@xc% 144 | \pgf@yc\pgfmathresult\pgf@yc% 145 | \pgf@xb\pgfmathresult\pgf@xb% 146 | \fi% 147 | % 148 | % Now calculate the height of the arrow and adjust for minimum height. 149 | % 150 | \advance\pgf@xc-\pgf@ya% 151 | \pgf@xc\cothalftipangle\pgf@xc% 152 | \pgf@xa2.0\pgf@xa% 153 | \advance\pgf@xa\pgf@xb% 154 | \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/minimum height}}% 155 | \ifdim\pgf@xa<\pgfutil@tempdimb% 156 | \pgf@xa\pgfutil@tempdimb% 157 | \fi% 158 | \advance\pgf@xa-\pgf@xb% 159 | \pgf@xa.5\pgf@xa% 160 | \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/single bent arrow head indent}}% 161 | % 162 | % Now: 163 | % 164 | % xa - .5 * width of the node minus xb. 165 | % ya - .5 * height of the node contents. 166 | % xb - distance from the end of the node contents to the arrow tip. 167 | % xc - distance from the end of the node contents to the back end of the arrow head. 168 | % yc - distance from the top of the node contents to the top end of the arrow head. 169 | % 170 | \pgfsavepgf@process\centerpoint{% 171 | \pgf@x.5\wd\pgfnodeparttextbox% 172 | \pgf@y.5\ht\pgfnodeparttextbox% 173 | \advance\pgf@y-.5\dp\pgfnodeparttextbox% 174 | }% 175 | \pgfsavepgf@process\basepoint{% 176 | \pgf@x.5\wd\pgfnodeparttextbox% 177 | \pgf@y0pt% 178 | }% 179 | \pgfsavepgf@process\midpoint{% 180 | \pgf@x.5\wd\pgfnodeparttextbox% 181 | \pgfmathsetlength\pgf@y{+.5ex}% 182 | }% 183 | % 184 | % Should only need five points here... 185 | % 186 | \pgfsavepgf@process\arrowtip{% 187 | \pgf@x\pgf@xa% 188 | \advance\pgf@x\pgf@xb% 189 | \pgf@y0pt\relax% 190 | }% 191 | \pgfsavepgf@process\beforearrowtip{% 192 | \pgf@x\pgf@xa% 193 | \advance\pgf@x-\pgf@xc% 194 | \pgf@y\pgf@ya% 195 | \advance\pgf@y\pgf@yc% 196 | }% 197 | \pgfsavepgf@process\beforearrowhead{% 198 | \pgf@x\pgf@xa% 199 | \advance\pgf@x-\pgf@xc% 200 | \advance\pgf@x\pgfutil@tempdima% 201 | \pgf@y\pgf@ya% 202 | }% 203 | \pgfsavepgf@process\beforearrowbend{% 204 | \pgf@x-\pgf@xa% 205 | \pgf@y\pgf@ya% 206 | }% 207 | \pgfsavepgf@process\afterarrowbend{% 208 | \pgf@x-\pgf@xa% 209 | \advance\pgf@x2\pgf@ya 210 | \pgf@y-\pgf@ya% 211 | }% 212 | \pgfsavepgf@process\afterarrowtail{% 213 | \pgf@x-\pgf@xa% 214 | \pgf@y\pgf@ya% 215 | \advance\pgf@y-2\pgf@xa% 216 | }% 217 | \pgfsavepgf@process\beforearrowtail{% 218 | \pgf@x-\pgf@xa% 219 | \advance\pgf@x2\pgf@ya 220 | \pgf@y\pgf@ya% 221 | \advance\pgf@y-2\pgf@xa% 222 | }% 223 | % 224 | % Calculate the anchor point at the arrow tip... 225 | % 226 | \pgfsavepgf@process\arrowtipanchor{% 227 | \pgfpointadd{\centerpoint}{\arrowtip}% 228 | \pgf@xa\xoutersep\relax% 229 | \advance\pgf@x\cosechalftipangle\pgf@xa% 230 | }% 231 | \advance\pgf@x.5\wd\pgfnodeparttextbox% 232 | \edef\externalradius{\the\pgf@x}% 233 | \addtosavedmacro\externalradius% 234 | % 235 | % ...and the rest of the points. 236 | % 237 | \pgfmathanglebetweenlines{\beforearrowtip}{\beforearrowhead}{\beforearrowtip}{\arrowtip}% 238 | \pgf@xa\xoutersep\relax% 239 | \pgfutil@tempdima\pgfmathresult pt\relax% 240 | \pgfutil@tempdima.5\pgfutil@tempdima% 241 | \pgfmathcosec@{\pgfmath@tonumber{\pgfutil@tempdima}}% 242 | \pgf@xa\pgfmathresult\pgf@xa% 243 | \pgfutil@tempdima-\pgfutil@tempdima% 244 | \advance\pgfutil@tempdima180pt\relax% 245 | \advance\pgfutil@tempdima-\halftipangle pt\relax% 246 | % 247 | \pgfsavepgf@process\beforearrowtipanchor{% 248 | \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgf@xa}% 249 | \pgf@xb\pgf@x% 250 | \pgf@yb\pgf@y% 251 | \pgf@process{\pgfpointadd{\centerpoint}{\beforearrowtip}}% 252 | \advance\pgf@x\pgf@xb% 253 | \advance\pgf@y\pgf@yb% 254 | }% 255 | \pgfmathanglebetweenpoints{\beforearrowhead}{\beforearrowtip}% 256 | \pgfutil@tempdima-\pgfmathresult pt\relax% 257 | \advance\pgfutil@tempdima180pt\relax% 258 | \pgfutil@tempdima.5\pgfutil@tempdima% 259 | \pgfmathcosec@{\pgfmath@tonumber{\pgfutil@tempdima}}% 260 | \pgf@xa\xoutersep\relax% 261 | \pgf@xa\pgfmathresult\pgf@xa% 262 | \pgfutil@tempdima-\pgfutil@tempdima% 263 | \advance\pgfutil@tempdima180pt\relax% 264 | \pgfsavepgf@process\beforearrowheadanchor{% 265 | \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgf@xa}% 266 | \pgf@xb\pgf@x% 267 | \pgf@yb\pgf@y% 268 | \pgf@process{\pgfpointadd{\centerpoint}{\beforearrowhead}}% 269 | \advance\pgf@x\pgf@xb% 270 | \advance\pgf@y\pgf@yb% 271 | }% 272 | \pgfsavepgf@process\beforearrowbendanchor{% 273 | \pgfpointadd{\centerpoint}{\beforearrowbend}% 274 | \advance\pgf@x-\xoutersep\relax% 275 | \advance\pgf@y\youtersep\relax% 276 | }% 277 | \pgfsavepgf@process\afterarrowbendanchor{% 278 | \pgfpointadd{\centerpoint}{\afterarrowbend}% 279 | \advance\pgf@x\xoutersep\relax% 280 | \advance\pgf@y-\youtersep\relax% 281 | }% 282 | \pgfsavepgf@process\afterarrowtailanchor{% 283 | \pgfpointadd{\centerpoint}{\afterarrowtail}% 284 | \advance\pgf@x-\xoutersep\relax% 285 | \advance\pgf@y-\youtersep\relax% 286 | }% 287 | \pgfsavepgf@process\beforearrowtailanchor{% 288 | \pgfpointadd{\centerpoint}{\beforearrowtail}% 289 | \advance\pgf@x\xoutersep\relax% 290 | \advance\pgf@y-\youtersep\relax% 291 | }% 292 | % 293 | \pgfmathanglebetweenpoints{\centerpoint}{\beforearrowtipanchor}% 294 | \let\center@angle@beforearrowtip\pgfmathresult% 295 | \pgfmathanglebetweenpoints{\centerpoint}{\beforearrowheadanchor}% 296 | \let\center@angle@beforearrowhead\pgfmathresult% 297 | \pgfmathanglebetweenpoints{\centerpoint}{\beforearrowbendanchor}% 298 | \let\center@angle@beforearrowbend\pgfmathresult% 299 | \addtosavedmacro\center@angle@beforearrowtip% 300 | \addtosavedmacro\center@angle@beforearrowhead% 301 | \addtosavedmacro\center@angle@beforearrowbend% 302 | % 303 | \pgfmathanglebetweenpoints{\midpoint}{\beforearrowtipanchor}% 304 | \let\mid@angle@beforearrowtip\pgfmathresult% 305 | \pgfmathanglebetweenpoints{\midpoint}{\beforearrowheadanchor}% 306 | \let\mid@angle@beforearrowhead\pgfmathresult% 307 | \pgfmathanglebetweenpoints{\midpoint}{\beforearrowbendanchor}% 308 | \let\mid@angle@beforearrowbend\pgfmathresult% 309 | \addtosavedmacro\mid@angle@beforearrowtip% 310 | \addtosavedmacro\mid@angle@beforearrowhead% 311 | \addtosavedmacro\mid@angle@beforearrowbend% 312 | % 313 | \pgfmathanglebetweenpoints{\basepoint}{\beforearrowtipanchor}% 314 | \let\base@angle@beforearrowtip\pgfmathresult% 315 | \pgfmathanglebetweenpoints{\basepoint}{\beforearrowheadanchor}% 316 | \let\base@angle@beforearrowhead\pgfmathresult% 317 | \pgfmathanglebetweenpoints{\basepoint}{\beforearrowbendanchor}% 318 | \let\base@angle@beforearrowbend\pgfmathresult% 319 | \addtosavedmacro\base@angle@beforearrowtip% 320 | \addtosavedmacro\base@angle@beforearrowhead% 321 | \addtosavedmacro\base@angle@beforearrowbend% 322 | % 323 | \addtosavedmacro\arrowtipanchor% 324 | \addtosavedmacro\beforearrowtipanchor% 325 | \addtosavedmacro\beforearrowheadanchor% 326 | \addtosavedmacro\beforearrowbendanchor% 327 | \addtosavedmacro\afterarrowbendanchor% 328 | \addtosavedmacro\afterarrowtailanchor% 329 | \addtosavedmacro\beforearrowtailanchor% 330 | }% 331 | \savedanchor\centerpoint{% 332 | \pgf@x.5\wd\pgfnodeparttextbox% 333 | \pgf@y.5\ht\pgfnodeparttextbox% 334 | \advance\pgf@y-.5\dp\pgfnodeparttextbox% 335 | }% 336 | \savedanchor\midpoint{% 337 | \pgf@x.5\wd\pgfnodeparttextbox% 338 | \pgfmathsetlength\pgf@y{+0.5ex}% 339 | }% 340 | \savedanchor\basepoint{% 341 | \pgf@x.5\wd\pgfnodeparttextbox% 342 | \pgf@y0pt% 343 | }% 344 | \anchor{center}{\centerpoint}% 345 | \anchor{mid}{\midpoint}% 346 | \anchor{mid east}{% 347 | \getsinglearrowpoints% 348 | \let\pgf@singlearrow@referencepoint\midpoint% 349 | \csname pgf@anchor@single bent arrow@border\endcsname{\pgfqpoint{\externalradius}{0pt}}% 350 | }% 351 | \anchor{mid west}{% 352 | \getsinglearrowpoints% 353 | \let\pgf@singlearrow@referencepoint\midpoint% 354 | \csname pgf@anchor@single bent arrow@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}% 355 | }% 356 | \anchor{base}{\basepoint}% 357 | \anchor{base east}{% 358 | \getsinglearrowpoints% 359 | \let\pgf@singlearrow@referencepoint\basepoint% 360 | \csname pgf@anchor@single bent arrow@border\endcsname{\pgfqpoint{\externalradius}{0pt}}% 361 | }% 362 | \anchor{base west}{% 363 | \getsinglearrowpoints% 364 | \let\pgf@singlearrow@referencepoint\basepoint% 365 | \csname pgf@anchor@single bent arrow@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}% 366 | }% 367 | \anchor{north}{% 368 | \getsinglearrowpoints% 369 | \csname pgf@anchor@single bent arrow@border\endcsname{\pgfqpoint{0pt}{\externalradius}}% 370 | }% 371 | \anchor{south}{% 372 | \getsinglearrowpoints% 373 | \csname pgf@anchor@single bent arrow@border\endcsname{\pgfqpoint{0pt}{-\externalradius}}% 374 | }% 375 | \anchor{east}{% 376 | \getsinglearrowpoints% 377 | \csname pgf@anchor@single bent arrow@border\endcsname{\pgfqpoint{\externalradius}{0pt}}% 378 | }% 379 | \anchor{west}{% 380 | \getsinglearrowpoints% 381 | \csname pgf@anchor@single bent arrow@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}% 382 | }% 383 | \anchor{north east}{% 384 | \getsinglearrowpoints% 385 | \csname pgf@anchor@single bent arrow@border\endcsname{\pgfqpoint{\externalradius}{\externalradius}}% 386 | }% 387 | \anchor{south east}{% 388 | \getsinglearrowpoints% 389 | \csname pgf@anchor@single bent arrow@border\endcsname{\pgfqpoint{\externalradius}{-\externalradius}}% 390 | }% 391 | \anchor{south west}{% 392 | \getsinglearrowpoints% 393 | \csname pgf@anchor@single bent arrow@border\endcsname{\pgfqpoint{-\externalradius}{-\externalradius}}% 394 | }% 395 | \anchor{north west}{% 396 | \getsinglearrowpoints% 397 | \csname pgf@anchor@single bent arrow@border\endcsname{\pgfqpoint{-\externalradius}{\externalradius}}% 398 | }% 399 | \anchor{before head}{% 400 | \getsinglearrowpoints% 401 | \pgfmathrotatepointaround{\beforearrowheadanchor}{\centerpoint}{\rotate}% 402 | }% 403 | \anchor{before tip}{% 404 | \getsinglearrowpoints% 405 | \pgfmathrotatepointaround{\beforearrowtipanchor}{\centerpoint}{\rotate}% 406 | }% 407 | \anchor{tip}{% 408 | \getsinglearrowpoints% 409 | \pgfmathrotatepointaround{\arrowtipanchor}{\centerpoint}{\rotate}% 410 | }% 411 | \anchor{after tip}{% 412 | \getsinglearrowpoints% 413 | \pgfmathrotatepointaround{% 414 | \pgfpointadd{% 415 | \pgfpointdiff{\centerpoint}{\beforearrowtipanchor}% 416 | \pgf@y-\pgf@y% 417 | }{\centerpoint}}% 418 | {\centerpoint}{\rotate}% 419 | }% 420 | \anchor{after head}{% 421 | \getsinglearrowpoints% 422 | \pgfmathrotatepointaround{% 423 | \pgfpointadd{% 424 | \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}% 425 | \pgf@y-\pgf@y% 426 | }{\centerpoint}}% 427 | {\centerpoint}{\rotate}% 428 | }% 429 | \anchor{before tail}{% 430 | \getsinglearrowpoints% 431 | \pgfmathrotatepointaround{\beforearrowtailanchor}{\centerpoint}{\rotate}% 432 | }% 433 | \anchor{before bend}{% 434 | \getsinglearrowpoints% 435 | \pgfmathrotatepointaround{\beforearrowbendanchor}{\centerpoint}{\rotate}% 436 | }% 437 | \anchor{after bend}{% 438 | \getsinglearrowpoints% 439 | \pgfmathrotatepointaround{\afterarrowbendanchor}{\centerpoint}{\rotate}% 440 | }% 441 | \anchor{after tail}{% 442 | \getsinglearrowpoints% 443 | \pgfmathrotatepointaround{\afterarrowtailanchor}{\centerpoint}{\rotate}% 444 | }% 445 | \anchor{tail}{% 446 | \getsinglearrowpoints% 447 | \pgfpointlineattime{0.5}{% 448 | \pgfmathrotatepointaround{\beforearrowbendanchor}{\centerpoint}{\rotate}% 449 | }% 450 | {% 451 | \pgfmathrotatepointaround{% 452 | \pgfpointadd{% 453 | \pgfpointdiff{\centerpoint}{\beforearrowbendanchor}% 454 | \pgf@y-\pgf@y% 455 | }{\centerpoint}}% 456 | {\centerpoint}{\rotate}% 457 | }% 458 | }% 459 | \backgroundpath{% 460 | {% 461 | \pgftransformshift{\centerpoint}% 462 | \pgftransformrotate{\rotate}% 463 | \pgfpathmoveto{\arrowtip}% 464 | \pgfpathlineto{\beforearrowtip}% 465 | \pgfpathlineto{\beforearrowhead}% 466 | \pgfpathlineto{\beforearrowbend}% 467 | \pgfpathlineto{\afterarrowtail}% 468 | \pgfpathlineto{\beforearrowtail}% 469 | \pgfpathlineto{\afterarrowbend}% 470 | \pgfpathlineto{\beforearrowhead\pgf@y-\pgf@y}% 471 | \pgfpathlineto{\beforearrowtip\pgf@y-\pgf@y}% 472 | }% 473 | \pgfpathclose% 474 | }% 475 | \anchorborder{% 476 | \pgfsavepgf@process\externalpoint{}% 477 | \getsinglearrowpoints% 478 | \pgfutil@ifundefined{pgf@singlearrow@referencepoint}{\let\referencepoint\centerpoint}% 479 | {\let\referencepoint\pgf@singlearrow@referencepoint}% 480 | \pgfsavepgf@process\externalpoint{% 481 | \externalpoint% 482 | \pgf@xa\pgf@x% 483 | \pgf@ya\pgf@y% 484 | \referencepoint% 485 | \advance\pgf@x\pgf@xa% 486 | \advance\pgf@y\pgf@ya}% 487 | \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}% 488 | \pgfmathsubtract@{\pgfmathresult}{\rotate}% 489 | \ifdim\pgfmathresult pt<0pt\relax% 490 | \pgfmathadd@{\pgfmathresult}{360}% 491 | \fi% 492 | \let\externalangle\pgfmathresult% 493 | \pgf@x\externalangle pt\relax% 494 | \ifx\referencepoint\midpoint% 495 | \pgf@xa\mid@angle@beforearrowtip pt\relax% 496 | \pgf@xb\mid@angle@beforearrowhead pt\relax% 497 | \pgf@xc\mid@angle@beforearrowbend pt\relax% 498 | \else% 499 | \ifx\referencepoint\basepoint% 500 | \pgf@xa\base@angle@beforearrowtip pt\relax% 501 | \pgf@xb\base@angle@beforearrowhead pt\relax% 502 | \pgf@xc\base@angle@beforearrowbend pt\relax% 503 | \else% 504 | \pgf@xa\center@angle@beforearrowtip pt\relax% 505 | \pgf@xb\center@angle@beforearrowhead pt\relax% 506 | \pgf@xc\center@angle@beforearrowbend pt\relax% 507 | \fi% 508 | \fi% 509 | \ifdim\pgf@x<\pgf@xa% 510 | \let\firstpoint\arrowtipanchor% 511 | \let\secondpoint\beforearrowtipanchor% 512 | \else% 513 | \ifdim\pgf@x<\pgf@xb% 514 | \ifdim\pgf@xb<\pgf@xa% 515 | \let\firstpoint\arrowtipanchor% 516 | \let\secondpoint\beforearrowtipanchor% 517 | \else% 518 | \let\firstpoint\beforearrowheadanchor% 519 | \let\secondpoint\beforearrowtipanchor% 520 | \fi% 521 | \else% 522 | \ifdim\pgf@x<\pgf@xc% 523 | \let\firstpoint\beforearrowheadanchor% 524 | \let\secondpoint\beforearrowbendanchor% 525 | \else% 526 | \pgf@xc-\pgf@xc% 527 | \advance\pgf@xc360pt\relax% 528 | \ifdim\pgf@x<\pgf@xc% 529 | \let\firstpoint\beforearrowbendanchor% 530 | \pgfsavepgf@process\secondpoint{% 531 | \pgfpointadd{% 532 | \pgfpointdiff{\centerpoint}{\beforearrowbendanchor}% 533 | \pgf@y-\pgf@y% 534 | }{\centerpoint}% 535 | }% 536 | \else% 537 | \pgf@xa-\pgf@xa% 538 | \advance\pgf@xa360pt\relax% 539 | \pgf@xb-\pgf@xb% 540 | \advance\pgf@xb360pt\relax% 541 | \ifdim\pgf@x<\pgf@xa% 542 | \ifdim\pgf@x<\pgf@xb% 543 | \pgfsavepgf@process\firstpoint{% 544 | \pgfpointadd{% 545 | \pgfpointdiff{\centerpoint}{\beforearrowbendanchor}% 546 | \pgf@y-\pgf@y% 547 | }{\centerpoint}% 548 | }% 549 | \pgfsavepgf@process\secondpoint{% 550 | \pgfpointadd{% 551 | \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}% 552 | \pgf@y-\pgf@y% 553 | }{\centerpoint}% 554 | }% 555 | \else% 556 | \ifdim\pgf@xb<\pgf@xa% 557 | \pgfsavepgf@process\firstpoint{% 558 | \pgfpointadd{% 559 | \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}% 560 | \pgf@y-\pgf@y% 561 | }{\centerpoint}% 562 | }% 563 | \else% 564 | \pgfsavepgf@process\firstpoint{% 565 | \pgfpointadd{% 566 | \pgfpointdiff{\centerpoint}{\arrowtipanchor}% 567 | \pgf@y-\pgf@y% 568 | }{\centerpoint}% 569 | }% 570 | \fi% 571 | \pgfsavepgf@process\secondpoint{% 572 | \pgfpointadd{% 573 | \pgfpointdiff{\centerpoint}{\beforearrowtipanchor}% 574 | \pgf@y-\pgf@y% 575 | }{\centerpoint}% 576 | }% 577 | \fi% 578 | \else% 579 | \pgfsavepgf@process\firstpoint{% 580 | \pgfpointadd{% 581 | \pgfpointdiff{\centerpoint}{\beforearrowtipanchor}% 582 | \pgf@y-\pgf@y% 583 | }{\centerpoint}% 584 | }% 585 | \let\secondpoint\arrowtipanchor% 586 | \fi% 587 | \fi% 588 | \fi% 589 | \fi% 590 | \fi% 591 | \pgfsavepgf@process\firstpoint{% 592 | \pgfmathrotatepointaround{\firstpoint}{\centerpoint}{\rotate}% 593 | }% 594 | \pgfsavepgf@process\secondpoint{% 595 | \pgfmathrotatepointaround{\secondpoint}{\centerpoint}{\rotate}% 596 | }% 597 | \pgfpointintersectionoflines{\referencepoint}{\externalpoint}% 598 | {\firstpoint}{\secondpoint}% 599 | }% 600 | }% 601 | 602 | % keys for shape promoter 603 | % 604 | % /pgf/promoter arrow 605 | 606 | \pgfkeys{/tikzdna/.cd, 607 | promoter arrow/.initial=Triangle, 608 | }% 609 | 610 | % Shape promoter 611 | % 612 | % 613 | \pgfdeclareshape{promoter}{% 614 | \inheritsavedanchors[from=rectangle] % this is nearly a rectangle 615 | \inheritanchorborder[from=rectangle]% 616 | \inheritanchor[from=rectangle]{center}% 617 | \inheritanchor[from=rectangle]{north}% 618 | \inheritanchor[from=rectangle]{north west}% 619 | \inheritanchor[from=rectangle]{north east}% 620 | \inheritanchor[from=rectangle]{south}% 621 | \inheritanchor[from=rectangle]{south west}% 622 | \inheritanchor[from=rectangle]{south east}% 623 | \inheritanchor[from=rectangle]{west}% 624 | \inheritanchor[from=rectangle]{east}% 625 | \anchor{crown}{% 626 | \pgf@process{\southwest}% 627 | \pgf@xa=\pgf@x% 628 | \pgf@process{\northeast}% 629 | \advance\pgf@x by \pgf@xa% 630 | \advance\pgf@y by 3pt% 631 | }% 632 | \backgroundpath{% this is new 633 | % store lower right in xa/ya and upper right in xb/yb 634 | \southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y% 635 | \northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y% 636 | % construct main path 637 | \pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}% 638 | \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}}% 639 | \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yb}}% 640 | \pgfsetarrowsend{\pgfkeysvalueof{/pgf/promoter arrow}}% 641 | }% 642 | }% 643 | 644 | 645 | % Shape terminator 646 | % 647 | % 648 | \pgfdeclareshape{terminator}{% 649 | \inheritsavedanchors[from=rectangle] % this is nearly a rectangle 650 | \inheritanchorborder[from=rectangle]% 651 | \inheritanchor[from=rectangle]{center}% 652 | \inheritanchor[from=rectangle]{north}% 653 | \inheritanchor[from=rectangle]{north west}% 654 | \inheritanchor[from=rectangle]{north east}% 655 | \inheritanchor[from=rectangle]{south}% 656 | \inheritanchor[from=rectangle]{south west}% 657 | \inheritanchor[from=rectangle]{south east}% 658 | \inheritanchor[from=rectangle]{west}% 659 | \inheritanchor[from=rectangle]{east}% 660 | \backgroundpath{ 661 | % store lower right in xa/ya and upper right in xb/yb 662 | \southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y% 663 | \northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y% 664 | \advance\pgf@x by \pgf@xa% 665 | \pgf@xc=\pgf@x% 666 | % construct main path 667 | \pgfpathmoveto{\pgfpoint{\pgf@xc}{\pgf@ya}}% 668 | \pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yb}}% 669 | \pgfpathmoveto{\pgfpoint{\pgf@xb}{\pgf@yb}}% 670 | \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}}% 671 | }% 672 | }% 673 | 674 | 675 | 676 | 677 | \endinput 678 | -------------------------------------------------------------------------------- /tikzlibrarydna.code.tex: -------------------------------------------------------------------------------- 1 | % 2 | % Copyright © 2021 by Timothy S. Jones 3 | % 4 | % This work may be distributed and/or modified under the 5 | % conditions of the LaTeX Project Public License, either version 1.3 6 | % of this license or (at your option) any later version. 7 | % The latest version of this license is in 8 | % http://www.latex-project.org/lppl.txt 9 | % and version 1.3 or later is part of all distributions of LaTeX 10 | % version 2005/12/01 or later. 11 | % 12 | % This work has the LPPL maintenance status `maintained'. 13 | % 14 | % The Current Maintainer of this work is Timothy S. Jones. 15 | % 16 | % This work consists of the file tikzlibrarydna.code.tex. 17 | % 18 | \ProvidesFile{tikzlibrarydna.code}[2021/06/15 v0.0.1 DNA diagrams using TikZ] 19 | 20 | \pgfkeys{/dna/.cd, 21 | coding sequence length/.initial=6mm, 22 | } 23 | 24 | \tikzset{ 25 | feature/.style={draw, transform shape}, 26 | coding sequence/.style={ 27 | feature, 28 | shape=single arrow, 29 | minimum height=6mm, 30 | single arrow head extend=1mm, 31 | anchor=west 32 | }, 33 | ribosome binding site/.style={ 34 | feature, 35 | shape=semicircle, 36 | anchor=south, 37 | yshift=-0.5\pgflinewidth, 38 | inner sep=1pt, 39 | fill=black 40 | }, 41 | promoter/.style={ 42 | feature, 43 | shape=promoter, 44 | promoter arrow={Triangle[length=3pt,width=3pt]}, 45 | anchor=south west, 46 | yshift=\pgflinewidth, 47 | minimum height=2mm, 48 | minimum width=2mm, 49 | inner sep=0 50 | }, 51 | terminator/.style={ 52 | feature, 53 | shape=terminator, 54 | anchor=south, 55 | yshift=0.5\pgflinewidth, 56 | minimum height=2mm, 57 | minimum width=2mm, 58 | inner sep=0 59 | }, 60 | line cap=rect, 61 | }% 62 | 63 | % Most of the below is adapted from tikzlibrarygraphs.code.tex 64 | 65 | \def\tikzdna@dnaplot{% 66 | \pgfutil@ifnextchar[{\tikzdna@dnaplot@}{\tikzdna@dnaplot@[]}% 67 | }% 68 | 69 | % #1: \dnaplot [...] 70 | % FIXME do something with #1 71 | \def\tikzdna@dnaplot@[#1]{% 72 | \pgfutil@ifnextchar f{\tikzdna@dnaplot@features}{% 73 | \pgfutil@ifnextchar r{\tikzdna@dnaplot@regulation}{% 74 | \tikzdna@dnaplot@features features% 75 | }% 76 | }% 77 | }% 78 | 79 | \def\tikzdna@dnaplot@features@done{% 80 | }% 81 | 82 | \def\tikzdna@dnaplot@features features{% 83 | \pgfutil@ifnextchar[{\tikzdna@dnaplot@features@}{\tikzdna@dnaplot@features@[]}% 84 | }% 85 | 86 | % #1: \dnaplot features [...] 87 | \def\tikzdna@dnaplot@features@[#1]{% 88 | % FIXME set options with #1 89 | \tikzdna@dnaplot@features@normal@main% 90 | }% 91 | 92 | \def\tikzdna@dnaplot@features@normal@main#1{% 93 | \tikzdna@dnaplot@features@parse@group{#1}% 94 | \tikzdna@dnaplot@main@done% 95 | }% 96 | 97 | \def\tikzdna@dnaplot@features@parse@group#1{% 98 | \let\tikzdna@dnaplot@features@group@cont\pgfutil@empty% 99 | \let\tikzdna@dnaplot@features@group@conta\pgfutil@empty% 100 | \tikzdna@dnaplot@features@encloser#1[\pgf@stop@eogroup% 101 | }% 102 | 103 | % 104 | % Replace ...[...]... by ...[{...}]... 105 | % 106 | \def\tikzdna@dnaplot@features@encloser{% 107 | \tikzdna@dnaplot@features@encloser@% 108 | }% 109 | 110 | \def\tikzdna@dnaplot@features@encloser@#1[{% 111 | \pgfutil@ifnextchar\pgf@stop@eogroup{% 112 | \expandafter\tikzdna@dnaplot@features@semi\tikzdna@dnaplot@features@group@cont#1;% 113 | }{% 114 | \expandafter\def\expandafter\tikzdna@dnaplot@features@group@cont\expandafter{\tikzdna@dnaplot@features@group@cont#1[}% 115 | \tikzdna@dnaplot@features@encloser@cont% 116 | }% 117 | }% 118 | 119 | \def\tikzdna@dnaplot@features@encloser@cont#1]#2[{% 120 | \pgfutil@ifnextchar\pgf@stop@eogroup{% 121 | \expandafter\tikzdna@dnaplot@features@semi\tikzdna@dnaplot@features@group@cont{#1}]#2;}{% 122 | \expandafter\def\expandafter\tikzdna@dnaplot@features@group@cont\expandafter{\tikzdna@dnaplot@features@group@cont{#1}]#2[}% 123 | \tikzdna@dnaplot@features@encloser@cont}% 124 | }% 125 | 126 | % 127 | % Replace ; by , 128 | % 129 | \def\tikzdna@dnaplot@features@semi{% 130 | \tikzdna@dnaplot@features@semi@% 131 | }% 132 | 133 | \def\tikzdna@dnaplot@features@semi@#1;{% 134 | \pgfutil@ifnextchar\pgf@stop@eogroup{% 135 | \expandafter\tikzdna@dnaplot@features@main@parser\tikzdna@dnaplot@features@group@conta#1,}{% 136 | \expandafter\def\expandafter\tikzdna@dnaplot@features@group@conta\expandafter{\tikzdna@dnaplot@features@group@conta#1,}% 137 | \tikzdna@dnaplot@features@semi% 138 | }% 139 | }% 140 | 141 | \def\tikzdna@dnaplot@features@main@parser#1,{% 142 | \tikzdna@dnaplot@features@grab@feature@type#1\pgf@stop\pgf@stop@eofeature% 143 | % \tikz@lib@graph@stored@actions% 144 | \pgfutil@ifnextchar\pgf@stop@eofeature{% 145 | \tikzdna@dnaplot@features@feature@done% 146 | }{% 147 | % FIXME 148 | }% 149 | }% 150 | 151 | \def\tikzdna@dnaplot@features@grab@feature@type{% 152 | % FIXME implement foreach 153 | % \pgfutil@ifnextchar\foreach\tikzdna@dnaplot@features@do@foreach\tikzdna@dnaplot@features@parse@type@text% 154 | \tikzdna@dnaplot@features@parse@type@text% 155 | } 156 | 157 | % 158 | % Get the type of the feature 159 | % 160 | \def\tikzdna@dnaplot@features@parse@type@text#1\pgf@stop{% 161 | \tikzdna@dnaplot@features@parse@normal@feature#1[\pgf@stop% 162 | }% 163 | 164 | \def\tikzdna@dnaplot@features@parse@normal@feature#1[{% 165 | \edef\pgf@marshal{\noexpand\pgfkeys@spdef\noexpand\tikzdna@dnaplot@features@type@only{#1}}% 166 | \pgf@marshal% 167 | % previously saved node text here 168 | \edef\tikzdna@dnaplot@features@feature@type{\tikz@lib@graph@path\tikzdna@dnaplot@features@type@only}% 169 | \tikzdna@dnaplot@features@handle@feature@cont% 170 | } 171 | 172 | \newif\iftikzgraphsautonumbernodes 173 | \newcount\tikzdna@dnaplot@auto@number 174 | 175 | \def\tikzdna@dnaplot@auto@sep{\space}% 176 | 177 | \tikzset{ 178 | /tikzdna/.cd,% 179 | }% 180 | 181 | \def\tikzdna@dnaplot@features@do@autonumber{% 182 | % FIXME do not overwrite \tikzdna@dnaplot@features@type@only here 183 | % do we even need this 184 | \ifx\tikzdna@dnaplot@features@type@only\pgfutil@empty% 185 | \else% 186 | \edef\tikzdna@dnaplot@features@type@only{\tikz@lib@graph@name@only\tikzdna@dnaplot@auto@sep\the\tikzdna@dnaplot@auto@number}% 187 | \global\advance\tikzdna@dnaplot@auto@number by1\relax% 188 | \fi% 189 | }% 190 | 191 | % 192 | % We have now parsed everything up to the opening "[". We continue 193 | % 194 | \def\tikzdna@dnaplot@features@handle@feature@cont{% 195 | % TODO 196 | \iftikzgraphsautonumbernodes% 197 | \tikz@lib@do@autonumber% 198 | \fi% 199 | \iftikz@lib@graph@fresh@node% 200 | \tikz@lg@if@local@node{\tikz@lib@graph@name}{\tikz@lg@find@fresh@name}{}% 201 | \fi% 202 | \let\tikzgraphnodeas\tikzgraphnodeas@default% 203 | \pgfutil@ifnextchar\pgf@stop{% 204 | \ifx\tikz@lib@graph@name@only\pgfutil@empty% 205 | \expandafter\tikz@lib@graph@node@empty@done% 206 | \else 207 | \expandafter\tikz@lib@graph@node@opt\expandafter[\expandafter]\expandafter[% 208 | \fi% 209 | }{\tikz@lib@graph@node@opt[}% 210 | }% 211 | 212 | \def\tikzdna@dnaplot@features@feature@done\pgf@stop@eofeature{% 213 | % TODO 214 | }% 215 | 216 | \def\tikzdna@dnaplot@main@done{% 217 | % TODO 218 | }% 219 | 220 | \def\tikzdna@dnaplot@regulation regulation{% 221 | \pgfutil@ifnextchar[{\tikzdna@dnaplot@regulation@}{\tikzdna@dnaplot@regulation@[]}% 222 | }% 223 | 224 | \def\tikzdna@dnaplot@regulation@[#1]#2;{% 225 | }% 226 | 227 | \pgfutil@IfUndefined{tikzaddtikzonlycommandshortcutlet}{% 228 | \def\tikzaddtikzonlycommandshortcutlet#1#2{% 229 | \expandafter\def\expandafter\tikz@installcommands\expandafter{\tikz@installcommands% 230 | \let#1=#2% 231 | }% 232 | }% 233 | }{}% 234 | 235 | \tikzaddtikzonlycommandshortcutlet\dnaplot\tikzdna@dnaplot% 236 | -------------------------------------------------------------------------------- /tikzlibraryshapes.dna.code.tex: -------------------------------------------------------------------------------- 1 | % 2 | % Copyright © 2021 by Timothy S. Jones 3 | % 4 | % This work may be distributed and/or modified under the 5 | % conditions of the LaTeX Project Public License, either version 1.3 6 | % of this license or (at your option) any later version. 7 | % The latest version of this license is in 8 | % http://www.latex-project.org/lppl.txt 9 | % and version 1.3 or later is part of all distributions of LaTeX 10 | % version 2005/12/01 or later. 11 | % 12 | % This work has the LPPL maintenance status `maintained'. 13 | % 14 | % The Current Maintainer of this work is Timothy S. Jones. 15 | % 16 | % This work consists of the files: 17 | % 18 | % tikz-dna.dtx 19 | % tikz-dna.ins 20 | % tikzlibraryshapes.dna.code.tex 21 | % pgflibraryshapes.dna.code.tex 22 | % 23 | % and the derived file tikz-dna.sty. 24 | % 25 | 26 | \ProvidesFile{tikzlibraryshapes.dna.code.tex} 27 | 28 | \usepgflibrary{shapes.dna} 29 | 30 | \endinput 31 | --------------------------------------------------------------------------------