
Estou usando thmtools para meu modelo LaTeX. Costumo usar as caixas matemáticas numeradas. Mas agora eu queria adicionar a mesma caixa, mas sem o contexto matemático. Então eu construo isso:
\documentclas{article}
\usepackage{amsthm}
\usepackage{thmtools}
% The Box
\declaretheorem[name = , numbered = no,]{Boxname}
\newenvironment{boxname}[1][]{
\begin{Boxname}\ifblank{#1}{}{\color{black}\hspace*{-0.68em}\normalfont\textbf{#1}}\color{black}\normalfont$ $\newline
\raisebox{.2\baselineskip}{\rule{\linewidth}{0.6pt}}\newline\noindent
}{
\newline\noindent {\rule{\linewidth}{0.6pt}}
\end{Boxname}
}
\begin{document}
\begin{boxname}[Name of the Box]
some stuff
\end{boxname}
\end{document}
Meu problema: sempre há um ponto que não consigo excluir. Alguém pode me ajudar a me livrar desse ponto?
Responder1
Você deve definir um estilo específico onde remover pontuação e espaço após o título.
\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{etoolbox,xcolor}
% The Box
\declaretheoremstyle[
headpunct={},
postheadspace=0pt,
]{box}
\declaretheorem[
style=box,
name = ,
numbered = no,
]{Boxname}
\newenvironment{boxname}[1][]{%
\begin{Boxname}
\ifblank{#1}
{\mbox{}}
{\normalcolor\normalfont\textbf{#1}}%
\\
\raisebox{.2\baselineskip}{\rule{\linewidth}{0.6pt}}\\
}{%
\\\rule{\linewidth}{0.6pt}
\end{Boxname}
}
\begin{document}
\begin{boxname}[Name of the Box]
some stuff
\end{boxname}
\end{document}
Também simplifiquei o código.