Page LayoutDifficulty with title page and logo

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Difficulty with title page and logo

Post by Cham »

I'm still unable to get the tabular right :

Code: Select all

Code, edit and compile here:
\documentclass[12pt,letterpaper,twoside]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage{textcomp}
\usepackage[dvipsnames,table]{xcolor}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{mdframed}
\usepackage[]{hyperref}
\begin{document}
\begin{titlepage}
\begin{mdframed}[
linecolor=gray,
backgroundcolor=gray!10,
linewidth=3pt,
leftmargin=0cm,
rightmargin=0cm,
topline=true,
bottomline=true,
leftline=false,
rightline=false
]
\small{
\begin{tabular}{l@{\hspace{3em}}p{0.3\textwidth}c@{\hspace{3em}}p{0.3\textwidth}}
\textsf{Professeur} & \textsf{Local} & \textsf{Poste téléphonique} \\[12pt]
\hline \\
\textsf{\textbf{John Doe}} & \textsf{C3510} & \textsf{(514) 389-5921-3550} \\
\rlap{\href{mailto:john.doe@collegeahuntsic.qc.ca}{\texttt{john.doe@collegeahuntsic.qc.ca}}} \\[12pt]
\textsf{\textbf{Bozo the Clown}} & \textsf{C3910} & \textsf{(514) 389-5921-3630} \\
\rlap{\href{mailto:bozo.theclown@collegeahuntsic.qc.ca}{\texttt{bozo.theclown@collegeahuntsic.qc.ca}}} \\[12pt]
\textsf{\textbf{Snow White}} & \textsf{C4010} & \textsf{(514) 389-5921-4050} \\
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Preview :
tabular.jpg
tabular.jpg (25.79 KiB) Viewed 4996 times
The second column should be centered inside the gray rectangle, and the third column should be shufled to the right, with all items centered under the "Poste téléphonique".

Why is it so complicated ? I don't understand how the tabular parameters are working. It just don't make any sense to me. I hate Word, but at least it's much easier to use.

And the horizontal line is terrible. It should look like this (the table below was made "by hand", using the tabto package, and the horizontal line was defined with \medskip \hrule \medskip\medskip, which doesn't work inside the tabular environment) :
not_tabular.jpg
not_tabular.jpg (24.22 KiB) Viewed 4996 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Difficulty with title page and logo

Post by Cham »

Another question :

In the following table, how do I distribute the second column on the whole page width ? And currently the third line is chopped on the right. It should be a full paragraph inside the table.

Code: Select all

Code, edit and compile here:
\documentclass[12pt,letterpaper,twoside]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage{textcomp}
\usepackage[dvipsnames,table]{xcolor}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{mdframed}
\usepackage[]{hyperref}
\begin{document}
\begin{titlepage}
\begin{tabular}{ll}
\textsf{\textbf{Numéro du cours :}} & \textsf{203-NYC-05} \\[12pt]
\textsf{\textbf{Pondération :}} & \textsf{3-2-3} \\[12pt]
\textsf{\textbf{Compétence visée :}} & \textsf{00UT - Analyser différentes situations ou phénomènes physiques reliés aux ondes, à l'optique et à la physique moderne à partir de principes fondamentaux.} \\[12pt]
\textsf{\textbf{Programme :}} & \textsf{Sciences de la nature (200.BO)} \\[12pt]
\textsf{\textbf{Département :}} & \textsf{Physique} \\
& \textsf{\emph{Une phrase idiote à écrire.}} \\[12pt]
\textsf{\textbf{Session :}} & \textsf{Hiver 2052} \\[12pt]
\textsf{\textbf{Préalable :}} & \textsf{Mécanique (203-NYA-05)}
\end{tabular} \\[12pt]
\begin{mdframed}[
linecolor=gray,
backgroundcolor=gray!10,
linewidth=3pt,
leftmargin=0cm,
rightmargin=0cm,
topline=true,
bottomline=true,
leftline=false,
rightline=false
]
\small{
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
And yet again, I'm unable to properly format the second table.

Preview :
table.jpg
table.jpg (105.25 KiB) Viewed 4993 times
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Difficulty with title page and logo

Post by Johannes_B »

The reason i didn't go into further detail concerning the logo is, i don't know what you mean.
Please load the option showframe for package geometry. Your logo picture is on the margins of the textblock.


The table will only use the amount of space it needs. in your case, you can use tabularx to give a fixed width or use hard-coded p-columns (paragraphs of a given width) and additional spaces between the columns using the @ notation. In your example, you are defining 4 columns but are using only 3.


Btw, right now it sounds as if you should read some basic introductory material.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Difficulty with title page and logo

Post by Cham »

Johannes_B wrote:The reason i didn't go into further detail concerning the logo is, i don't know what you mean.
Please load the option showframe for package geometry. Your logo picture is on the margins of the textblock.


The table will only use the amount of space it needs. in your case, you can use tabularx to give a fixed width or use hard-coded p-columns (paragraphs of a given width) and additional spaces between the columns using the @ notation. In your example, you are defining 4 columns but are using only 3.
I just need the top part of the logo to touch the top page margin.


Please, could you give an example of the tabularx environment with three colums ? I really don't understand how the parameters are working.

The first column should be left aligned, while the second and third columns should be centered. The whole table should spend the text width (inside the gray box from mdframed). The picture below shows approximately what I try to achieve (this was made by eye only) :
table.jpg
table.jpg (35.77 KiB) Viewed 4990 times
The blue arrows are showing the spacing problems. The second and third columns aren't centered under their title. The horizontal rule doesn't have a proper balanced spacing above and under it.

And the second column should be closer to the third column.
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Difficulty with title page and logo

Post by Cham »

This is the code I'm now trying to fix.

The logo was placed by eye, so its top edge *apparently* touches the top margin.
Is there a better way to achieve this ?

The first table appears to be okay.

The last table need three fixes :

1. The second column should be closer to the last column.
2. "Local" and "Poste téléphonique" should be centered on top of their content.
3. The horizontal rule need a better (symetrical) spacing above and under it.

Code: Select all

Code, edit and compile here:
\documentclass[12pt,letterpaper,twoside]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{lmodern}
\usepackage{textcomp}
\usepackage[dvipsnames,table]{xcolor}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{mdframed}
\definecolor{urlc}{RGB}{200,0,0}
\usepackage[unicode,colorlinks,urlcolor=urlc]{hyperref}
\usepackage{showframe}
\usepackage{mwe}
\begin{document}
\begin{titlepage}
\flushleft{\vspace{-0.3in}\includegraphics[height=0.6in]{example-image-a}}
\vspace*{\fill}
\begin{mdframed}[
linecolor=gray,
backgroundcolor=gray!10,
linewidth=3pt,
leftmargin=0cm,
rightmargin=0cm,
topline=true,
bottomline=true,
leftline=false,
rightline=false
]
\center{\textsf{\Large PLAN DE COURS}} \\[18pt]
\center{\textbf{\textsf{\Large Ondes et physique moderne}}} \\[12pt]
\end{mdframed}
\medskip\medskip
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
alainremillard
Posts: 45
Joined: Fri Mar 16, 2012 8:22 pm

Difficulty with title page and logo

Post by alainremillard »

Great work so far. I'm happy to see that latex is slowly growing in different Cégep in Québec. 8-)

Here is my two cents.

First of all, every piece of text is within a \textsf{}. You could define it globaly by putting \sffamily inside the titlepage environment. It will clean your code and it scope will be limited to the titlepage environment.
Cham wrote: The logo was placed by eye, so its top edge *apparently* touches the top margin.
Is there a better way to achieve this ?
The space was created by the indent. Your image start a new paragraph and this paragraph have an indent. The \flushleft command solve your problem, the \vspace{-0.3in} is useless.
Cham wrote: The first table appears to be okay.
You could improve it with the tabularx package. The x column type allows to use the rest of the line. Thus your compétence text will go all the way to the margin.

Code: Select all

Code, edit and compile here:
\begin{tabularx}{\linewidth}{l@{\hspace{1em}}Xl}
\textbf{Numéro du cours :} & 203-NYC-05 \\[12pt]
\textbf{Pondération :} & 3-2-3 \\[12pt]
\textbf{Compétence visée :} & 00UT - Analyser différentes situations ou phénomènes physiques reliés aux ondes, à l'optique et à la physique moderne à partir de principes fondamentaux. \\[12pt]
\textbf{Programme :} & Sciences de la nature (200.BO) \\[12pt]
\textbf{Département :} & Physique \\
& \emph{Une phrase idiote à écrire.} \\[12pt]
\textbf{Session :} & Hiver 2052 \\[12pt]
\textbf{Préalable :} & Mécanique (203-NYA-05)
\end{tabularx}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Cham wrote: 1. The second column should be closer to the last column.
Define a different \extracolsep between each column.
Cham wrote: 2. "Local" and "Poste téléphonique" should be centered on top of their content.
Use a c column type.
Cham wrote: 3. The horizontal rule need a better (symetrical) spacing above and under it.
This is cause by the \\[6pt]. To balance things , you could use a rule of 0pt width \rule[depth]{width}{height}. It wont appear and wont disrupt things. Placing \rule{0pt}{20pt} before John Doe will solve it. The 20pt might need to be adjusted.

Here is the complete modified code

Code: Select all

Code, edit and compile here:
\documentclass[12pt,letterpaper,twoside]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{lmodern}
\usepackage{textcomp}
\usepackage[dvipsnames,table]{xcolor}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{mdframed}
\definecolor{urlc}{RGB}{200,0,0}
\usepackage[unicode,colorlinks,urlcolor=urlc]{hyperref}
\usepackage{showframe}
\usepackage{mwe}
\usepackage{tabularx}
\begin{document}
\begin{titlepage}\sffamily
\flushleft{\vspace{-0.3in}\includegraphics[height=0.6in]{example-image-a}}
\vspace*{\fill}
\begin{mdframed}[
linecolor=gray,
backgroundcolor=gray!10,
linewidth=3pt,
leftmargin=0cm,
rightmargin=0cm,
topline=true,
bottomline=true,
leftline=false,
rightline=false
]
\center{\Large PLAN DE COURS} \\[18pt]
\center{\textbf{\Large Ondes et physique moderne}} \\[12pt]
\end{mdframed}
\medskip\medskip
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
One last comment, to avoid inconsistency between different plan de cours, your last table could use a p{width} column for the name (leaving out the extracolsep between the first and second column). Thus a plan de cours from class given only by Louis Cyr or one from a class given only by Apu Nahasapeemapetilon will have the "local" and "poste téléphonique" at exactly the same position.

Sorry for the long post and have a nice day
Alain Rémillard
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Difficulty with title page and logo

Post by Cham »

Thanks a lot for the reply !

About the logo, it is too low without the \vspace{-0.3in}, even with the flushleft command. So I don't see how I could get rid of the \vspace{-0.3in} command.

I'll take a look at your other suggestions later, but I aready improved a lot the code with some other "tricks".

More later...
Post Reply