![Hacer un gráfico similar a un cuadro en látex (para teoría de números)](https://rvso.com/image/420043/Hacer%20un%20gr%C3%A1fico%20similar%20a%20un%20cuadro%20en%20l%C3%A1tex%20(para%20teor%C3%ADa%20de%20n%C3%BAmeros).png)
Había estado tomando mis apuntes de clase de teoría de números en látex y todo está hecho excepto una última parte (¡que he estado posponiendo durante mucho tiempo!).
Estoy tratando de encontrar la mejor manera de transferir el siguiente gráfico/cuadro a látex, pero no estaba seguro de qué paquete debería elegir.
Realmente agradecería algunas orientaciones y sugerencias.
PD: Trabajé/he estado trabajando en Overleaf. Dado que el documento completo es demasiado largo para publicarlo en esta pregunta,aquíes el enlace al mismo, por si puede ser de utilidad. (Avíseme si no funciona).
PSS Anteriormente he trabajado principalmente con tikz (para temas de teoría de grafos y teoría de juegos) y algunos otros paquetes que se usaban principalmente para generar gráficos funcionales; Entonces, basándome en esta experiencia, pensé que este gráfico también podría construirse con tikz.
Respuesta1
En Tikz, puedes usar grid
para dibujar la cuadrícula y luego definir un nodo que dibuje un pequeño círculo relleno (en el código a continuación plupp
). Después de eso, es principalmente una cuestión de posicionar los nodos de texto.
\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\usepackage{amsmath}
\begin{document}
\begin{tikzpicture}[plupp/.style={circle,draw,inner sep=1pt,fill=black}]
\draw (0,0) grid (7,5);
\node[anchor=north east] at (0,0){$0$};
\node[anchor=south east] at (0,5){$\alpha$};
\node[anchor=south west] at (7,5){$N$};
\node[anchor=north west] at (7,0){$R$};
\draw (0,0) -- (7,5);
\node[plupp,label={180:$C$}] at (0,2){};
\node[plupp,label={-90:$A$}] at (3,0){};
\node[plupp,label=110:$P$] at (7*2/5,2){};
\node[plupp,label=90:$\mu$] at (3,5*3/7){};
\node[plupp,label=-45:$B$] at (3,2){};
\draw[<->](0,-0.7) -- +(3,0) node[pos=0.5,fill=white]{$\tfrac{p-1}{2}$};
\draw[<->](0,-1.3) -- +(7,0) node[pos=0.5,fill=white]{$p$};
\draw[<->](-0.7,0) -- +(0,2) node[pos=0.5,fill=white]{$\tfrac{g-1}{2}$};
\draw[<->](7.5,0) -- +(0,5) node[pos=0.5,fill=white]{$g$};
\end{tikzpicture}
\end{document}
Respuesta2
Bueno, aquí hay una introducción usando el paquete tikz.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[gray, thick] (0,0) -- (0,6);
\draw[gray, thick] (1,0) -- (1,6);
\draw[gray, thick] (2,0) -- (2,6);
\draw[gray, thick] (3,0) -- (3,6);
\draw[gray, thick] (4,0) -- (4,6);
\draw[gray, thick] (5,0) -- (5,6);
\draw[gray, thick] (6,0) -- (6,6);
\draw[gray, thick] (7,0) -- (7,6);
\draw[gray, thick] (0,0) -- (7,0);
\draw[gray, thick] (0,1) -- (7,1);
\draw[gray, thick] (0,2) -- (7,2);
\draw[gray, thick] (0,3) -- (7,3);
\draw[gray, thick] (0,4) -- (7,4);
\draw[gray, thick] (0,5) -- (7,5);
\draw[gray, thick] (0,6) -- (7,6);
\draw[black, thick] (0,0) -- (7,6);
\filldraw[black] (0,0) circle (2pt) node[anchor=east] {0};
\filldraw[black] (0,2) circle (2pt) node[anchor=east] {C};
\filldraw[black] (7,0) circle (2pt) node[anchor=west] {R};
\filldraw[black] (0,6) circle (2pt) node[anchor=east] {2};
\filldraw[black] (7,6) circle (2pt) node[anchor=west] {N};
\end{tikzpicture}
\end{document}
No estoy seguro de los puntos intermedios. Si fuera yo, podría haberlo creado como una figura de PowerPoint y exportarlo como pdf. Para obtener más información sobre el paquete tikz, consulte esta documentación:
https://www.overleaf.com/learn/latex/TikZ_package
Estoy bastante seguro de que puedes crear flechas y anotaciones de ecuaciones usando comandos similares, siempre que conozcas las posiciones deseadas en la página.
Respuesta3
Considere asymptote
como una opción.
// tab-numt.asy
//
// run
// asy tab-numt.asy
//
// to get a standalone pdf picture
// tab-numt.pdf
//
settings.tex="pdflatex";
size(9cm);
pen linePen=darkblue+0.7bp, grayPen=gray(0.3)+0.7bp;
arrowbar arr=Arrows(HookHead,size=2);
int n=3, m=2, p=2*n+1, q=2*m+1;
guide hLine[], vLine[];
for(int i=0;i<=q;++i)hLine[i]=(0,i)--(p,i);
for(int i=0;i<=p;++i)vLine[i]=(i,0)--(i,q);
pair N=(p,q), O=(0,0), Q=(0,q), R=(p,0),
A=((p-1)/2,0), C=(0,(q-1)/2), B=(A.x,C.y),
M=intersectionpoint(O--N,vLine[(p-1)#2]),
P=intersectionpoint(O--N,hLine[(q-1)#2]),
Z=(B+P+M)/3
;
pair[] pos={N,O,Q,R,A,B,C,P,M}; string name="NOQRABCPM";
draw(hLine,linePen); draw(vLine,linePen);
draw(O--N,linePen);
pair dx=(0.62,0), dy=(0,0.5);
draw((O-dy)--(A-dy),grayPen,arr); label("$\frac{p-1}2$",(O+A)/2-dy,UnFill);
draw((O-2dy)--(R-2dy),grayPen,arr); label("$p$",(O+R)/2-2dy,UnFill);
draw((O-dx)--(C-dx),grayPen,arr); label("$\frac{q-1}2$",(O+C)/2-dx,UnFill);
draw((N+dx)--(R+dx),grayPen,arr); label("$q$",(N+R)/2+dx,UnFill);
dot(pos[4:9],UnFill);
for(int i=0;i<7;++i) label("$"+substr(name,i,1)+"$",pos[i],unit(pos[i]-Z));
label("$M$",M,plain.NW); label("$P$",P,plain.S);
Respuesta4
una solución de tkz-euclide
\documentclass[12pt]{article}
% \usepackage{amsmath}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}
%the grid
\tkzInit[xmin=0,xmax=7,ymin=0,ymax=5]
\tkzGrid
%the axes
% \tkzDrawX[label={}]
% \tkzDrawY[label={}]
%draw the points O, R, 2, N, A, C
\tkzDefPoints{0/0/O,7/0/R,0/5/2,7/5/N,3/0/A,0/2/C}
\tkzDrawPoints(O,R,2,N,A,C)
\tkzLabelPoints(O,R,N,A)
\tkzLabelPoints[left](2)
\tkzLabelPoints[left,yshift=6pt](C)
%segment ON
\tkzDrawSegment[](O,N)
%calculate intersections for point P, M, B
\tkzDefShiftPoint[C](0:7){Xc}
\tkzDefLine(C,Xc)
% \tkzDrawLine(C,Xc)%
\tkzDefShiftPoint[A](90:5){Xa}
\tkzDefLine(A,Xa)
% \tkzDrawLine(A,Xa)
\tkzInterLL(A,Xa)(C,Xc)\tkzGetPoint{B}
\tkzDrawPoint[red](B)
\tkzLabelPoints[,font=\tiny](B)
\tkzInterLL(O,N)(C,Xc)\tkzGetPoint{P}
\tkzDrawPoint[green](P)
\tkzLabelPoints[above left,font=\tiny](P)
\tkzInterLL(O,N)(A,Xa)\tkzGetPoint{M}
\tkzDrawPoint[blue](M)
\tkzLabelPoints[above,font=\tiny, xshift=-4pt](M)
%some labels
\tkzDrawSegment[dim={$g$,-20pt,above=0pt,font=\tiny}](R,N)
\tkzDrawSegment[dim={$P$,-30pt,above=-3pt,font=\tiny}](O,R)
\tkzDrawSegment[dim={$(P-1)/2$,-15pt,above=-3pt,font=\tiny}](O,A)
\tkzDrawSegment[dim={$(g-1)/2$,15pt,above=0pt,font=\tiny}](O,C)
\end{tikzpicture}
\end{document}