is there a way to control the white space above just one specific section in latex? Most solutions I've found rely on the titlesec package, but as far as I know that would change every section.
Thanks for the help!
Use \vspace*{length} command, just before your section begins. For example:
\documentclass{article}
\usepackage{lipsum}
\begin{document}
\lipsum
\section{Section 1}
\lipsum
\vspace*{1cm}
\section{Section moved down}
\lipsum
\end{document}
moves the second section 1cm down.
Related
Hello I am new at beamer (overleaf), so I have learned very much, so I would like to change the design of the numeration in table of contents. I mean with that (see picture attached):
I would like to change to a square, or simply the number. Anyone knows others styles? I am using the \usetheme{CambridgeUS}.
You can set the sections/subsections in toc template to change to e.g. a square or plain numbered sections:
\documentclass{beamer}
\usetheme{CambridgeUS}
\setbeamertemplate{sections/subsections in toc}[square]
%\setbeamertemplate{sections/subsections in toc}[sections numbered]
\begin{document}
\section{title}
\begin{frame}
\tableofcontents
\end{frame}
\end{document}
I'm setting the margin configurations for multiple environments. For instances firstenvironment sets the margins using \setlength, then I make use of the multicols package inside the new environment. The problem is that the text doesn't seem to respect the bottom margin in the first page where the environment is just being used, but the text in the next pages do respect the margins. The same happens when I create a second environment with its own margin configurations. Not sure why the margins are not activated immediately when the environment begins. Any suggestions would be welcome, thanks!
PD. PDF compiled with Xelatex
\documentclass[12pt]{article}
\usepackage{lipsum}
\usepackage{showframe} % show the frame margins
\usepackage{multicol}
\newenvironment{firstenvironment}{
\setlength{\hoffset}{0mm}
\setlength{\voffset}{0mm}
\setlength{\headsep}{20pt}
\setlength{\headheight}{4em}
\setlength{\textheight}{6in}
\setlength{\footskip}{10mm}}{}
\newenvironment{secondenvironment}{
\setlength{\hoffset}{0mm}
\setlength{\voffset}{0mm}
\setlength{\headsep}{5pt}
\setlength{\headheight}{2em}
\setlength{\textheight}{5in}
\setlength{\footskip}{20mm}}{}
\begin{document}
\begin{firstenvironment}
\setlength\columnsep{30pt}
\begin{multicols}{2}
{\Large\bf 1ST LIPSUM}\\
\lipsum[1-10]
\end{multicols}
\end{firstenvironment}
\newpage
\begin{secondenvironment}
\begin{multicols}{2}
{\Large\bf 2ND LIPSUM}\\
\lipsum[1-10]
\end{multicols}
\end{secondenvironment}
\end{document}
Photo, text out of bottom margin: image
I just figure out how to fix it. I made use of the package changepage. The idea is to include in the parameters of this command, the differences between the new margins and old margins. There is no need to use environments to set pages with different margins (which considers header, footer and margin notes), but to keep the same structure of the original post, I provide a solution that can be easily compared with.
\documentclass[12pt]{article}
\usepackage[paperheight=11in,paperwidth=8.5in,includeheadfoot]{geometry}
\usepackage{lipsum}
\usepackage{showframe}
\usepackage{multicol}
\usepackage{changepage}
\usepackage{calc}
\newenvironment{firstenvironment}{}{}
\newenvironment{secondenvironment}{}{}
\begin{document}
\setlength{\textheight}{7in}
\setlength{\headsep}{20pt}
\setlength{\headheight}{4em}
\setlength{\footskip}{10mm}
\begin{firstenvironment}
\begin{multicols}{2}
{\Large 1ST LIPSUM}\\
\lipsum[1-10]
\end{multicols}
\end{firstenvironment}
\newpage
\changepage{-2in}{}{}{}{}{}{2em-4em}{5pt-20pt}{20mm-10mm}
%\changepage{textheight}{textwidth}{evensidemargin}{oddsidemargin}{columnsep}{topmargin}{headheight}{headsep}{footskip}
\begin{secondenvironment}
\begin{multicols}{2}
{\Large 2ND LIPSUM}\\
\lipsum[1-10]
\end{multicols}
\end{secondenvironment}
\restoregeometry
\begin{firstenvironment}
\begin{multicols}{2}
{\Large 3rd LIPSUM}\\
\lipsum[1-10]
\end{multicols}
\end{firstenvironment}
\end{document}
The command \changepage considers the following parameters:
\changepage{textheight}{textwidth}{evensidemargin}{oddsidemargin}{columnsep}{topmargin}{headheight}{headsep}{footskip}
The margins that are left in blank under the \changepage command consider the default margins of the article class. If you want to restore the margins after setting a new one, just use the command \restoregeometry
I'm new to LaTex and I wanted to know how I can change the Margins of my scrreport so that the chapter title, text and basically everythin starts a bit higher and ends a bit lower. In my opinion there is too much empty space before anything starts.
If I use this simple example:
\documentclass[12pt,a4paper,twoside]{scrreport}
\usepackage{blindtext}
\begin{document}
\chapter{First Chapter}
\blindtext
\end{document}
I think the margins from top and bottom are too big. So i want everything to move up a little bit.
Thanks!
Method 1:
Choose one of the predefined layouts. You'll find a list of available options in the koma script documentation.
\documentclass[12pt,a4paper,twoside,DIV=15]{scrreport}
\usepackage{blindtext}
\begin{document}
\chapter{First Chapter}
\blinddocument
\end{document}
Method 2:
Setting up the text area manually. You should be really sure that you know what you are doing to get an aesthetically pleasant result.
\documentclass[12pt,a4paper,twoside]{scrreport}
\areaset[current]{168.00mm}{250mm}
\usepackage{blindtext}
\begin{document}
\chapter{First Chapter}
\blinddocument
\end{document}
I am using the \twocolumn tag to use the two-column layout in LaTeX. The problem is that this does not work properly and the text seems not to be fixed between the borders. Not sure if that minimal example helps, but at least you can see my includes and the text with which it happens.
\documentclass[12pt,a4paper, abstracton]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[backend=biber, sorting=none]{biblatex}
\usepackage{hyperref}
\usepackage[hyphenbreaks]{breakurl}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\begin{document}
\twocolumn
\section{Introduction}
Glutamate carboxypeptidase II (GCPII), N-acetyl-L-aspartyl-L-glutamate peptidase I (NAALADase I), NAAG peptidase or prostate-specific membrane antigen (PSMA) \dots
\end{document}
Screenshot of left column in PDF that shows the problem
Why does LaTeX write from the first column into the second column and how can I fix that? I would like to avoid change each line separately, where that happens. I am looking for a global solution.
Since the workarounds of the accepted answer were not satisfactory to me, I kept searching and found a more adequate and fast workaround, adding to my preamble the following:
\setlength{\emergencystretch}{3em}
The length 3em can be changed as needed, just keep it as low as possible in order to preserve optimal appearance.
More details here.
Latex has trouble finding a suitable break point because words with multiple capital letters are normally assumed to be acronyms which should not be hyphenated.
Possible workarounds:
force a line break with \linebreak before the word. This might result in undesirable large spaces in the line, especially in your situation in with only a single white space in the line
tell latex where possible break points are with long\-word (I don't know if there are any possible hyphenation points in NAALADase). This can also be globally for the whole document with \hyphenation{long-word} in your preamble
rephrase the sentence
use another layout. Very short lines combined with very long and unbreakable words is a tough combination
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[backend=biber, sorting=none]{biblatex}
\usepackage{hyperref}
\usepackage[hyphenbreaks]{breakurl}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\begin{document}
\twocolumn
\section{Introduction}
Glutamate carboxypeptidase II (GCPII), N-acetyl-L-aspartyl-L-glutamate peptidase I \linebreak (NAALADase I), NAAG peptidase or prostate-specific membrane antigen (PSMA) \dots
\end{document}
I am new to latex and I wrote the below tex code on Texmaker editor.
What I want to do is to add the "University" section without any numbering preceeding it and to be centered horizontally, because when I run the code I find that the word "University" is displayed but it is preceeded by a number and I do not want to display any number preceeding that word.
code:
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{kpfonts}
\author{Anan}
\pagestyle{plain}
\begin{document}
\section{University}
\end{document}
\section*{\centering University}
% * removes numbering for _this_ \section instance,
% \centering within environment centres the title.
Note however, that this is a local solution, and that it's better practice (and easier for you to make later document-global changes) to re-define the \section, \subsection, ... environments using the titlesec package, as is described well in Alan Munn:s answer in the following tex.stackexchange thread:
https://tex.stackexchange.com/questions/8546/section-heading-centering-problem
All you have to do is to edit your line 9:
\section{University}
this way:
\section*{\centering University}
since the command \section* produces unnumbered sections.
Further, if you want to to include an unnumbered section to your table of contents, you can add
\addcontentsline{toc}{section}{University}
(this time without \centering) just after. The resulting code:
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{kpfonts}
\author{Anan}
\pagestyle{plain}
\begin{document}
\tableofcontents
\section*{\centering University}
\addcontentsline{toc}{section}{University}
Text.
\end{document}