Add an image in background and a text zone - latex

Well I'm a newbie in latex and I want to make a latex Curriculum Vitae.
I want to create a page with two parts
First part: an image from TOP to Bottom, and from left to the middle of the page
Second part: a text zone from from TOP to Bottom, and from middle of the page to the right
I have tried to create two columns but every time one of the columnes are put on the next pages :(
Do you have any advice or tips or answer to give me?
Thank you very much for your help.

For a single-page split-view display, you can set the content in a tabularx structure. The left-hand side contains an image with no height/depth. This allows you put anything in the right-hand side.
\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{graphicx,tabularx}
\usepackage{lipsum}
\setlength{\parindent}{0pt}
\pagestyle{empty}
\begin{document}
\begin{tabularx}{\textwidth}{#{} X X #{}}
\raisebox{\dimexpr-\height+.7\normalbaselineskip}[0pt][0pt]{%
\includegraphics[width=\linewidth,height=\textheight]{example-image}} &
\lipsum[1-3]
\end{tabularx}
\end{document}
There are multiple ways of doing this. It all depends on whether you're stuck with a single page, or want to move to a bigger canvas.

Related

How to align a picture correctly in Overleaf

I want to insert an image on my text but the image always aligns on top of the text and not below as I wanted to. Does anyone know how to accomplish this?
This is the image I want to display on the bottom
\subsection{DistribuciĆ³n Normal}
all that text in spanish
\begin{figure}
\centering
\centerline{\includegraphics[width=8cm,height=8cm]{fdd.eps}}
\end{figure}
If you want to specify where the figure has to be, you have to use some options of the figure environment: for example
all that text in spanish
\begin{figure}[h]
\centering
\includegraphics[width=8cm,height=8cm]{fdd.eps}
\end{figure}
means that LaTeX will try to put the figure where you inserted the figure environment ([h]ere). Other options include
t: top
b: bottom
p: on a special page only for floating environments
You can use several options, for example
all that text in spanish
\begin{figure}[htb]
\centering
\includegraphics[width=8cm,height=8cm]{fdd.eps}
\end{figure}
LaTeX will try to put the figure following the order of the options provided: first it will try to put it [h]ere, then on the [t]op and finally, if the other two possibilities are not available, it will put the figure on the [b]ottom of the page. This strategy lets LaTeX decide the best position for the figure.
For references, see this Overleaf document.

Tables in LaTeX

I have tables which I want to set horizontally, they are too big that they don't fit with the page, either column header shift down, are doesn't fit on page, how can set them. I used long table too. What shall I do?
You can re-size the table to make it fit the page size. Like this:
\usepackage{graphicx}
\begin{table}
...
\scalebox{0.7}{ %% change it to smaller here, change to other values if needed
\begin{tabular}
...
\end{tabular}
}
\end{table}

Adding caption in LaTex without floats (tables)?

I have a few tables which are not long enough to warrant the use of \longtable, but they always start on the next page which breaks the whole flow and trying to force it with a [!h] in the table did not help. So I stopped using \tables and just have \tabular tag now which seems to have fixed the layout as there are no floats.
But the problem now is I can't get automatic captions for the Tables - any ideas how I can do this and also get auto numbering so when I use \addcontentsline it can show up in the TOC?
To use a caption outside a float environment, one needs to use \captionof which is part of package caption.
Example
\documentclass{article}
\usepackage{caption}
\begin{document}
\begin{center}
\begin{tabular}{rl}
right & left \\
right & left \\
\end{tabular}
\captionof{table}{Your caption here}
\end{center}
\end{document}
There is also a capt-of package if you are just interested in using the command \captionof.
Short answer; you need a \table for the caption. Only using \tabular + captioning is not gonna work.
bit longer
There may be a nasty work-around as people tend to create work-arounds for everything, but my base rule for most of those work-arounds is: "if latex does not provide it by itself, do not try to do it". Most of time those "fixes" will give even more text-flow problems anyway.
Now if you really want it right below the text just do a \clearpage before the table and place the table. Than the rest of the text. This will probably solve it, although it will give an empty space on the rest of your 'previous' page of course.

Making LaTeX tables smaller?

I have a LaTeX table that looks like this:
\begin{table}[!ht]
\centering
\small
\caption{
\bf{Caption}}
\begin{tabular}{l|c|c|l|c|c|c|c|c}
field1 & field 2 & ... \\
\hline
...
the problem is that even with "\small" the table is too big, since I use:
\usepackage{setspace}
\doublespacing
in the header. How can I:
Make the table single spaced? and
Make the table smaller?
I'd like it to fit on an entire page.
http://en.wikibooks.org/wiki/LaTeX/Tables#Resize_tables talks about two ways to do this.
I used:
\scalebox{0.7}{
\begin{tabular}
...
\end{tabular}
}
As well as \singlespacing mentioned previously to reduce the height of the table, a useful way to reduce the width of the table is to add \tabcolsep=0.11cm before the \begin{tabular} command and take out all the vertical lines between columns. It's amazing how much space is used up between the columns of text. You could reduce the font size to something smaller than \small but I normally wouldn't use anything smaller than \footnotesize.
if it's too long for one page, use the longtable package. and if it's too wide for the page, use p{width} in place of l,r, or c for the column specifier. you can also go smaller than \small, i.e. \footnotesize and \tiny. I would consult the setspace package for options on how to remove the double space, though it's probably \singlespace or something like that.
There is also the singlespace environment:
\begin{singlespace}
\end{singlespace}
You could add \singlespacing near the beginning of your table. See the setspace instructions for more options.
If you want a smaller table (e.g. if your table extends beyond the area that can be displayed) you can simply change:
\usepackage[paper=a4paper]{geometry} to \usepackage[paper=a3paper]{geometry}.
Note that this only helps if you don't plan on printing your table out, as it will appear way too small, then.

LaTeX table positioning

I have a LaTeX document that contains a paragraph followed by 4 tables followed by a second paragraph. I want the 4 tables to appear between the two paragraphs which from what I've read means I should use the [h] option after beginning the table environment (e.g. \begin{table}[h]).
Using this the first two tables appear after paragraph 1 as expected, however paragraph 2 is then displayed with the last two tables appearing on the following page. How can I get the tables to appear in the correct location?
I've tried various things to correct the positioning such as using [h!] however this doesn't seem to have any effect. Using \clearpage after the tables does have the desired effect of making the tables appear before the second paragraph but it then leaves the last two tables on their own page with loads of white-space, when I would prefer to have the second paragraph begin immediately after the tables.
Paragraph 1...
\begin{table}[h]
table1...
\end{table}
\begin{table}[h]
table2...
\end{table}[h]
...
Paragraph 2...
After doing some more googling I came across the float package which lets you prevent LaTeX from repositioning the tables.
In the preamble:
\usepackage{float}
Then for each table you can use the H placement option (e.g. \begin{table}[H]) to make sure it doesn't get repositioned.
Table Positioning
Available Parameters
A table can easily be placed with the following parameters:
h Place the float here, i.e., approximately at the same point it occurs in the source text (however, not exactly at the spot)
t Position at the top of the page.
b Position at the bottom of the page.
p Put on a special page for floats only.
! Override internal parameters LaTeX uses for determining "good" float positions.
H Places the float at precisely the location in the LATEX code. Requires the float package. This is somewhat equivalent to h!.
If you want to make use of H (or h!) for an exact positioning, make sure you got the float package correctly set up in the preamble:
\usepackage{float}
\restylefloat{table}
Example
If you want to place the table at the same page, either at the exact place or at least at the top of the page (what fits best for the latex engine), use the parameters h and t like this:
\begin{table}[ht]
table content ...
\end{table}
Sources: Overleaf.com
At the beginning with the usepackage definitions include:
\usepackage{placeins}
And before and after add:
\FloatBarrier
\begin{table}[h]
\begin{tabular}{llll}
....
\end{tabular}
\end{table}
\FloatBarrier
This places the table exactly where you want in the text.
Here's an easy solution, from Wikibooks:
The placeins package provides the command \FloatBarrier, which can be used to prevent floats from being moved over it.
I just put \FloatBarrier before and after every table.
What happens if the text plus tables plus text doesn't fit onto a single page? By trying to force the typesetting in this way, you are very likely to end up with pages that run too short; i.e., because a table cannot by default break over a page it will be pushed to the next, and leave a gap on the page before. You'll notice that you never see this in a published book.
The floating behaviour is a Good Thing! I recommend using [htbp] as the default setting for all tables and figures until your document is complete; only then should think about fine-tuning their precise placement.
P.S. Read the FAQ; most other answers here are partial combinations of advice given there.
If you want to have two tables next to each other you can use: (with float package loaded)
\begin{table}[H]
\begin{minipage}{.5\textwidth}
%first table
\end{minipage}
\begin{minipage}{.5\textwidth}
%second table
\end{minipage}
\end{table}
Each one will have own caption and number.
Another option is subfigure package.
In my case I was having an issue where the table was not being displayed right after the paragraph I inserted it, so I simply changed
\begin{table}[]
to
\begin{table}[ht]
You may want to add this to your preamble, and adjust the values as necessary:
%------------begin Float Adjustment
%two column float page must be 90% full
\renewcommand\dblfloatpagefraction{.90}
%two column top float can cover up to 80% of page
\renewcommand\dbltopfraction{.80}
%float page must be 90% full
\renewcommand\floatpagefraction{.90}
%top float can cover up to 80% of page
\renewcommand\topfraction{.80}
%bottom float can cover up to 80% of page
\renewcommand\bottomfraction{.80}
%at least 10% of a normal page must contain text
\renewcommand\textfraction{.1}
%separation between floats and text
\setlength\dbltextfloatsep{9pt plus 5pt minus 3pt }
%separation between two column floats and text
\setlength\textfloatsep{4pt plus 2pt minus 1.5pt}
Particularly, the \floatpagefraction may be of interest.
Not necessary to use \restylefloat and destroys other options, like caption placement. just use [H] or [!h] after \begin{table}.

Resources