Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. begin{document}
  2. input{contents}
  3. end{document}
  4.  
  5. % compile with pdflatex -shell-escape
  6.  
  7. documentclass[preview,border=12pt]{standalone}
  8. usepackage{filecontents}
  9.  
  10. begin{filecontents*}{template.tex}
  11. documentclass[preview,border=12pt]{standalone}
  12. newififsecret
  13. begin{document}
  14. common 1
  15.  
  16. ifsecret
  17. I have a top secret message here.
  18. fi
  19.  
  20. common 2
  21. end{document}
  22. end{filecontents*}
  23.  
  24. usepackage{graphicx}
  25.  
  26. begin{document}
  27. immediatewrite18{unexpanded{pdflatex -jobname=secret-included "AtBeginDocument{secrettrue} input{template}"}}
  28. immediatewrite18{unexpanded{pdflatex -jobname=secret-excluded "AtBeginDocument{secretfalse} input{template}"}}
  29. Done, secret-included.pdf and secret-excluded.pdf have been generated!
  30.  
  31. fbox{includegraphics[width=.5linewidth]{secret-included}}%
  32. fbox{includegraphics[width=.5linewidth]{secret-excluded}}
  33. end{document}
  34.  
  35. documentclass[final]{article}
  36. makeatletter
  37. newififfinal
  38. @ifclasswith{article}{final}{
  39. typeout{FINAL}finaltrue}{
  40. typeout{DRAFT}finalfalse}
  41. makeatother
  42.  
  43. begin{document}
  44. iffinal
  45. textbf{fbox{This is the author's manuscript.}}
  46. fi
  47.  
  48. blabla
  49. end{document}
  50.  
  51. newtoggle{<section>}
  52. settoggle{<section>}{true}
  53.  
  54. iftoggle{<section>}{input{section.tex}}{}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement