8

I want to write this :

(username:password)

this :

\documentclass{article}
\usepackage[frenchb]{babel}

\begin{document}
   (username:password)
\end{document}

give me :

(username :password) % there a space added by babel before ':'
7
\documentclass{article}
\usepackage[english,frenchb]{babel}

\begin{document}
{\shorthandoff{:}%
 (username:password)}

\foreignlanguage{english}{(username:password)}   

(username:password)
\end{document}
  • Sur it work in my case. But if I want to write something that doesn't respect English nor French rules? – Hunsu May 23 '14 at 9:05
  • My example contains two possible solutions. Choose the one you like better or is better adapted to your case. If you don't want hyphenation at all you can also disable it completly. – Ulrike Fischer May 23 '14 at 9:09
  • Sorry I haven't understood your solution the first time! – Hunsu May 23 '14 at 9:21
  • 2
    @UlrikeFischer Sometimes, a little text to explain the answer is useful :-) – ppr May 25 '14 at 12:22
1

If you want LaTeX to print text without formatting, you should use the verbatim environment. This environment will print exactly what you wrote, without any modifications.

MWE:

\documentclass{article}
\usepackage[frenchb]{babel}

\begin{document}
\begin{verbatim}
(username:password)
\end{verbatim}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.