In LaTeX not able to add space (i.e. use \vspace{length}) in multicolumn (i.e. in \begin{multicols} environment) - latex

I am trying to add vertical space in first column but after writing \vspace{10cm}, still not getting the required result.
Image of required result can be found here.
If there is some problem in code (Code is attached), then please correct. Otherwise you can also suggest other method.
\documentclass{article}
\usepackage{multicol}
\usepackage{tikz}
\begin{document}
\begin{multicols}{2}
\vspace{10cm}
\begin{flushleft}
Date:
\\ Place
\end{flushleft}
\columnbreak
Examiners \\
\begin{flushright}
\par
1.\begin{tikzpicture}
\draw [thick,densely dashed={dash pattern=on 3pt off 2pt}] (0,0) -- (7,0);
\end{tikzpicture}
\par
2.\begin{tikzpicture}
\draw [thick,densely dashed={dash pattern=on 3pt off 2pt}] (0,0) -- (7,0);
\end{tikzpicture}
\end{flushright}
\end{multicols}
\end{document}

It will work if the \vspace is not the first thing in the column. You could add something invisible like \mbox{} before it.
Off-topic:
using tikz for the doted lines feels a bit overkill, you could use \dotfill instead (this would also avoid the overfull box warnings)
you shouldn't abuse \\ for line breaks, this causes many underfull box warnings. Just leave an empty line instead to start a new paragraph
\documentclass{article}
\usepackage{multicol}
\begin{document}
\begin{multicols}{2}
\mbox{}
\vspace{10cm}
\begin{flushleft}
Date:
Place
\end{flushleft}
\columnbreak
Examiners
\begin{flushright}
\par
1.\dotfill
\par
2.\dotfill
\end{flushright}
\end{multicols}
\end{document}

Related

Latex: how to align subcaptions on the top left and caption to the right of the figures

I am using LaTeX to write a report and I'm going crazy to get a result like
with subcaptions (a), (b), (c) align to the top left of the subfigures and caption on the right of the figure.
I've already tried with floatrow and subcaption, but I've never obtained the result I want.
MWE:
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{floatrow}
\usepackage{subfig}
\floatsetup[figure]{style=plain,subcapbesideposition=top}
\begin{figure*}
\ffigbox[\FBwidth]
{\begin{subfloatrow}
\sidesubfloat[]{\includegraphics[width=.5\linewidth]{image1}\label{fig:a}}%
\sidesubfloat[]{\includegraphics[width=.5\linewidth]{image2}\label{fig:b}}%
\end{subfloatrow}}
{\caption{Two figures}\label{}}
\end{figure*}
\end{document}
Here some starting point with the subcaption package (the exact dimensions might need some tweaking to nicely align with the surrounding text)
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\captionsetup[subfigure]{font={bf,small}, skip=1pt, margin=-0.7cm, singlelinecheck=false}
\begin{document}
\begin{figure*}
\hfill
\begin{minipage}[b]{.63\textwidth}
\begin{subfigure}{\textwidth}
\subcaption{}
\includegraphics[width=\linewidth]{example-image-duck}
\end{subfigure}\par
\begin{subfigure}{\textwidth}
\subcaption{}
\includegraphics[width=\linewidth]{example-image-duck}
\end{subfigure}
\end{minipage}
\quad
\begin{minipage}[b]{.3\textwidth}
\caption{some caption with aligns at the bottom}\label{key}
\end{minipage}
\end{figure*}
\end{document}

LaTex - Extra space between words of footnotes in figure environment

there is extra space between the words of the footnotes in the figure below. How can I fix this issue?
\documentclass[jou]{apa7}
\begin{document}
\begin{figure*}
\centering
\caption{Title}
\vspace{0.3cm}
\includegraphics[width=\textwidth]{example.png}
\vspace{4pt}
\begin{tablenotes}[para,flushleft]
{\small \textit{Note.} Figure notes here }
\end{tablenotes}
\end{figure*}
\end{document}
Your table note tries to fill the whole line. To avoid the extra space you can add \hfill at the end to fill the line.
\documentclass[jou]{apa7}
\shorttitle{subtitle}
\begin{document}
\begin{figure*}
\centering
\caption{Title}
\vspace{0.3cm}
\includegraphics[width=\textwidth]{example-image-duck}
\vspace{4pt}
\begin{tablenotes}[para,flushleft]
{\small \textit{Note.} Figure notes here\hfill }
\end{tablenotes}
\end{figure*}
\end{document}

Extra space in the first page of the LaTeX generated PDF

I have a following LaTeX script:
\documentclass[a4paper, 12pt, oneside]{article}
\usepackage{graphicx}
\usepackage[final]{pdfpages}
\usepackage{geometry}
\usepackage{pdflscape}
\geometry{a4paper, margin=1cm}
\begin{document}
\pagestyle{empty}
\begin{landscape}
\includegraphics[width=12cm, height=11cm]{/tmp/image1.png}
\hspace{2em}
\includegraphics[width=12cm, height=11cm]{/tmp/image2.png}
\newline
\includegraphics[width=12cm, height=11cm]{/tmp/image1.png}
\hspace{2em}
\includegraphics[width=12cm, height=11cm]{/tmp/image2.png}
\newline
\includegraphics[width=12cm, height=11cm]{/tmp/image1.png}
\hspace{2em}
\includegraphics[width=12cm, height=11cm]{/tmp/image2.png}
\newline
\end{landscape}
\end{document}
The problem is that for the very first page there is a few millimeter extra space on the left side (left-top margins are not equal) - there is no such an extra margin for the following pages which are all the same.
The issue can be seen here:
Where is the trick/issue here?
this is due to the initial indent and can be removed with \noindent inside the landscape env.
...
\begin{landscape}
\noindent % HERE
\includegraphics[width=12cm, height=11cm]{aplot.png}
\hspace{2em}
...
EDIT : All these graphics count as one paragraph, so if you break this paragraph in 2 with a blank line, you'll need to add a second \noindent.

Ruled Text in Textbox with Lines

I'd like to have a function for a "letter". By letter I mean that it is a ruled paper, and the text looks justified, as if it would be without the "uline" function.
Moreover, the ulem package is not what I want, since the last line will always be short (any line that has a linebreak).
I am more thinking of something as in the exam class, the \fillwithlines order.
Anyone has an idea? Thanks in advance!
\documentclass[fontsize=9pt,twoside, DIV=calc]{scrbook}
\usepackage[papersize={12.5cm,19cm},inner=10mm, outer=10mm, bottom=13mm, top=10mm, footskip=6mm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[]{lipsum}
\usepackage{xcolor}
\xdefinecolor{notiz}{RGB}{239,227,157}
\usepackage{tabularx}
\usepackage{tikz}
\usepackage{tikzsymbols}
\usepackage{varwidth}
\usetikzlibrary{shapes}
\usetikzlibrary{decorations.pathmorphing}
\usepackage{ulem}
\newcommand{\post}[1]{
\small
\begin{center}
\begin{tikzpicture}[pencildraw/.style={ %
decorate,
decoration={random steps,segment length=2pt,amplitude=1pt}
} %
]
\node[ preaction={fill=black,opacity=.5,% zeilenabstand=2.8,
transform canvas={xshift=1mm,yshift=-1mm}},
pencildraw,draw,fill=notiz,text width=.8\textwidth,
inner sep=5mm] {\uline{#1}};
\end{tikzpicture}
\end{center}
\normalsize
}
\begin{document}
\post{\lipsum[1]}
\end{document}

Vertically centering a title page

I'm trying to vertically center a title on a custom-sized page with latex. I've written the following code, but for some reason it doesn't center. Could someone please point me to what's wrong with it?
Thanks!
\documentclass{article}
\setlength{\pdfpagewidth}{88.184mm}
\setlength{\pdfpageheight}{113.854mm}
\usepackage[margin=0.5cm, paperwidth=88.184mm, paperheight=113.854mm]{geometry}
\title{[[title]]}
\date{[[date]]}
\author{[[author]]}
\begin{document}
\vspace{\fill}
\maketitle
\vspace{\fill}
\newpage
[[text]]
\end{document}
There are two small bugs in your code.
First, if you want the \vspace to work at the beginning or end of a page, you should use the starred version (\vspace*).
This would work, but \maketitle is a pretty complicated macro, and if used like in your example, it just puts the title at the second page. You can use the titlepage environment, which gives you much more command over how the title page looks like -- including the spacing. For example, you could use the following code:
\documentclass{article}
\setlength{\pdfpagewidth}{88.184mm}
\setlength{\pdfpageheight}{113.854mm}
\usepackage[margin=0.5cm, paperwidth=88.184mm, paperheight=113.854mm]{geometry}
\begin{document}
\begin{titlepage}
\vspace*{\fill}
\begin{center}
{Huge [[title]]}\\[0.5cm]
{Large [[author}\\[0.4cm]
[[date]]
\end{center}
\vspace*{\fill}
\end{titlepage}
[[text]]
\end{document}
\null % Empty line
\nointerlineskip % No skip for prev line
\vfill
\let\snewpage \newpage
\let\newpage \relax
\maketitle
\let \newpage \snewpage
\vfill
\break % page break
If you want to make everything work even with \maketitle put your \vspace*{\fill} inside the first and the last attribute, exp:
\title{**\vspace*{\fill}**[[title]]}
\date{[[date]]}
\author{[[author]]**\vspace*{\fill}**[[}
\begin{document}
\maketitle
\newpage
[[text]]
\end{document}
As in the answer by finrod, \maketitle is a pretty complicated macro, this is why I didn't feel like overwriting it myself (\renewcommand\maketitle{...). Nevertheless, copying, pasting and editing lines 170-201 of article.cls documentclass, I could add a new one to customize (\newcommand\mymaketitle{...) as follows:
\documentclass{article}
\setlength{\pdfpagewidth}{88.184mm}
\setlength{\pdfpageheight}{113.854mm}
\usepackage[margin=0.5cm, paperwidth=88.184mm, paperheight=113.854mm]{geometry}
\title{Title}
\date{Date}
\author{Author}
\makeatletter
\newcommand\mymaketitle{%
\begin{titlepage}
\null\vfil\vskip 40\p#
\begin{center}
{\LARGE \#title \par}
\vskip 2.5em
{\large \lineskip .75em \#author \par}
\vskip 1.5em
{\large \#date \par}
\end{center}\par
\#thanks
\vfil\null
\end{titlepage}
}
\makeatother
\begin{document}
\mymaketitle
Text
\end{document}
The output:

Resources