I'm using Latex to write my resume, however the default margins for the resume doc type are too wide. The best way to correct this is using the anysize package then setting the margin size, however doing so causes the "=.5=.75" to display before my title in the pdf. Here is the header code
% LaTeX resume using res.cls
\documentclass[margin]{res}
% \usepackage[margin=0.75in,bottom=.5in,top=.5in]{geometry}
\usepackage[none]{hyphenat}%%%%
\usepackage{anysize}
\setlength{\textwidth}{5.8in} % set width of text portion
\begin{document}
\marginsize{.5}{.5}{.75}{.75}
% Center the name over the entire width of resume:
\centerline{\large\bf John Doe}
You need to specify the lengths using some unit of measure. For example:
\marginsize{.5in}{.5in}{.75in}{.75in}
However, as mentioned in the anysize README
This package is obsolete. Use the package typearea to define your
margins typographically correct. Use the package geometry or vmargin
for everything else.
My suggestions would be to stick to geometry package for setting your document layout. Also, not to use resume for setting a resumé. There's moderncv as an alternative, or you could do just as well in the default article class.
Related
I'm currently writing my CV and I'm running out of space. I wish to change the font in the whole CV template, but I want to do it proportionally. For example, some headings are 12pt, subheadings are 11pt. I want to be able to change them to 0.9 * 12 pt, 0.9 * 11 pt, aka to scale them accordingly. I want to change
\fontsize{12pt}{1em}
to
\fontsize{(0.9 * 12)pt}{1em}
, where \fontsize is a command from anyfontsize package.
But I end up with weird results and lots of logs/mistakes. Is there a way to ensure that '*' will produce a number, like in "regular" programming languages?
Other things I've tried include:
\newcommand{\myfont}[2]{\fontsize{0.9*#1pt}{0.9*#2}em}
\myfont{12}{1}
But it doesn't work the way I expect it to. I also tried adding brackets () and making a new command \newcommand{\mymultiply}[2]{#1*#2}
Is there an elegant and neat way to do this? Is there a "regular" way in LaTeX of doing actual calculations, or should I avoid this approach? Thanks in advance!
3 possible approaches:
I would avoid using hard coded font sizes altogether. If you instead us font commands like \smaller or \larger you can simply change the overall size with documentclass options like 10pt or 12pt and all the fonts in the document will scale, including sections etc.
if you store your base fontsize in a length, you could use \dimexpr to make the calculations
if for whatever reason you don't want to create a new length, you use an expl3 command to do the calculations
\documentclass[
%10pt
12pt
]{article}
\usepackage{anyfontsize}
\ExplSyntaxOn
\cs_new_eq:NN \fpeval \fp_eval:n
\ExplSyntaxOff
\begin{document}
\section{section}
section
\newlength{\foo}
\setlength{\foo}{12pt}
\fontsize{\dimexpr.9\foo\relax}{\dimexpr1.08\foo \relax}\selectfont
test
\fontsize{\dimexpr\fpeval{.9*12}pt\relax}{\dimexpr\fpeval{.9*1.2*12}pt\relax}\selectfont
test
\end{document}
I have a series of markdown files that I am turning into slides using Pandoc and the Beamer template. I am creating my own custom Beamer template in order to format those slides.
pandoc --slide-level 2 -fmarkdown-implicit_figures -t beamer --template mytemplate.beamer -o test.pdf *.md
I am struggling with making certain elements look the way I would like them to.
My simplified markdown looks like this:
## Header
Normal Body Text
![Image](images/Image1.png "Image")
Specifically, my images are coming out left justified. I can't figure out how to get them to center. If I remove the -fmarkdown-implicit_figures option, then the images are properly centered, but includes captions that I don't want. Adding that flag eliminates the captions but also eliminates the centering.
At the same time, I want the normal body text to be centered as well. So in the above example I would like the text Normal Body Text to be centered. Again, I can't figure out how to do that. I have managed to center other elements (such as the header), but I can't find an appropriate name for the element that represents normal body text.
Can anyone offer a solution to either of these issues?
I found a way to center the images. It may not be the best option, but this seems to work:
\usepackage{letltxmacro}
% Save the meaning of \includegraphics
\LetLtxMacro\latexincludegraphics\includegraphics
% Update the include graphics command to include centering
\renewcommand{\includegraphics}[2][]{%
\centering
\latexincludegraphics[#1]{#2}}
To ensure the normal text was centered, I used the following, again I am unsure if this is the best way:
% Center Text By Default
\usepackage{ragged2e}
\centering
In my presentation, I use \usetheme{Warsaw} and in order to increase the usable space in each frame, I use \useoutertheme{infolines}. In this way, the bar at the bottom of each page is equally divided between author's name, title, and date and slide number. Is there anyway to change the width of each section? For example, I need more space for the title compared to author's name or date. Any comment is highly appreciated. Also, the code I am using is the following:
\usepackage{beamerthemesplit}
\usetheme{Warsaw}
\useoutertheme{infolines}
\title[...]{...}
\author[...]{...}
\institute{...}
\date{...}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
Thank you.
Find the beamerouterthemeinfolines.sty file (in the ...\latex\beamer\themes\outer folder). You will see that the 1:1:1 width is hard-coded using wd=.333333\paperwidth for each box, so you will have to edit the style file.
The following is not tested, but should set you on the right path.
Change those values as you want, then save the file under a different name, say beamerouterthemeunevenlines.sty. Now use unevenlines as your outer theme.
I've got a latex macro that draws a picture using PGF and Tikz according to given parameters. The width of picture drawn depends on these parameters.
PGF automatically calculates the resulting width of any picture drawn so the user does not have to set it explicitly(like for example when using latex build in picture environment).
However I need to know the width of picture that will be drawn. Of cause I could calculate it as the PGF does but this is going to be quite some work(a lot of if statements...). Is there a way to ask PGF what is the width of picture that is to be drawn (some command I expect)? Either inside tikzpicture environment or just after it?
Thanks for help.
What I would probably do is put the tikzpicture environment in a box, and then find the width of the box:
\setbox0=\vbox{\hbox{%
\begin{tikzpicture}
% ...
\end{tizpicture}%
}}
The width of the following picture is {\the\wd0}.
\box0
Note that after you run \box0, the box will be inserted into the document and its contents will be destroyed; you thus need to query the width of the box before you do that. If you want to save the width, you can store it in a dimension register with \dimen0=\wd0; alternatively, you can use \copybox0, which inserts the box but doesn't destroy it (although this might leak memory).
Also, having played with some of this before, I found that using just a \vbox caused the box to always be the full width of the page (which, if you think about it, makes sense); however, using just an \hbox caused the unboxing to fail for some reason (it seemed to be a known pug). Using both like this works, however—I'm using something very much like this to render TikZ pictures to PDF files of precisely the right size.
I am looking for a simple way to control the width of a \caption{} inside a float in LaTeX without using the {caption} package. Any clues?
(EDIT): The problem I am having is that the built-in captions are too narrow.
In general, to control the width of objects in TeX, you can use a minipage, for instance:
\begin{minipage}[t]{1.85in}
\caption{ Why would you eat a pickle? }
\end{minipage}
However, with a caption you might need to do something different as it could very well be a macro.
To change the formatting of the standard LaTeX classes without using a package, you need to look at the source of the standard LaTeX classes and alter the original definitions in your own document. Printing captions is done by the macro \#makecaption, which has definition (in article.cls):
\long\def\#makecaption#1#2{%
\vskip\abovecaptionskip
\sbox\#tempboxa{#1: #2}%
\ifdim \wd\#tempboxa >\hsize
#1: #2\par
\else
\global \#minipagefalse
\hb#xt#\hsize{\hfil\box\#tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
If you wrap the whole thing in a minipage environment (as suggested to be done manually in the other answers), you should get the results you want.
Is it easier than loading a package? Not really, but it can be instructive.
There's nothing too magical about \caption; it just consults a figure/table number and than formats your text at a font and size that the document class likes. So you can control its width the same way you'd control the width of any text:
Wrap the \caption{...} in a \parbox or a \begin{minipage}...\end{minipage}.