LaTeX Question (formating section headings)

In summary, the speaker is looking for a way to divide the body of their document into two columns, with section headings in the left column and section text in the right column. They have attempted to create a new command using dimensions, but it has not worked as expected. They are considering using a table as a temporary solution, but ultimately want to create their own document class.
  • #1
Metazeno
2
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
  • #2
I'd recommend using a table instead.
 
  • #3
//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.
 

1. What is LaTeX?

LaTeX is a typesetting system used for creating documents with high-quality typesetting, particularly in the fields of mathematics, science, and technical writing. It is based on the TeX typesetting language.

2. How do I format section headings in LaTeX?

To format section headings in LaTeX, you can use the commands \section{}, \subsection{}, and \subsubsection{}. These commands will automatically number your headings and format them according to the document class you are using.

3. Can I customize the formatting of section headings in LaTeX?

Yes, you can customize the formatting of section headings in LaTeX by using the \titleformat and \titlespacing commands from the titlesec package. These commands allow you to change the font, size, color, and alignment of your section headings.

4. How do I add a table of contents in LaTeX?

To add a table of contents in LaTeX, you can use the command \tableofcontents. This will automatically generate a table of contents based on the section headings in your document. You may need to compile your document multiple times for the table of contents to appear correctly.

5. Are there any resources available for learning LaTeX?

Yes, there are many resources available for learning LaTeX, including online tutorials, books, and forums. Some popular resources include the official LaTeX documentation, the LaTeX wikibook, and the LaTeX subreddit. Many universities also offer workshops or classes on using LaTeX for scientific writing.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
23
Replies
789
Views
726K
Back
Top