moderncvdebugtools.sty 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. %% start of file `moderncvdebugtools.sty'.
  2. %% Copyright 2013-2015 Xavier Danaux (xdanaux@gmail.com).
  3. %
  4. % This work may be distributed and/or modified under the
  5. % conditions of the LaTeX Project Public License version 1.3c,
  6. % available at http://www.latex-project.org/lppl/.
  7. %-------------------------------------------------------------------------------
  8. % identification
  9. %-------------------------------------------------------------------------------
  10. \NeedsTeXFormat{LaTeX2e}
  11. \ProvidesPackage{moderncvdebugtools}[2015/07/28 v2.0.0 modern curriculum vitae and letter debug tools]
  12. %-------------------------------------------------------------------------------
  13. % required packages
  14. %-------------------------------------------------------------------------------
  15. \RequirePackage{tikz}
  16. %-------------------------------------------------------------------------------
  17. % debug tools
  18. %-------------------------------------------------------------------------------
  19. % code of \tracedebugvrule and \tracedebughrule provided by Gonzalo Medina on TeX.SX (cfr tex.stackexchange.com/a/110805/10102)
  20. \newcounter{debugrule}
  21. \pgfdeclarelayer{background}
  22. \pgfsetlayers{background,main}
  23. \DeclareDocumentCommand{\tracedebugvrule}{oO{0pt}}{%
  24. \stepcounter{debugrule}%
  25. \begin{tikzpicture}[remember picture,overlay]
  26. \begin{pgfonlayer}{background}
  27. \coordinate (a\thedebugrule);
  28. \draw[red,thin,#1]
  29. ([xshift=#2]a\thedebugrule|-current page.north) -- ([xshift=#2]a\thedebugrule|-current page.south);
  30. \end{pgfonlayer}
  31. \end{tikzpicture}}
  32. \DeclareDocumentCommand{\tracedebughrule}{oO{0pt}}{%
  33. \stepcounter{debugrule}%
  34. \begin{tikzpicture}[remember picture,overlay]
  35. \begin{pgfonlayer}{background}
  36. \coordinate (b\thedebugrule);
  37. \draw[red,thin,#1]
  38. ([yshift=#2]b\thedebugrule-|current page.west) -- ([yshift=#2]b\thedebugrule-|current page.east);
  39. \end{pgfonlayer}
  40. \end{tikzpicture}}
  41. \endinput
  42. %% end of file `moderncvdebugtools.sty'.