Math & ScienceHaving trouble using titlesec with math functions

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
JBClaypool
Posts: 10
Joined: Fri Jul 31, 2020 6:11 pm

Having trouble using titlesec with math functions

Post by JBClaypool »

This is mart of what I'm trying to do, but I get 4 errors, and 4 "bad box" errors. What am I missing?

I'm using class ARTICLE, ans packages ASMATH and TITLESEC. (this code example can be seen on page 12 of the redme.pdf in titlesec's documentation.

\newcommand{\secmark}{}
\newenvironment{advanced}
{\renewcommand{\secmark}{*}}
{..}
\titleformat{\section}
{..}
{\thesection\secmark\quad}{..}{..}

\begin{document}
\begin{advanced}
\section{one,two,three} %%%%%%%%%%%%%%% This is the First Math program example. Basics.
This formula $f(x) = x^2$ is an example.\\
\end{advanced}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
JBClaypool
Posts: 10
Joined: Fri Jul 31, 2020 6:11 pm

Having trouble using titlesec with math functions

Post by JBClaypool »

figured it out. Unless I'm missing a particular \usepackage, "titlesec.pdf" didn't properly address the \titleformat parameters correctly.

Here's theres:
%\titleformat{\section}
%{..}
%{\thesection\secmark\quad}
%{..}
%{..}

This is what I did to make it work:
\titleformat{\section}
{\normalsize}
{\thesection\secmark\quad}
{0pt}
{..}
{}
Post Reply