LaTeX Question (formating section headings)

  • Context: LaTeX 
  • Thread starter Thread starter Metazeno
  • Start date Start date
  • Tags Tags
    Latex Section
Click For Summary
SUMMARY

The discussion centers on formatting section headings in a LaTeX document to create a two-column layout, with section headings on the left and text on the right. The user attempted to create a custom command using dimensions and horizontal boxes but encountered issues with the positioning of the section headings. A recommendation was made to use a table as a workaround, while the user expressed a desire to eventually develop a custom class file (.cls) for better integration.

PREREQUISITES
  • Familiarity with LaTeX document structure and commands
  • Understanding of LaTeX dimensions and box commands
  • Basic knowledge of creating custom commands in LaTeX
  • Experience with LaTeX environments and class files
NEXT STEPS
  • Research LaTeX table environments for custom layouts
  • Learn about creating and using .cls files in LaTeX
  • Explore advanced LaTeX box commands for layout control
  • Investigate the use of the \newenvironment command for custom formatting
USEFUL FOR

LaTeX users, document designers, and technical writers looking to enhance document formatting and layout capabilities.

Metazeno
Messages
2
Reaction score
0
I would like to divide the body of my document into two columns. In the left column go the section headings and in the right column go the section text.

My attempt is to make a new command:
\newdimen\sectionwidth
\newdimen\resumewidth
\sectionwidth=0.25 \textwidth
\resumewidth=0.75 \textwidth
\newcommand{\ressection}[1]
{
\hbox to 0pt
{
\hss
\vtop to 0pt
{
\leftskip=0pt
\hsize=\sectionwidth
\textwidth=\sectionwidth
\raggedright
\bf
#1
\vss
}
}
\vskip-\baselineskip
}
Unfortunately this puts the section text where it would be normally and the section headings far off to the left outside the document body.

Does anyone know how to fix this?
 
Physics news on Phys.org
I'd recommend using a table instead.
 
//I'd recommend using a table instead.// I've done that for now as a quick fix (making a \newenvironment). But I would like to write my own .cls for this document eventually so it has to be more like the flow of a \newcommand.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K