Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
When I use more than one figure per section in LATEX, I am no longer able to dictate that the section number start just after a page break. I've been struggling with this for a while. If there are any LATEX wizards out there, your help would be much appreciated.
In the file referenced below, it is section 2 that I am struggling with. The final document is much, much longer than this and this problem happens several times, but I thought for the sake of clarity I would create a simpler version that still exhibits the problem.
zip file containing everything
\documentclass{article}
\usepackage{graphicx}
\usepackage{placeins}
\widowpenalty=2000
\clubpenalty=2000
\begin{document}
\section{}
\begin{figure} [h]
\center
\includegraphics[width=12cm]{Figure}
\label{fig:example}
\end{figure}
\FloatBarrier
My goal is to have section 2 start on a new page.
$$\\$$
\begin{figure} [h]
\center
\includegraphics[width=14cm]{Figure}
\label{fig:example}
\end{figure}
\newpage
\pagebreak [4]
$$\\$$
\section{}
\begin{figure} [h]
\center
\includegraphics[width=14cm]{Figure}
\label{fig:example}
\end{figure}
This is the body text for section 2.
\end{document}
Figure.jpg
Have you tried \clearpage instead of \newpage?
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed last year.
Improve this question
I am extremely new to LaTeX but have noticed that in the examples I have seen of LaTeX documents that there is always a massive number of empty lines at the top of the compiled pdf file. Nobody seems to say a word about this! Is this some kind of academic convention?
Here is an example:
\documentclass[]{article}
\usepackage{graphicx}
\title{Here is my title}
\author{Kevin Wright}
\begin{document}
\maketitle
\begin{abstract}
This is my abstract stuff
\end{abstract}
hello $\sqrt{x+y-10}$
\end{document}
Yes, by default the article class uses a lot of whitespace above the title of the paper. If you use a separate title page about 60 points of it.
With regard to the space on top of a regular page,
add \usepackage{layout} to your example, and just before the \end{document} add:
\section{Layout}
\layout
Now process and view the document and you will see exactly what the space on top of the page is made up of.
If you want to modify that, have a look at e.g. the geometry and fancyhdr packages.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 2 years ago.
Improve this question
I'm using the tabular environment in Latex (Overleaf) and would like my text to wrap automatically and be justified. The closest I can get to this is to use the \\ syntax. This is laborious; further, I would like to have justified text, like the rest of my document. I am using a snippet that I found here, but it does not incorporate automatic wrapping and justified text. My minimum working example follows:
\documentclass[11pt,fleqn]{book}
\usepackage{import}
\usepackage{fancyhdr}
\fancyhf{}
\cfoot{\thepage}
\pagestyle{fancy}
\usepackage{soul}
\usepackage[utf8]{inputenc}
\usepackage{subfiles}
%\bibliographystyle{aea}
\usepackage[backend=biber,style=authoryear,sorting=nyvt]{biblatex}
\addbibresource{newbib3.bib}
\begin{document}
\noindent\textbf{Analysis of Editing}\\
\noindent{Substantive}: 0, -2.\\
Further: the, mighty.\\
\begin{tabular}{#{}l#{\ }l}
Value Added: & Yes, I want the benefit of using the tabular environment.\\
& No, because I would like this text to wrap automatically (instead of extending out continuously) and to be justified.
\end{tabular}
\end{document}
Which produces the following:
Analysis of Editing
Substantive: 0, -2.
Further: the, mighty.
Value Added: Yes, I want the benefit of using the tabular environment.
No, because I would like this text to wrap automatically (instead of extending out continuously) and to be justified.
You could either use a column of fixed width, e.g. p{5cm} or a tabularx that will automatically adjust the width of the X columns to fill the desired with.
Unrelated note: please do not abuse \\ for line breaks outside of tables
\documentclass[11pt,fleqn]{book}
\usepackage{import}
\usepackage{fancyhdr}
\fancyhf{}
\cfoot{\thepage}
\pagestyle{fancy}
\usepackage{soul}
\usepackage[utf8]{inputenc}
\usepackage{subfiles}
%\bibliographystyle{aea}
\usepackage[backend=biber,style=authoryear,sorting=nyvt]{biblatex}
\addbibresource{newbib3.bib}
\usepackage{tabularx}
\begin{document}
\noindent\textbf{Analysis of Editing}
\noindent{Substantive}: 0, -2.
Further: the, mighty.
\begin{tabularx}{.953\linewidth}{#{}l#{\ }X}
Value Added: & Yes, I want the benefit of using the tabular environment.\\
& No, because I would like this text to wrap automatically (instead of extending out continuously) and to be justified.
\end{tabularx}
\end{document}
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 3 years ago.
Improve this question
I am trying to write a CV in Latex, but now I am stuck. Since I want to learn Latex, I don't really want to just use a template.
I am thinking about one page divided in to columns/minipages:
Left column: an image + contact information etc.
Right Column: Education, experience, volunteer work etc.
Tried minipages and columns, but the image is destroying the whole format... Tried to use parts from templates, which worked fine, i.e. secsty etc. See example under.
Not a specific question, but hope someone has a good idea for how to make something out of this idea :)
Example:
%Preamble
\documentclass[a4paper]{article}
\usepackage{graphicx}
\usepackage{geometry}
\geometry{a4paper, total={170mm,257mm}, left=10mm, top=10mm}
\pagestyle{empty}
%%% Custom sectioning (sectsty package)
\usepackage{sectsty}
\sectionfont{\usefont{OT1}{phv}{m}{n}\sectionrule{0pt}{0pt}{-10pt}{1pt}}
\subsectionfont{\usefont{OT1}{phv}{m}{n}}
%Document
\begin{document}
\begin{minipage}[250mm]{0.4\linewidth}
\includegraphics{image.png}
Date of birth:
Phone:
Email:
\end{minipage}
\begin{minipage}[250mm]{0.65\linewidth}
\part*{Name}
\section*{EDUCATION}
\section*{EXPERIENCE}
\end{minipage}
\end{document}
It is great to see that you don't simply copy one of the existing templates, but want to learn some latex instead.
Some comments about your code:
if you want the minipages besides each other to emulate columns, their combined sum has to be equal or smaller than the linewidth. In your example 0.4+0.65= 1.05, so they won't fit in one line. In fact I would make them a bit smaller and add a \hfill between to get a bit of space between them
to make sure each minipage is only as wide as you specified, I would add the [width=\linewidth] option to the image. This will automatically scale the image correctly
if you want both minipages in one line, don't leave an empty line between them. In latex and empty line in the source code is interpreted as a paragraph break, thus forcing your second minipage in a new line
To get a better vertical alignment of the image, I would remove the optional height argument from the minipage and let tex determine how high your minipages are and add the options [T] and [b] respectively to determine the vertical alignment
this is more a design question: at the moment your page geometry is highly asymmetric. You can visualise this by adding showframe to your geometry options, e.g. \geometry{a4paper, total={170mm,257mm}, left=10mm, top=10mm,showframe}. Are you sure this is a good choice for a CV?
%Preamble
\documentclass[a4paper]{article}
\usepackage{graphicx}
\usepackage{geometry}
\geometry{a4paper, total={170mm,257mm}, left=10mm, top=10mm}
\pagestyle{empty}
%%% Custom sectioning (sectsty package)
\usepackage{sectsty}
\sectionfont{\usefont{OT1}{phv}{m}{n}\sectionrule{0pt}{0pt}{-10pt}{1pt}}
\subsectionfont{\usefont{OT1}{phv}{m}{n}}
%Document
\begin{document}
\noindent
\begin{minipage}[T]{0.4\linewidth}
\includegraphics[width=\linewidth]{example-image-duck}
Date of birth:
Phone:
Email:
\end{minipage}%
\hfill
\begin{minipage}[b]{0.55\linewidth}
\part*{Name}
\section*{EDUCATION}
\section*{EXPERIENCE}
\end{minipage}
\end{document}
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 3 years ago.
Improve this question
I have a problem with my LaTeX code. I want to change page geometry for odd and even pages. However, i also have to change top margins differently for odd and even pages.
All answers for odd and even page margins include actually change in right margin.
I am runnnig TeXMaker in Ubuntu with a Texlive-full.
\documentclass[a4paper,12pt,twoside]{report}
\usepackage[a4paper,margin=1in,landscape]{geometry}
\setlength{\oddsidemargin}{25mm}
\setlength{\evensidemargin}{40mm} #These change only left margin
Based on https://tex.stackexchange.com/a/332272/36296 maybe the following could help:
\documentclass[a4paper,12pt,twoside]{report}
\usepackage[a4paper,inner=1cm,outer=2cm,landscape,bottom=5cm]{geometry}
\usepackage{etoolbox}
\makeatletter
\patchcmd\#outputpage{\headheight}{\ifodd\count\z# 3cm\else 0.5cm\fi}{}{}
\patchcmd\#outputpage{\global\#colht\textheight}{\global\advance\textheight by\ifodd\count\z# 2.5cm\else -2.5cm\fi\global\#colht\textheight}{}{}
\makeatother
\usepackage{lipsum}
\begin{document}
\lipsum\lipsum\lipsum\lipsum
\end{document}
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 3 years ago.
Improve this question
I am doing Latex beamer and I want to have all slides appear out of 100 no matter how many slides I have.
So slide 1 will be: 1/100
slide 2 will be: 2/100
slide 3 will be: 3/100
I have no idea to do this?
With up-to-date beamer version:
\setbeamertemplate{page number in head/foot}{\insertframenumber /100}
(and maybe some footline template that shows the page number, but without seeing a minimal working example (MWE) that shows which theme your are using, this is pure speculation)
Compilable MWE:
\documentclass{beamer}
\usetheme{Berlin}
\setbeamertemplate{page number in head/foot}{\insertframenumber /100}
\begin{document}
\begin{frame}
content...
\end{frame}
\end{document}