How can I write this function (image) in Latex? [closed] - latex

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
How can I write this function (image) in Latex?

This should lay a sufficient foundation:
\documentclass{article}
\setlength{\parindent}{0pt}% Just for this example
\begin{document}
$f \colon \{0,1\}^N \rightarrow \{0,1\}^M$
$f \colon \{0,1\}^N \mapsto \{0,1\}^M$
\end{document}
You can change the spacing around : (or \colon) as needed, perhaps using f~\colon~.

Related

Is there any way i can enclose a 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 programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
first of all i'm new in latex
I wanted to ask if there is a way where i can enlose a text like a code like here in stack overflow thank you very much.
Ive searched here but i dont really know what to seek or how to ask something like this.
I don't know what do you mean by code like text. But you can use \verbatim to display some code like the following if this is what you wanted:
\begin{verbatim}
for i in range(1, 20):
print i
else:
print "the loop is done"
\end{verbatim}

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.

margins of book class 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 10 years ago.
Improve this question
I would know which are the margins (in meters) top,right,bottom and left, default assigned for bookclass. there is a command or a way to know them?
It depends on whether you want to include the header/footer and possibly even if you use twoside document. Perhaps the following minimal working example can be a start:
\documentclass{book}
\usepackage{layouts}% http://ctan.org/pkg/layouts
\begin{document}
\pagevalues
\end{document}
uses the layouts package to produce
All units are printed in points by default, and there are 0.0351459 points per cm. Note that LaTeX does not use metres as a valid length.

Tweaking \autoref to behave somewhat like \vref [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 would like to modify the \autoref command in the following way: if the \autoref command and the label are on the same page, it behaves like \autoref* (i.e., no hyperlink). Else, it behaves usually.
Thanks,
Vishnu
If you can use \myautoref instead of \autoref, the following will work as you wished:
\documentclass{article}
\usepackage{lipsum}
\usepackage[pdftex,colorlinks]{hyperref}
\makeatletter
\def\my#setref#1#2#3{%
\ifx#1\relax\protect\G#refundefinedtrue
\else\expandafter#2#1\fi}
\def\pagenum#1{\expandafter\my#setref\csname
r##1\endcsname\#secondoffive{#1}}%
\def\myautoref#1{\def\refnum{\pagenum{#1}}%
\ifnum\refnum=\thepage\relax\autoref*{#1}%
\else\autoref{#1}\fi}
\makeatother
\begin{document}
\section{First}\label{first}
\lipsum[1-3]
\myautoref{first}
\lipsum[4-8]
\myautoref{first}
\end{document}
I had to solve a similaire problem and found something shorter (more easy to understand for me):
\usepackage{ifthen}
\newcommand{\myautoref}[1]{
\ifthenelse%
{\equal{\pageref{#1}}{\thepage}}%
{\autoref*{#1}}%
{\autoref{#1}}
}

How to write URLs 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 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.

Resources