Text Formattingresume formatting

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
jhapk
Posts: 81
Joined: Tue Apr 20, 2010 9:33 pm

resume formatting

Post by jhapk »

Hi,

I have defined a macro near the beginning of my document like this

Code: Select all

\newcommand{\ta}[3]{
\begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}r}
  \textbf{#1} & \\ 
  #2 & #3\\
\end{tabular*}\vspace{3pt}
}
and I am using it later in the document like this

Code: Select all

%%
\ta{Teaching Assistant for Scientific Computing (AER336F) course}
{University of Toronto}{Sept 2006 - Dec 2006}
%%
\ta{Teaching Assistant for Numerical Methods (AER334F) course}
{University of Toronto}{Sept 2007 - Dec 2007 and Sept 2008 - Dec 2008}
%%
\ta{Teaching Assistant for Combustion Processes (AER 315F) course}
{University of Toronto}{Sept 2009 - Dec 2009 and Sept 2010 - Dec 2010}
My output looks like this
section.png
section.png (34.35 KiB) Viewed 4221 times
Any ideas why is the text not aligned with the others?

Thanks
Last edited by jhapk on Fri Oct 22, 2010 8:25 am, edited 3 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

resume formatting

Post by gmedina »

Hi,

the problem comes from the contents of the table surpassing the total text width; you can solve the problem by using a \multicolumn command for the first row and by enlarging the text width (using, for example, the geometry package), and/or by reducing the font size:

Code: Select all

\documentclass[11pt,twoside]{article}
\usepackage[margin=2cm]{geometry}

\newcommand{\ta}[3]{%
  \noindent\begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}r}
  \multicolumn{2}{l}{\textbf{#1}} \\ 
  #2 & #3\\
  \end{tabular*}\vspace{3pt}
}

\begin{document}

%%
\ta{Teaching Assistant for Scientific Computing (AER336F) course}
{University of Toronto}{Sept 2006 - Dec 2006}
%%
\ta{Teaching Assistant for Numerical Methods (AER334F) course}
{University of Toronto}{Sept 2007 - Dec 2007 and Sept 2008 - Dec 2008}
%%
\ta{Teaching Assistant for Combustion Processes (AER 315F) course}
{University of Toronto}{Sept 2009 - Dec 2009 and Sept 2010 - Dec 2010}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
jhapk
Posts: 81
Joined: Tue Apr 20, 2010 9:33 pm

Re: resume formatting

Post by jhapk »

That worked. Thanks!!
jhapk
Posts: 81
Joined: Tue Apr 20, 2010 9:33 pm

resume formatting

Post by jhapk »

A follow up question. I am using \raggedright command for some other formatting purposes. However, the following code,

Code: Select all

\documentclass{minimal}
\raggedright

\newcommand{\publication}[5]{{$\bullet~$#1, #2, \textit{#3}, #4,
#5}\newline}

\begin{document}

\publication{Name of author 1}{Name of author 2}{Evaluation of
Flame-Prolongation of ILDM and Flamelet Tabulated Chemistry Approaches
for Laminar Flames}{Accepted for presentation at the such and such
meeting at such and such place in such and such country}{and this is
the date}
%%
\publication{Name of author 1}{Name of author 2}{Evaluation of
Flame-Prolongation of ILDM and Flamelet Tabulated Chemistry Approaches
for Laminar Flames}{Accepted for presentation at the such and such
meeting at such and such place in such and such country}{and this is
the date}

\end{document}

gives me the following output
publication.png
publication.png (55.48 KiB) Viewed 4213 times
The text is not aligned to the right margin. Any ideas how can I keep make it aligned while keeping the \raggedright line in the header at the same time.

Thanks
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

resume formatting

Post by gmedina »

I think I don't understand your intent here. Do you want to suppress hyphenation only for the first line of the environment? If so, you could do something like this (with the help of babel):

Code: Select all

\documentclass{minimal}
\usepackage[english]{babel}

\newcommand{\publication}[5]{{$\bullet~$#1, #2, \begin{hyphenrules}{nohyphenation}\textit{#3}\end{hyphenrules}, #4,
#5}\newline}

\begin{document}

\publication{Name of author 1}{Name of author 2}{Evaluation of
Flame-Prolongation of ILDM and Flamelet Tabulated Chemistry Approaches
for Laminar Flames}{Accepted for presentation at the such and such
meeting at such and such place in such and such country}{and this is
the date}
%%
\publication{Name of author 1}{Name of author 2}{Evaluation of
Flame-Prolongation of ILDM and Flamelet Tabulated Chemistry Approaches
for Laminar Flames}{Accepted for presentation at the such and such
meeting at such and such place in such and such country}{and this is
the date}

\end{document}
If your goal is different, then please describe it in more detail.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
jhapk
Posts: 81
Joined: Tue Apr 20, 2010 9:33 pm

resume formatting

Post by jhapk »

Hi,

that didn't work. I basically want the text to look like
format1.png
format1.png (47.95 KiB) Viewed 4208 times
and not like
format2.png
format2.png (45.77 KiB) Viewed 4208 times
without removing the \raggedright in the header. Is it possible?

Thanks
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

resume formatting

Post by frabjous »

jhapk wrote:Hi,

...without removing the \raggedright in the header. Is it possible?

Thanks
There is no "header" in your sample document, so it's unclear what you're trying to do. Headers don't usually have line breaks. Did you mean "heading"? There's no heading in your sample document either, but usually there are other, better ways of dealing with headings.

You should know however that you can limit the scope of the application of \raggedright either by using the environment instead (or applying inside the scope of braces):

Code: Select all

\begin{raggedright}
Some ragged right stuff.
\end{raggedright}

Stuff which isn't.
jhapk
Posts: 81
Joined: Tue Apr 20, 2010 9:33 pm

Re: resume formatting

Post by jhapk »

That was a simple solution :) I should have thought about that.
Thanks!!
Post Reply