summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/moderncv/moderncvdebugtools.sty
blob: b28e409b54163335f62a3a6baddd9e3241c969a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
%% start of file `moderncvdebugtools.sty'.
%% Copyright 2013-2015 Xavier Danaux (xdanaux@gmail.com), 2020-2022 moderncv maintainers (github.com/moderncv).
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License version 1.3c,
% available at http://www.latex-project.org/lppl/.


%-------------------------------------------------------------------------------
%                identification
%-------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{moderncvdebugtools}[2022-02-21 v2.3.1 modern curriculum vitae and letter debug tools]


%-------------------------------------------------------------------------------
%                required packages
%-------------------------------------------------------------------------------
\RequirePackage{tikz}


%-------------------------------------------------------------------------------
%                debug tools
%-------------------------------------------------------------------------------
% code of \tracedebugvrule and \tracedebughrule provided by Gonzalo Medina on TeX.SX (cfr tex.stackexchange.com/a/110805/10102)
\newcounter{debugrule}
\pgfdeclarelayer{background}
\pgfsetlayers{background,main}

\DeclareDocumentCommand{\tracedebugvrule}{oO{0pt}}{%
  \stepcounter{debugrule}%
  \begin{tikzpicture}[remember picture,overlay]
    \begin{pgfonlayer}{background}
      \coordinate (a\thedebugrule);
      \draw[red,thin,#1] 
        ([xshift=#2]a\thedebugrule|-current page.north) -- ([xshift=#2]a\thedebugrule|-current page.south);
    \end{pgfonlayer}
  \end{tikzpicture}}

\DeclareDocumentCommand{\tracedebughrule}{oO{0pt}}{%
  \stepcounter{debugrule}%
  \begin{tikzpicture}[remember picture,overlay]
    \begin{pgfonlayer}{background}
    \coordinate (b\thedebugrule);
      \draw[red,thin,#1] 
       ([yshift=#2]b\thedebugrule-|current page.west) -- ([yshift=#2]b\thedebugrule-|current page.east);
    \end{pgfonlayer}
  \end{tikzpicture}}


\endinput


%% end of file `moderncvdebugtools.sty'.