Skip to content

Commit

Permalink
lcc.cls: soporte básico para referencias a ejercicios
Browse files Browse the repository at this point in the history
cf. #2 y #6
  • Loading branch information
mtzguido committed Oct 26, 2022
1 parent dc7566e commit f2da83c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lcc.cls
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ Por cualquier problema/mejora, ir a https://github.com/mtzguido/lcc.cls]
\RequirePackage{hyperref}
\RequirePackage{lastpage}
\RequirePackage[bottom]{footmisc}
\RequirePackage[nameinlink]{cleveref}

\RequirePackage[activate={true,nocompatibility},final,kerning=true,spacing=true]{microtype}

Expand Down Expand Up @@ -152,11 +153,15 @@ Por cualquier problema/mejora, ir a https://github.com/mtzguido/lcc.cls]

\newenvironment{ejercicio}[1][\unskip]
{
\stepcounter{ejercicio}
\refstepcounter{ejercicio}
\paragraph{\tagejercicio\arabic{ejercicio} #1.}
}
{}

% Para las referencias. TODO: agregar otras y verificar que esto anda bien.
\crefname{ejercicio}{ejercicio}{ejercicios}
\Crefname{ejercicio}{Ejercicio}{Ejercicios}

\newenvironment{ejemplo}[1][\unskip]
{
\paragraph{Ejemplo #1.}
Expand Down
2 changes: 2 additions & 0 deletions template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
\end{ejercicioOff}

\begin{ejercicio}
\label{ej1}
Esto es un ejercicio.
\begin{solucion}
Acá está la solución.
Expand All @@ -65,6 +66,7 @@

\begin{ejercicio}[(difícil)]
Este es un ejercicio con un tag opcional.
Se pueden agregar referencias a ejercicios anteriores: ver \Cref{ej1}.
\end{ejercicio}

\begin{ejercicio}[\unskip*]
Expand Down

0 comments on commit f2da83c

Please sign in to comment.