1

I was trying to make changes to a template but was running into an issue. You see, it seems the first character (Chinese) was always missing from the first line under the {defn} line.(Like this picture as below) enter image description here

Here is my code :

\documentclass[twoside]{article}
\usepackage[paperwidth=210mm, paperheight=297mm, margin=2cm]{geometry}
\usepackage[utf8]{inputenc}
%==Theorems==
\usepackage{tcolorbox}
\tcbuselibrary{skins,breakable,theorems}
\usepackage{changepage}
\newcounter{cnt}
\setcounter{cnt}{\thesection}
\makeatletter     
\parindent 0in
\parskip 1pt
\geometry{margin=1in, headsep=0.25in}
\setlength{\headheight}{14.39996pt}
% Definition
\newtcbtheorem[use counter=cnt, number within=section]{defn}{Definition}
    {theorem style=theorem wide name and number,breakable,enhanced,arc=0mm,outer arc=0mm,
    boxrule=0pt,toprule=1pt,leftrule=0pt,bottomrule=1pt, rightrule=0pt,left=0.2cm,right=0.2cm,
    titlerule=0.5em,toptitle=0.1cm,bottomtitle=-0.1cm,top=0.2cm,
    colframe=white!10!coral,colback=white!75!pink,coltitle=white, coltext=bourguignon!80!coral,
    title style={white!10!coral}, before skip=8pt, after skip=8pt,
    fonttitle=\bfseries,fontupper=\normalsize}{defn}
1
  • 1
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Nov 25, 2023 at 9:36

1 Answer 1

1

I reformatted the code, commented out the cnt business that serves no purpose, unless you need the definition to share the counter with other environments. I commented out also the color choices as I don't want to guess them. What the

theorem wide name and number

style is I don't know and there's no trace thereof in the tcolorbox manual.

You're neglecting the fact that defn requires two arguments: one is the title and the other one is a label for cross-references.

\documentclass[twoside]{article}
\usepackage[paperwidth=210mm, paperheight=297mm, margin=2cm]{geometry}
\usepackage{tcolorbox}
\tcbuselibrary{skins,breakable,theorems}

%\newcounter{cnt}
% Definition
\newtcbtheorem[
%  use counter=cnt,
  number within=section
]{defn}{Definition}{
  %theorem style=theorem wide name and number, % <-- ???
  breakable,
  enhanced,
  arc=0mm,
  outer arc=0mm,
  boxrule=0pt,
  toprule=1pt,
  leftrule=0pt,
  bottomrule=1pt,
  rightrule=0pt,
  left=0.2cm,
  right=0.2cm,
  titlerule=0.5em,
  toptitle=0.1cm,
  bottomtitle=-0.1cm,
  top=0.2cm,
  %colframe=white!10!coral,
  %colback=white!75!pink,
  coltitle=white,
  %coltext=bourguignon!80!coral,
  %title style={white!10!coral},
  before skip=8pt,
  after skip=8pt,
  fonttitle=\bfseries,
  fontupper=\normalsize
}{defn}

\begin{document}

\begin{defn}{Something}
XYZ
\end{defn}

\begin{defn}{Something}{}
XYZ
\end{defn}

\begin{defn}{Something}{AAAAAA}
XYZ
\end{defn}

\ref{defn:AAAAAA}

\end{document}

enter image description here

As you see, the first example misses the second argument and so the first following object is taken for it.

1
  • It works! Thank you !!
    – ToadetteK
    Commented Nov 25, 2023 at 13:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .