
A través de un consejo en este sitio, utilicé el paquete mdframed
para obtener una bonita caja redondeada. Pero me gustaría incluirlo en el titling
paquete.
El siguiente ejemplo mínimo muestra mdframed
cómo funciona correctamente más adelante en el documento. También muestra titling
que funciona, ya que \thedate
y \thetitle
están disponibles después de \maketitle
, que es una de sus funciones útiles. Y he incluido el flushright
entorno con el que funciona titling
. Pero el mdframed
entorno provoca errores.
\documentclass{scrartcl}
\usepackage{lipsum}
\usepackage{titling}
\usepackage[framemethod=TikZ]{mdframed}
\title{My document's title}
\author{Jonathan Clark}
\date{10 May 2014}
% \pretitle{\begin{mdframed}[roundcorner=10pt]\LARGE\bfseries} % doesn't work
\pretitle{\LARGE\bfseries} % but without mdframed it works
\posttitle{}
\preauthor{\begin{flushright}\scshape}
\postauthor{\end{flushright}}
\predate{\large}
% \postdate{\end{mdframed}} % doesn't work
\postdate{\end{mdframed}} % but without mdframed it worsk
\begin{document}
\maketitle
\begin{mdframed}[roundcorner=10pt]
Date: \thedate. Title: \thetitle.
\end{mdframed}
\lipsum{1}
\end{document}
Creo que estoy ejecutando la última versión de todos los paquetes a través de TeX Live en OS X.
Respuesta1
Supongo que lo que quieres es algo como lo siguiente. Utilicé el etoolbox
paquete, y más específicamente, \pretocmd
y \apptocmd
lo envolví \maketitle
en el mdframed
entorno:
\documentclass[x11names]{scrartcl}
\usepackage{lipsum}
\usepackage{titling}
\usepackage{fourier}
\usepackage{heuristica}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{etoolbox}
\title{My document's title}
\author{Jonathan Clark}
\date{10 May 2014}
\pretitle{\LARGE\bfseries}
\posttitle{}
\preauthor{\begin{flushright}\scshape}
\postauthor{\end{flushright}}
\predate{\large}
\postdate{}
\pretocmd{\maketitle}{\mdfsetup{roundcorner = 10pt,linewidth = 2pt, linecolor = Red3}\begin{mdframed}}{}{}
\apptocmd{\maketitle}{\end{mdframed}\bigskip}{}{}
\begin{document}
\maketitle
\lipsum{1}
\end{document}