Why is this particular boxed (tcolorbox) environment overrides the indentation of enumerate when inside proof; mismatching hyperref numbering and custom counter

This page summarizes the projects mentioned and recommended in the original post on /r/LaTeX

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • tcolorbox

    A LaTeX package to create highly customizable colored boxes.

  • \documentclass[a4paper]{article} \usepackage{amsthm,enumitem,lipsum,hyperref} % the proof environment % ==== Disable default indentation, and set line spacing ==== % \usepackage{parskip} \setlength{\parskip}{16pt} % https://tex.stackexchange.com/questions/375889/adjusting-space-between-paragraphs/375890#375890 % ==== Remark Box ==== % https://tex.stackexchange.com/questions/21227/example-environment/265697#265697 % https://tex.stackexchange.com/questions/36278/box-around-theorem-statement/175032#175032 \usepackage[many]{tcolorbox} % uses PGF underneath for color parameters, https://youtu.be/pcIzeN46ETc?t=256 %\tcbsetforeverylayer{autoparskip} % https://github.com/T-F-S/tcolorbox/issues/115#issuecomment-699821376, https://githubmemory.com/repo/T-F-S/tcolorbox/issues/121 \colorlet{colexam}{red!55!black} % Global example color \newtcolorbox[ auto counter, number within=subsection, number format=\arabic, ]{remarkbox}[1][]{% empty,% Empty previously set parameters title={{\bf Remark\ \thetcbcounter:} }, attach boxed title to top left, minipage boxed title, boxed title style={ empty, size=minimal, toprule=0pt, top=4pt, left=3mm, overlay={} }, coltitle=colexam, before=\par\medskip\noindent,parbox=false,boxsep=0pt,left=3mm,right=0mm,top=2pt,breakable,pad at break=0mm, before upper=\csname @totalleftmargin\endcsname0pt, % Use instead of parbox=true. This ensures parskip is inherited by box. % Handles box when it exists on one page only overlay unbroken={ \draw[colexam,line width=.5pt] ([xshift=-0pt]title.north west) -- ([xshift=-0pt]frame.south west); }, % Handles multipage box: first page overlay first={ \draw[colexam,line width=.5pt] ([xshift=-0pt]title.north west) -- ([xshift=-0pt]frame.south west); }, % Handles multipage box: middle page overlay middle={ \draw[colexam,line width=.5pt] ([xshift=-0pt]frame.north west) -- ([xshift=-0pt]frame.south west); }, % Handles multipage box: last page overlay last={ \draw[colexam,line width=.5pt] ([xshift=-0pt]frame.north west) -- ([xshift=-0pt]frame.south west); },% #1% Bring in the optional params (labels) } \NewDocumentCommand{\remark}{ m +m }{ \begin{remarkbox}[label={#1}] #2 \end{remarkbox} } \begin{document} \section{Examples} \subsection{Mismatching Numbering between Counter and Ref}\label{sec:subsec0} \remark{remark0}{ \lipsum[1][1] } \begin{remarkbox}[label={remark1}] \lipsum[1][1] \end{remarkbox} \subsubsection{Under Subsubsection} \begin{remarkbox}[label={remark2}] \lipsum[1][1] \end{remarkbox} But when reference them using the hyperref package, the labeling of Remarks \ref{remark0}, \ref{remark1}, and \ref{remark2} are different from the remark counter (although when inside a subsubsection, the situation is slightly better). \subsection{Wrong Indentation Inside the Proof Environment} Calling the Remark environment also causes the wrong indentations of enumerate when inside the proof environment of the amsthm package (if there is Remark(s) above): \begin{proof} \lipsum[1][1] \begin{enumerate}[label=Case \arabic*.] \item \lipsum[1][1] \item \lipsum[1][1] \begin{enumerate}[label=Step \arabic*.] \item \lipsum[1][1] \item \lipsum[1][1] \end{enumerate} \lipsum[1][1] \end{enumerate} \lipsum[1][1] \end{proof} \subsection{Outside the Proof environment: } In contrast, when outside the proof environment or if I remove Section \ref{sec:subsec0}, everything is all good again: \lipsum[1][1] \begin{enumerate}[label=Case \arabic*.] \item \lipsum[1][1] \item \lipsum[1][1] \begin{enumerate}[label=Step \arabic*.] \item \lipsum[1][1] \item \lipsum[1][1] \end{enumerate} \lipsum[1][1] \end{enumerate} \lipsum[1][1] \end{document}

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • How to improve the RISC-V specification

    9 projects | news.ycombinator.com | 28 Apr 2024
  • The Improved RISC-V Specification (latest WIP draft)

    1 project | news.ycombinator.com | 28 Apr 2024
  • Wikipedia of Algebraic Geometry Will Forever Be Incomplete. (2022)

    6 projects | news.ycombinator.com | 14 Apr 2024
  • I do (and don't) prepare a talk for a tech conference. (2022)

    1 project | news.ycombinator.com | 14 Apr 2024
  • Commonhaus Foundation: open-source innovation, collaboration, and sustainability

    1 project | news.ycombinator.com | 9 Apr 2024