0

I was looking for a good way to define your own section from the inside of the class rather than with packages, e.g. titelsec. I looked up for the definition of chapters and sections in LaTeX standard classes and I found this (there are also for part, chapter, subsections...)

 \newcommand\section{\@startsection {section}{1}{\z@}%
   {-3.5ex \@plus -1ex \@minus -.2ex}%
   {2.3ex \@plus.2ex}%
   {\normalfont\Large\bfseries}}

Now, what I would like would be to have the same structure and the same commands of the original definition but with my own kind of section, which in my case would have no number (in the definition of section there are no indications about the counter) and possibly I would like to achieve that this section is inside the command \twocolumn[{}], so that when I tipe

    \newcommand{\MYTITLECOMMAND}{
        \twocolumn[{
            \@startsection{NO_NUMBERS_ON_MYTITLES}{3}
                {\z@}{2.5ex \@plus .5ex \@minus 1ex}{5\p@}
                {\Huge}
         }]
     }

the output is on the fill pagewidth and not on just a column (I'm using \documentclass[twocolumn]{article} class).

2
  • 1
    you are missing the arguments to \@startsection that supply the title so I'm surprised you get output at all rather than an error? Please provide a full small example that people can run to debug and see the issue. Jun 6, 2018 at 21:03
  • No, don't get me wrong, it's just a sample of the output I need, not something that I realised, as it did not compile ;-)
    – GiuTeX
    Jun 6, 2018 at 21:06

1 Answer 1

2

Since \twocolumn always starts a new page and puts its [] argument in a box, almost all of what \@startsection does internally is not relevant, you could simply do

\newcommand{\MYTITLECOMMAND}[1]{%
    \twocolumn[\textbf\Huge\raggedright #1]}

possibly with some vertical space, depending on the desired style.

You must log in to answer this question.

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