Solución:
Puede utilizar coordenadas polares como (55:100cm)
. En el siguiente código, calculo el número exacto de líneas oblicuas para dibujar en función del ángulo elegido myAngle
y la distancia myDist
entre dos líneas oblicuas consecutivas. Mi código también calcula la mayor longitud necesaria para estas líneas.
documentclass[a4paper]article
usepackagetikz
usetikzlibrarycalc
pagestyleempty
newcommand*myDist1cm % distance between consecutive oblique lines
newcommand*myAngle55 % angle of said lines wrt horizontal, in degrees
% Distance between consecutive oblique lines, projected on the horizontal axis
pgfmathsetlengthmacrohorizIntervWidthmyDist/sin(myAngle)
% Length of the longest oblique lines we'll need. I add 10pt to be 100% safe
% with respect to rounding errors (the lines will be clipped anyway).
pgfmathsetlengthmacromaxLength10pt + paperheight/sin(myAngle)
% Number of oblique lines to draw
pgfmathtruncatemacromaxIndex
round((paperheight/tan(myAngle) + paperwidth)/horizIntervWidth)
begindocument
begintikzpicture[remember picture, overlay]
% Just to be sure we don't paint outside the page. :-)
clip (current page.south west) rectangle (current page.north east);
foreach i in 1,2,...,30
draw[black] ($(current page.north west)+(0,-i)$) --
($(current page.north east)+(0,-i)$);
foreach i in 0.5,1.5,...,60
draw[lightgray] ($(current page.north west)+(0,-i)$) --
($(current page.north east)+(0,-i)$);
foreach i in 1,2,...,maxIndex
draw[red] ([xshift=-i*horizIntervWidth]current page.south east) --
+(myAngle:maxLength);
endtikzpicture
enddocument
Esto hace no responder a su pregunta específica, pero se puede adaptar para su uso con muchas otras opciones integradas. Intenté establecer los valores predeterminados según sus requisitos (a la izquierda en las líneas verticales, pero puede deshabilitar eso indlugin draw=none
hasta el final de Vertical Line Style
y Vertical Line Style Alternate
.
Notas:
- Hay tres tipos diferentes de líneas: horizontal, vertical y horizontal.
- El ángulo de inclinación se puede configurar mediante
SlantAngle
. - Cada estilo de línea tiene un
tikzset
tener un estilo alternativo aplicado a cada enésima línea y cada uno tiene dos estilos de líneas asociados: el estilo principal y un estilo de línea alternativo. - El borde es opcional y se puede desactivar configurando
MarginTop
,MarginBottom
,MarginLeft
yMarginRight
para0.0cm
.
Código:
%% Calligraphy Guide Lines
%% Peter Grill
%%
%% ---------------------- Note: May need to run this twice ---------------------
%%
%% --------------------------------------------------- Select Lines
%% ---------------------------------------------------------------- Horizontal Lines
defVerticalSkip1.0cm% 0.10cm through 2cm
defUseAltStyleEveryNthHorizontalLine2%
%% ---------------------------------------------------------------- Vertical Slant Lines
defHorizontalSlantSkip1.0cm%
defSlantAngle55% Degrees >30, < 60
defUseAltStyleEveryNthSlantLine4%
%% ---------------------------------------------------------------- Vertical Lines
defHorizontalSkip2.66625cm%
defUseAltStyleEveryNthVerticalLine5%
%% ---------------------------------------------------------------- Select Margins
defMarginTop0.25cm
defMarginBottom0.25cm
defMarginLeft0.25cm
defMarginRight0.25cm
%% ---------------------------------------------------------------- Select Paper
defPapera4paper% letter | a4paper | a5paper, ....
defOrientationportrait%% portrait | landscape
%% -----------------------
documentclass[Paper, Orientation]article% Version 1.1
usepackagetikz
usepackagexstring
pagestyleempty
%% Select the line style. I prefer using the second one here and using the output underneath
%% the actual paper as guide lines. The first is better if you want to actually write on
%% top of the guide lines
%%
%% Few other options that can be applied here (last applied options override earlier ones).
%% solid
%% dotted, densely dotted, loosely dotted,
%% dashed, densely dashed, loosely dashed,
%% dash dot dot, densely dash dot dot, loosely dash dot dot,
%% loosely dashed,
%%
%% Custom line styles can be defined also be specifying the on/off patter:
%% dash pattern=on 2pt off 3pt on 4pt off 4pt
%%
%% To disable ANY lines use the draw=none as the last style.
%tikzsetLine Style/.style=line width=1pt, densely dotted, gray, draw opacity=0.1
tikzsetLine Style/.style=
line width=0.2pt,
solid,
gray,
draw opacity=0.5
tikzsetHorizontal Line Style/.style=
Line Style,
solid,
tikzsetHorizontal Line Style Alternate/.style=
Line Style,
line width=0.2pt,
dashed,
draw opacity=1.0,
tikzsetSlant Line Style/.style=
Line Style
tikzsetSlant Line Style Alternate/.style=
Line Style,
line width=0.2pt,
solid,
draw opacity=1.0,
red
tikzsetVertical Line Style/.style=Line Style, line width=0.1pt
tikzsetVertical Line Style Alternate/.style=Line Style, line width=0.1pt
tikzsetBorder Line Style/.style=Line Style, thin
newlengthDeltaY
newlengthTempLength
pgfmathtruncatemacroMaxHorizontalLinespaperheight/VerticalSkip
pgfmathsetmacroTanSlantAngletan(SlantAngle)
pgfmathsetlengthDeltaYHorizontalSlantSkip*TanSlantAngle
pgfmathtruncatemacroMaxSlantLinesXpaperwidth/HorizontalSlantSkip
pgfmathtruncatemacroMaxSlantLinesYpaperheight/DeltaY
pgfmathtruncatemacroMaxVerticalLinespaperwidth/HorizontalSkip
newcommand*SetLineStyle[4]%
%% #1 = style name to set
%% #2 = default line style
%% #3 = line number
%% #4 = which lines get the alternate line style
pgfmathtruncatemacroRemaindermod(#3,#4)%
ifnumRemainder=0relax
tikzset#1/.style=#2 Alternate%
else
tikzset#1/.style=#2%
fi
%
begindocument%
begintikzpicture[
remember picture,
overlay,
shift=(current page.south west),% So that (0,0) is south west of paper
]
%% Clip to create the border
clip (MarginLeft,MarginBottom) rectangle
(paperwidth-MarginRight,paperheight-MarginTop);
foreach y in 1,...,MaxHorizontalLines % Horizontal guide lines
SetLineStyle
This Horizontal Line StyleHorizontal Line Style
yUseAltStyleEveryNthHorizontalLine
beginscope[yshift=-MarginTop]
draw[This Horizontal Line Style]
(0pt,paperheight-y*VerticalSkip) -- (paperwidth,paperheight-y*VerticalSkip)
;
endscope
foreach x in 1,...,MaxVerticalLines % Vertical guide lines
SetLineStyle
This Vertical Line StyleVertical Line Style
xUseAltStyleEveryNthVerticalLine
beginscope[xshift=MarginLeft]
draw[This Vertical Line Style]
(x*HorizontalSkip,0pt) -- (x*HorizontalSkip,paperheight)
;
endscope
pgfmathsetlengthTempLengthpaperwidth*TanSlantAngle
foreach x in 0,...,MaxSlantLinesX % Slant Lines starting along bottom of page
SetLineStyle
This Slant Line StyleSlant Line Style
xUseAltStyleEveryNthSlantLine
draw[This Slant Line Style]
(x*HorizontalSlantSkip,0pt) -- ++(paperwidth,TempLength)
;
foreach y in 1,...,MaxSlantLinesY % Slant Lines starting along left of page
SetLineStyle
This Slant Line StyleSlant Line Style
yUseAltStyleEveryNthSlantLine
draw[This Slant Line Style]
(0pt,y*DeltaY) -- ++(paperwidth,TempLength)
;
%% Draw border
draw [Border Line Style]
(MarginLeft,MarginBottom) rectangle
(paperwidth-MarginRight,paperheight-MarginTop);
endtikzpicture%
enddocument
Otra solucion sin calc
.
documentclass[a4paper]article %do not include "draft" in order to render pictures
usepackagetikz
%usetikzlibrarycalc
usepackageverbatim
begindocument
pagestyleempty
begintikzpicture[remember picture,overlay]
foreach i in 1,2,3,...,30
draw[black] ([yshift=-i cm]current page.north west) -- ++(0:paperwidth);
foreach i in 0.5,1.5,2.5,...,60
draw[lightgray] ([yshift=-i cm]current page.north west) -- ++(0:paperwidth);
foreach i in 1,2,3,...,60
draw[red] ([xshift=i cm]current page.north west) -- ++(235:2*paperheight);
endtikzpicture
enddocument
Aquí puedes ver las reseñas y valoraciones de los lectores
Si sostienes alguna sospecha y capacidad de medrar nuestro reseña puedes realizar una aclaración y con mucho placer lo leeremos.