LaTeX \url{} in italics - url

Is there a simple way of getting a LaTeX url to display in italics, i.e. emph{\url{http://www.stackoverflow.com}}? FYI I am also using \urlstyle{same} right before, which keeps the style looking like the document default style, but I don't want to set my document default to italics.

You can easily set urls to italic text by setting the UrlFont in the document, like so:
\documentclass{article}
\usepackage{url}
\begin{document}
\def\UrlFont{\em}
\url{http://www.address.com}
\end{document}
The url should appear in italics.

You might want to try setting \UrlFont to \itshape, i.e.
\renewcommand\UrlFont\itshape

This worked for me,
\textit{\url{etcetcetc.com}}
using
\usepackage{url}

Related

Is there a way to convert PowerPoint theme to LaTeX beamer theme?

I've found quite a few ways to convert the contents of the presentation to .tex file, but that's not what i need.
At job i have to use PowerPoint template, but i'd rather use LaTeX to create presentation itself. Maybe there is an easy way to modify existing beamer theme by adding pictures at the top and the bottom of every slide?
There is indeed an easy way to modify existing beamer themes by adding pictures at the top and the bottom of every slide:
\documentclass{beamer}
\setbeamertemplate{footline}{\includegraphics[width=\paperwidth,height=1cm]{example-image-duck}}
\setbeamertemplate{headline}{\includegraphics[width=\paperwidth,height=1cm,page=2]{example-image-duck}}
\begin{document}
\begin{frame}
abc
\end{frame}
\end{document}

LaTeX - Set small fontsize for the entire document

I want to change the font size to small for the entire document. I have searched online. But I am not able to find a reasonable (one line) answer. Is this possible to change the font size of latex document by only one command.? Thanks.
I think either
\documentclass[10pt]{article}
where you replace 10 with whatever font point-size you want, or, perhaps less likely,
\begin{document}
\small
where you replace \small with whatever size-command you want, might be what you are looking for.

why is latex making my caption bold?

I don't know why latex is making my captions bold.
\section*{附录}
\begin{figure}[htbp]
\centering
{
\label{fig:ILOVEYOU}
\includegraphics[scale=2.7]{ILOVEYOU.jpg}
}
\caption{ILOVEYOU蠕虫邮件}
\end{figure}
I added a figure with a caption earlier and it wasn't bolded.
Thank you!
I've found a way to get around it. All I did was add some text after the section and before the first figure. If there isn't text, everything is bold. I realized this later when I noticed that not only the caption was bold but so was the footer.
I don't know why it's like this or how to fix it, but adding a few explanatory sentences before my figures works for me.

How to make a hyperlink navigate to the top of the figure in LaTeX when using hyperref?

I have a LaTeX document with a figure and references to it:
\begin{figure}
...
\caption{...}
\label{fig:1}
\end{figure}
\ref{fig:1}
I use the hyperref package to get hyperlinks in the resulting PDF.
However the link to the figure navigates to the caption leaving the figure itself out of the view. How can I make it navigate to the start of the figure instead without moving the caption to the top?
Add this in your preamble
\usepackage{hyperref}
\usepackage[all]{hypcap} %for going to the top of an image when a figure reference is clicked
Make sure that the \usepackage[all]{hypcap} is written after the hyperref package is imported.
To previous comment:
\usepackage{hyperref}
\usepackage{caption}
is slightly better than \usepackage[all]{hypcap} because when you use e.g. figure without captions there won't be a compilation problem. The caption package by default sets option
hypcap=true
anchoring hyperlinks to the beginning of an environment.
\usepackage{hyperref}
\usepackage{caption}
Using this is a better idea than \usepackage[all]{hypcap}.

latex template or example for personal statement

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:

Resources