I am writing a personal statement in latex. I don't want the big margin at the top of the page not big title taking a lot of space. I just like to make the layout compact but still clearly spaced with title, name and other necessary information, since there may be restriction on the number of pages. One example would be http://www.hsc.unt.edu/education/CIM/Documents/PS-Sample2_000.pdf. I wonder where to find some good latex templates or examples?
Thanks and regards!
I would use the geometry package to establish the desired margins. To get the margins in your sample document, try:
\usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry}
Your next requirement was to fix the title block. LaTeX uses the internal command \#maketitle to format the title block. You can redefine this as you like. To achieve the same title block style as in the sample document, use:
\usepackage[svgnames]{xcolor}% provides colors for text
\makeatletter% since there's an at-sign (#) in the command name
\renewcommand{\#maketitle}{%
\begin{center}
\parskip\baselineskip% skip a line between paragraphs in the title block
\parindent=0pt% don't indent paragraphs in the title block
\textcolor{red}{\bf\#title}\par
\textbf{\#author}\par
%\#date% remove the percent sign at the beginning of this line if you want the date printed
\end{center}
}
\makeatother% resets the meaning of the at-sign (#)
The \#title, \#author, and \#date commands will print the title, author, and date. You can use whatever formatting commands you like to set the text in bold, different colors, etc.
Put all of the above commands in the preamble of the document. The preamble is the space between \documentclass and \begin{document}.
\documentclass{article}
% this is the preamble
% put all of the above code in here
\title{Personal Statement}
\author{Tim}
\begin{document}
\maketitle% prints the title block
Emergency medicine has always been a passion of mine\ldots
\end{document}
Attempt #1: I've used the following style file, which I call cramp2e, for similar purposes. It is probably not right for you, but have a look:
\oddsidemargin -1cm
\evensidemargin -2cm
\topmargin 1cm
\textheight 24cm
\textwidth 19cm
\headheight 0cm
\headsep .7cm
\footskip .7cm
\parskip .2cm
\paperheight 25cm
\setlength\voffset{-.33in}
\setlength\hoffset{-.25in}
Any good?
Postscript This is for A4 size paper.
A slightly less LaTeX-ey solution would be to not use the \maketitle command. A couple of times I've simply used this as my title(marginsize helps too).
Set up smaller margins:
\documentclass{article}
\usepackage{anysize}
\marginsize{1cm}{1cm}{1cm}{1cm}
(EDIT: 1cm might be even better..)
Minimal title:
\begin{document}
\begin{center}
\section*{My Document Title}
\today
\end{center}
% content goes here
\end{document}
The result looks something like:
Related
I am having issues with a report I am writing. First time using latex and after getting some help on here regarding some tables weirdness I again have a silly frustrating issue. Figures don't stay where I put them. I made a MWE Posted Below
\documentclass{article}
\usepackage{graphicx}
\graphicspath{ {./Figures/} }
%%%%%% Referencing %%%%%%
\usepackage{natbib}
\bibliographystyle{abbrvnat}
\setcitestyle{authoryear,open={(},close={)}}
\title{MWE}
\begin{document}
\maketitle
\section{Introduction}
The average sea surface temperature (SST) trend is shown in Figure \ref{fig:SST}.
\section{Figures}
\begin{figure}
\includegraphics[width = \linewidth]{Figures/SST.png}
\label{fig:SST}
\end{figure}
\section{References}
\bibliography{References.bib}
\bibliographystyle{agsm}
\end{document}
I expect, probably an error, for the figure to be inserted under the Figures subheading however it appears on the next page after references. I have to refer to my figure in the text, hence the \ref{fig:SST} so it is clickable. It's not a size issue as there is more than enough space on the page to accommodate the figure. Even if that was the issue I would expect the references subheading to be after it.
Most latex classes use so called floats for figures, tables etc. The idea is that latex will automatically find a good place for your images and avoid ugly white space.
To make use of the abilities of latex to produce a good looking output, you must specify possible placements with floating specifier such as [htbp], which allows latex to place the image here, at the top, at the bottom or an a separate page.
Also if you want to use the \label-\ref mechanism, your figure must have a caption (and the label inside or after the caption).
\documentclass{article}
\usepackage{graphicx}
\graphicspath{ {./Figures/} }
%%%%%% Referencing %%%%%%
\usepackage{natbib}
\bibliographystyle{abbrvnat}
\setcitestyle{authoryear,open={(},close={)}}
\title{MWE}
\begin{document}
\maketitle
\section{Introduction}
The average sea surface temperature (SST) trend is shown in Figure \ref{fig:SST}.
\section{Figures}
\begin{figure}[htbp]
\includegraphics[width = \linewidth]{example-image-duck}
\caption{test}
\label{fig:SST}
\end{figure}
\section{References}
\bibliography{References.bib}
\bibliographystyle{agsm}
\end{document}
Generally, LaTeX's attitude is ‘you write the text, let me worry about placing the figures’.
Floats (that is, figures and tables) will float to where LaTeX thinks they go best. I can't remember the precise rules in the article style, but generally they float to the top of the nearest following page that has room for them. LaTeX won't fill too much of a page with figures, so if you have a dense sequence of large-ish figures, some of them can end up quite a long way away from the point in the source text where they're written.
This is normal, and how figures and tables appear in the majority of published books and articles.
You'll usually write a caption:
\begin{figure}
\includegraphics{...blah...}
\caption{This is a caption for my figure\label{fig:SST}}
\end{figure}
Then you can write
...this is shown in Figure~\ref{fig:SST}
If you want to, you might add ...on p.\thinspace\pageref{fig:SST} and LaTeX will insert the page number where the figure ends up. Also, see the prettyref package.
As mentioned in the other answer, you can add placement specifiers like [ht], which give LaTeX permission to put the figure ‘here’ or at the top of a page, but that doesn't force anything. It is possible to fight with LaTeX about this (the Overleaf docs give some hints), but it's generally not worth it in my experience.
That said, one bit of guidance it's useful to give LaTeX is something like \renewcommand{\floatpagefraction}{.8}, which says that LaTeX is allowed to use as much as 80% of the page for floats (ie, figures and tables) – the default value is a bit tight (there are more comments on this in this TeX.SE question – tex.stackexchange.com is generally a better site for LaTeX-related questions).
If you do feel compelled to fight/fiddle with float placement, do it at the very end of the process, where you're fine-tuning the punctuation of your document. Small changes in the document can have big effects on where floats end up, and it's simply not worth worrying about this until your document is almost finalised.
Your final puzzlement was about the figure ending up after the references. In the case of your document, the figure goes on p.2, so there's plenty of space on p.1 for LaTeX to carry on setting text, so naturally it puts the references there. Since you generally do want the references to go at the very end of an article, this is a case where it's reasonable to exert a little control over placement, and a good idea would be to put \clearpage before the References section. What that does is to make a new page and force out any floats which are still in the queue waiting for space to appear.
LaTeX seems to have a preference for placing figures together on a page, and placing surrounding text on a separate page. Can I somehow change that balance a bit, as I prefer figures to break up the text to avoid too black text-heavy pages.
Example:
\section{Some section}
[Half a page of text]
\begin{figure}
[...]
\caption{Figure text 1}
\end{figure}
[Half a page of text]
\begin{figure}
[...]
\caption{Figure text 2}
\end{figure}
[More text]
So what LaTeX usually does is to stack the two half pages of text on a single page, and the figures on the following page. I believe this really gives a bad balance, and bores the reader. So can I change that somehow?
I know about postfixing the \begin{figure} with [ht!], but often it does not really matter. I would like to configure the balancing algorithms in LaTeX to naturally prefer pages with combined figures and text.
Try putting the following in your preamble.
\setcounter{topnumber}{2}
\setcounter{bottomnumber}{2}
\setcounter{totalnumber}{4}
\renewcommand{\topfraction}{0.85}
\renewcommand{\bottomfraction}{0.85}
\renewcommand{\textfraction}{0.15}
\renewcommand{\floatpagefraction}{0.7}
You might play with those numbers a little to suit your own preferences. Some explanations of the different parameters are given here.
Try to tune floats positioning with:
\begin{figure}[tb] for figures that fit well in a page with text (say, half of the text height for the figure and the other half for the text)
\begin{figure}[p] for floats large enough to require a dedicated page.
Also, you can place some "barriers" for floats positioning with the packages placeins or afterpage.
Try
\makeatletter
\#colnum 1 % Or 2. It is the max of the float insertions at the top of the page.
\makeatother
I've been looking for a more elegant solution to the following typesetting problem. Consider those banners found in print media where the text is aligned like:
B I G T E X T
small text small text small text
m o r e m e d i u m t e x t
The font sizes are adjusted so that the height is scaled down for longer lines of text such that each line has equal width. I've written a small script that runs each line separately, compiles, crops the resulting pdf and then \includegraphics each in a table. This gives the desired effect but requires an both an outside script and pdfcrop (which only crops to a white bounding box). Since much of LaTeX is self-aware, I imagine it would be possible to have it recognize the width of a box and scale it appropriately so that any text fits exactly into the desired width.
Any thoughts or ideas on how a pure LaTeX implementation might work?
EDIT As a supplement to the suggested solution by AVB (since large code in comments looks awful), I've posted below the code used so that others may find it easily.
\documentclass[]{article}
\usepackage[pdftex]{graphicx}
\begin{document}
\begin{table}[l]
\resizebox{10cm}{!}{BIG Text} \\
\resizebox{10cm}{!}{small text small text small text} \\
\resizebox{10cm}{!}{Medium Text Medium Text}
\end{table} \end{document}
First, read the TeX FAQ entry titled Changing the space between letters. Depending on your circumstances, the packages and recommendation in that FAQ may suffice.
Also, take a look at the \scalebox and \resizebox commands in the graphicx package. They do what the names imply.
I'm sure that this could be improved upon, and due to different font implementations at different sizes then it isn't going to be exact, but here's a quick-and-dirty way to do it:
\documentclass[10pt]{article}
\usepackage{pgfmath}
\usepackage{anyfontsize}
\newlength{\mywidth}
\newlength{\testwidth}
\setlength{\mywidth}{4in}
\newcommand{\fixedwidth}[1]{%
\settowidth{\testwidth}{#1}%
\pgfmathsetmacro{\x}{round(\mywidth/\testwidth * 10)}%
\pgfmathsetmacro{\y}{round(\mywidth/\testwidth * 15)}%
\bgroup\fontsize{\x pt}{\y pt}\selectfont#1\egroup}
\begin{document}
\fixedwidth{hello world}
\fixedwidth{greetings earthlings}
\end{document}
In practice, it's a little less than the 4in, but the two lines of text do get scaled to the same amount.
Check out the package textfit. Usage:
\scaletowidth{width}{text}
or
\scaletoheight{height}{text}
I would like to change the caption from being:
Figure 1: ...
to
From left to right: ...
If I try and renewcommand the figurename, they still get numbered. This is unecessary as there is only a single image in the document.
Any suggestions?
You could also use the caption package to remove the "Figure 1:" from the \caption{} command.
\usepackage{caption}
...
\begin{figure}
\caption*{A figure}
. . .
\end{figure}
If you want to use \caption{...} to specify the caption, you can use this hack in your document:
\makeatletter
\def\#makecaption#1#2{%
\vskip\abovecaptionskip
\hb#xt#\hsize{\hfil#2\hfil}%
\vskip\belowcaptionskip}
\makeatother
With this instruction, your figures will display only what you have specified as \caption{...} and won't add any "Figure 1: " etc.
Instead of using \caption you may consider putting your own content beneath the figure's content:
\includegraphics{...}
\small
From left to right: ...
Geoff's answer is basically correct. Within a figure or table environment, you can drop the caption if you don't want numbering, and just write plain text. From the book A Guide to LaTeX, 3rd edition (p.184):
The \caption command may be omitted if numbering is unwanted, since any text included in the float environment will accompany the contents. The advantages of \caption over simple text are the automatic numbering and entries in the lists of figures and tables.
How could I make a blank after the number in my footnotes?
In a general way, for ALL footnotes!
Example:
good: 1 Hello World
bad : 1Hello World
The correct answer is not to redefine \thefootnote, because that adds space wherever the footnote is referenced; for example:
\documentclass{article}
\renewcommand{\thefootnote}{\arabic{footnote}~}
\begin{document}
hello\footnote{test\label{foo}} but don't forget about fn.\,\ref{foo}.
\end{document}
Note the extra space when the footnote number is referred to!
The footnote itself (including the number) is placed by the macro \#makefntext, whose default definition is
\parindent 1em\noindent \hb#xt# 1.8em{\hss \#makefnmark }#1
Here's an example of a replacement that adds some space after the footnote number:
\documentclass{article}
\makeatletter
\long\def\#makefntext#1{%
\parindent 1em\noindent\hb#xt# 1.8em{\hss\#makefnmark}~#1%
}
\makeatother
\begin{document}
hello\footnote{test\label{foo}} but don't forget about fn.\,\ref{foo}.
\end{document}
You might also wish to reduce the indent on the left, for example.
EDIT: Ok, redesigned. Ugly hack, but hey, isn't LaTeX just a whole bunch of those?
Put the following into your preamble:
\let\myfootnote\footnote
\renewcommand{\footnote}[1]{\myfootnote{~#1}}
This will simply prefix your footnote text automagically with a non-breaking space, therefore creating a space after the foot note mark at the bottom of the page. And it won't touch the footnote mark in the middle of the text which is why it still works properly directly before punctuation.
\hspace
can always supply horizontal spacing somewhere.
\footnote{\ insert footnote here}
\footnote{~insert footnote here}
Work, but I do not know if it is the official way to do it. The "~" is officially used in cases like:
Mr.~Smith
To provide the usual whitespace after the abbreviation "." The "\ " I do not know, I just happend to see its use some time ago after accidently putting it in a sentence.
You could try ~ a non-breakable space
I made myself an account, but now I couldn't comment the answers, so I posed my solution.
I tried Will's version, but I have problems if the footnote is to long and needed a new line.
So based on his work I find this:
\makeatletter
\renewcommand{\#makefntext}[1]{%
\setlength{\parindent}{0pt}
\begin{list}{}{%
\setlength{\topsep}{0pt}
\setlength{\partopsep}{0pt}
\setlength{\labelwidth}{1em} % Space from number to border
\setlength{\labelsep}{0.3em} % Space from number to text
\setlength{\leftmargin}{\labelwidth}
\addtolength{\leftmargin}{\labelsep}
\footnotesize}\item[{\makebox[\labelwidth][r]{\#makefnmark}}]#1%
\end{list}
}
\makeatother
Thanks for all of your help, now it is looking very nice and I haven account ;).