Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have the following piece of text which I want to output literally: <<"Welcome">>. However it's converted to those funky quotations. I've been trying all sorts of things with \ mostly but to no avail.

\verb=!<<"Welcome">>! kind of works, or gets the job done, but then it loses all other formatting (font face, size, etc.) as well.

share|improve this question
    
    
@stephan, your \! does not appear.. –  Yossi Farjoun Feb 14 '11 at 14:54

3 Answers 3

up vote 6 down vote accepted

A quick solution would be to use inline math mode: $<<$``Welcome''$>>$

edit: if you want to preserve formatting, have you considered \textgreater and \textless ?

share|improve this answer
    
No I haven't, but I'll google what they are about! –  Till Feb 13 '11 at 21:10
    
Thanks again for the quick help! –  Till Feb 13 '11 at 21:14

I don't think the less-than and greater-than signs are that pretty here. You might try instead:

  • $\langle\langle$``Welcome''$\rangle\rangle$ for angle brackets that are narrower and taller than the mathematical relations.
  • ![\guillemotleft``Welcome''\guillemotright][1] for french quotation marks. Make sure you also have \usepackage[T1]{fontenc} in the preamble.

enter image description here

To be honest I don't think any of those look that pretty, but it is what you asked for. :-D

share|improve this answer
    
And $\ll$, $\gg$ –  Leo Liu Feb 13 '11 at 20:12
    
@Leo Liu: good one. I added it to my answer. –  Matthew Leingang Feb 13 '11 at 20:23
    
It's a code listing. I have pretty much no control over what it says and I need to display it. Thanks though, I learned a lot! –  Till Feb 13 '11 at 21:10

This may be what you want:

enter image description here

\documentclass{article}
\usepackage[T1]{fontenc}

\begin{document}

\guillemotleft``Welcome''\guillemotright

\end{document}

For code listing, you can use listings package:

enter image description here

\documentclass{article}
\usepackage[T1]{fontenc}

\usepackage{listings}
\lstset{
  basicstyle=\ttfamily,
  columns=fixed,
  literate={<<}{\guillemotleft}1 {>>}{\guillemotright}1
}

\begin{document}

\lstinline!<<"Welcome">>!

\end{document}

You can modify the literate as you wish.

share|improve this answer
    
Looks pretty sweet and I salute you for you fu! Unfortunately, it's a code listing. But I will keep this in mind! –  Till Feb 13 '11 at 21:09
    
@Till: You didn't mention that. My previous solution use lisings package especially for code listing. But I thought it's normal text and deleteted it. You may have a look at the edit history of this question (click the time after edited). –  Leo Liu Feb 13 '11 at 21:31
    
I recovered the previous solution. –  Leo Liu Feb 13 '11 at 21:34
    
Thanks for editing and extending your answer. I'll make sure to provide more details next time. –  Till Feb 13 '11 at 22:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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