Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How can I renew the section command to include some additional arguments and start a multicolum section? something like: \section{title}{toc-title}{picture}{second picture}{subtitle}{author}

I just succeeded with a new environment, but now I have to add the TOC entries manually (and sections are not displayed in TexmakerX)

here a sample:

\documentclass[9pt,twoside]{article}
\usepackage[papersize={ 32cm , 47cm }]{geometry}
\usepackage[latin]{babel}
\usepackage{ulem}
\usepackage{calc}
\usepackage{graphicx}
\usepackage{lipsum}

\usepackage{palatino,times}
\usepackage{microtype}
\usepackage{float}
\usepackage{multicol}
\usepackage{fixltx2e}
\usepackage{calc}

\newenvironment{mysection}[5]{
  %before
  \noindent
    \begin{minipage}[l]{0.6\linewidth}
    \centering
%    \includegraphics[height=40pt]{picts/pic-#3.jpg}
    \framebox{first picture}
    \par
    \textbf{#2}\par
    \rule{\linewidth-50pt}{3pt}
    \section*{#5}
    \rule{\linewidth-50pt}{3pt}
    \end{minipage}
    \hfill
    \begin{minipage}[l]{0.4\linewidth}
%    \includegraphics[width=\linewidth]{picts/pic-#4.jpg}
    \noindent\framebox(280,200){this is the main an big picture}
    \end{minipage}

  \begin{multicols}{4}
  By\textbf{ #1}
  \bigskip

}
{ %after
\end{multicols}
}

\begin{document}
\begin{mysection}{authorname}{subtitle}{pict}{anotherpict}{this is the section title}


\lipsum[1-4]

\end{mysection}

\end{document}
share|improve this question
    
While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. –  Peter Grill Aug 6 '12 at 16:22
    
@ThierryBlanc When posting a MWE, please, remove packages that are not necessary. In your MWE you just need graphicx multicol and lipsum. –  Guido Aug 6 '12 at 20:30
add comment

1 Answer

You have to add \addcontentsline{toc}{section}{#2, #5} in the definition of the mysection environment (I have included both the toc-title, #2, and the author, #5, in the text passed to the toc).

share|improve this answer
    
works perfectly! thanks. –  Thierry Blanc Aug 6 '12 at 20:01
    
@ThierryBlanc you are welcome. Since it seems that my answer solves your problem you can accept the answer (see meta.tex.stackexchange.com/questions/1852/…) –  Guido Aug 6 '12 at 20:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.