How to write URLs in Latex? [closed] - url

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
How do you write a URL in Latex?
The subscripts and everything else make the font look very strange when it compiles.

You can use \url
\usepackage{hyperref}
\url{http://stackoverflow.com/}

You just need to escape characters that have special meaning: # $ % & ~ _ ^ \ { }
So
http://stack_overflow.com/~foo%20bar#link
would be
http://stack\_overflow.com/\~foo\%20bar\#link

Here is all the information you need in order to format clickable hyperlinks in LaTeX:
http://en.wikibooks.org/wiki/LaTeX/Hyperlinks
Essentially, you use the hyperref package and use the \url or \href tag depending on what you're trying to achieve.

A minimalist implementation of the \url macro that uses only Tex primitives:
\def\url#1{\expandafter\string\csname #1\endcsname}
This url absolutely won't break over lines, though; the hypperef package is better for that.

Related

How can I highlight text in latex [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
How can i highlit text in latex.
Thank you.
As is pictured here(in red circle):
If you mean making the text bold by Highlighting you can use \textbf for making the text bold but highlighting has a different general meaning that is implemented by \hl keyword.
\documentclass{report}
\usepackage{color} % for the command \textcolor
\usepackage{soul} % for the command \hl
\begin{document}
\hl{foo}
\hl{\textbf{foo}}
{my garden }
\textbf{black}{foo}
{my good job}
\textbf{\textcolor{red}{\hl{foo}}}
\textcolor{red}{\textbf{\hl{foo}}}
\end{document}
this is the result :
As you can see the word "black" is highlighted the way you desired.
The word "foo" is highlighted in the general meaning of highlighting.
This links look useful:
Insert symbols inside verbatim mode LaTeX
Putting math inside a verbatim environment without altering the formatting
If you just wanted graph.exe I would suggest using \begin{verbatim} graph.exe \end{verbatim} or \verb+graph.exe+ .
However you want to use the <..> expression which can be created with $ \langle ... \rangle $ . The $..$ indicates inline math mode. Those two links discuss getting verbatim text in math environments.
I think tex.stackexchange.com will be more helpful rather than stack overflow.

How to keep symbols, slash, ... in your document? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
I want to keep all the symbols in my following text in LaTeX. but I don't know which syntax I should use to keep them. Can anybody give a suggestion?
/forest # search for forest
/<\/way> # find the tag </way>
v # start the visual mode
?<way # find the begin of the tag -> mark <way> until </way>
D # delete that tag
Just put them in verbatim environment, like this:
\begin{verbatim}
...
things you want to keep them as is
...
\end{verbatim}
For inline mode, you can use \verb command:
\verb=...things you want to keep them as is...=
Check out here for more info:
[...] If you use the verbatim environment, everything input between the begin and end commands are processed as if by a typewriter. All spaces and new lines are reproduced as given, and the text is displayed in an appropriate fixed-width font. Any LaTeX command will be ignored and handled as plain text. This is ideal for typesetting program source code. [...]

How to delete text in all occurences of a specific tag in Latex [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
In my latex document I have use the tag \sout , to strike out some texts, in many places. Is there a one-shot way to delete the text in all the occurrences of the tag along with the tag ?
You could redefine the way \sout works by including the following in your document preamble:
\renewcommand{\sout}[1]{\unskip}
Here's an example illustrating the effect:
\documentclass{article}
\usepackage{ulem}% http://ctan.org/pkg/ulem
\begin{document}
Here is some \sout{text} stuff.
\renewcommand{\sout}[1]{\unskip}
Here is some \sout{text} stuff.
\end{document}
If you're using an editor that allows for searching with regular expressions, then you could do a find for the regular expression \\sout\{[^\}]+\} (note that this is untested) and replace with an empty string or space.

What can cause \ref{} of LaTex output a [??] [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I include a figure like this
\begin{figure*}
\begin{center}
\includegraphics[width=6.7in]{pic/recall_details.png}
\caption{ Recalls of test query MB002-MB049}
\label{ recall_details}
\end{center}
\end{figure*}
And then I refer it using \ref{recall_details}. Instead of getting numbers like 1, 2, I get ??. Literally I mean ??. What is wrong with my codes? How to make the references show correctly?
You should "compile" your latex code twice to get numbers instead of question marks
The issue is that you're referencing \ref{recalls_details}, but you've defined \label{ recalls_details}. That extra space before recalls_details is what gets you ?? instead of the figure number. You should either change the \ref to \ref{ recalls_details} or the \label to \label{recalls_details}.
On another note, I suggest you add a modifier at the start of the label, such as fig: in this case: \label{fig:recalls_details}. This is useful when you have different types of labels (e.g. to sections, sec:, and to equations, eqn:).
The bottom line is to always use the exact string you give within the \label{} in the relevant \ref{}.

\textnumero and font encoding [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
I currently use the \textnumero sign in my LaTeX document. Therefore, I need to include the 'textcomp' package. When doing so I get a compiler error stating:
! Package textcomp Error: Symbol \texnumero not provided by
(textcomp) font family ptm in TS1 encoding.
(textcomp) Default family used instead.
\usepackage[T1]{fontenc}
\usepackage{times}
\usepackage{ucs}
\usepackage[latin1]{inputenc}
\usepackage[textcomp]
%... somewhere in the document
\textnumero ...
How can I get rid of this message? Can I set some other font or encoding for the number sign only?
Many Thanks,
Ovanes
If you want to avoid the bother of changing fonts (for example, you want to keep times), try this:
\usepackage{txfonts}
\usepackage{times}
\newcommand{\ftextnumero}{{\fontfamily{txr}\selectfont \textnumero}}
...
\ftextnumero 1
...
Ok, I got it. Changing to font which has this sign solved the issue.
\usepackage{savesym}
\usepackage{amsmath, amsfonts, amsthm, amssymb}
\savesymbol{iint}
\usepackage{txfonts} % this is the font
\restoresymbol{TXF}{iint}
\usepackage{ucs}
\usepackage[ansinew]{inputenc}
\usepackage{textcomp}
Note! savesym package is now needed to avoid errors, that iint is already defined.
Regards,
Ovanes
this worked for me:
\usepackage[warn]{textcomp}
(taken from here)

Resources