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.

How do I get LaTeX to just print the following lines as plain text? The angled brackets are messed up when I compile the .tex file into .ps

the main texts are bounded by <p>...</p> within the <div class = paragraph section> ...</div> attributes

How do I change fonts for a single line in LaTeX? E.g. I want the 2nd line to be in Courier New font but the 1st line to be in the normal default font.

Httrack  was used for data collection.
**Only raw HTML were downloaded without embedded media files.**

How do I enable Vietnamese and Chinese fonts in LaTeX? I want to display the following lines in LaTeX:

乌节路 wujielu “Orchard road” was wrongly segmented as 乌 节路 wu jielu “black joint-road”

‘quốc tế’ mean international, but seperating them by whitespaces could have caused a mis-tokenization

How do I get a tab in a line in LaTeX? E.g.

this    is  a   tabulated   line    
share|improve this question
    
Welcome to TeX.sx! Your question was migrated here from another stackexchange site. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  Tobi Dec 12 '11 at 20:31
4  
Please edit your post to and reduce it to one single question. You may post the others as new questions. All your problems can be solved but it’s better to have them in separated questions. –  Tobi Dec 12 '11 at 20:31
add comment

migrated from stackoverflow.com Dec 12 '11 at 18:49

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 4 down vote accepted

Listings

\documentclass{article}

\usepackage{listings}
   \lstset{%
      basicstyle=\ttfamily,
      language=HTML,
   }
   \lstMakeShortInline|

\begin{document}
   Normal Text |<p>| normal text
   \begin{lstlisting}
       <html>
         <head>
           <title>Hello HTML</title>
         </head>
         <body>
           <p>Hello World!</p>
         </body>
       </html>
   \end{lstlisting}
\end{document}

See the package documentation for more information, e.g. automatic syntax highlighting.

Vietnamese/Chinese

I guess XeLaTeX or LuaTeX can help. Both are able to process Unicode. All you need is a font containing the vietnamese/chinese characters.

Tabs

\documentclass{article}

\begin{document}
   \begin{tabbing}
      Text \= Text \= Text\kill
      a \> b \> c \\
      ddd\> ee \> f \\
   \end{tabbing}
\end{document}

See your preferred LaTeX book/manual for mor information

share|improve this answer
    
Tobi, I realized that when i use {tabbing}, it leaves a large space before it begins the next line. Anyway to resolve that? –  alvas Dec 12 '11 at 20:57
    
@2er0: See “Removing vertical space before and after tabbing environment” … –  Tobi Dec 13 '11 at 11:54
add comment

I believe you can also use the verbatim environment and the fancyvrb package.

\begin{verbatim}[options]
  your text
\end{verbatim}

and "your text" will be typeset exactly as you have typed it in your .tex file and the options can be used to declare fonts. some of the options are fontseries, fontshape, fontsize, etc...

Check the package info for fancyvrb for all of the available options.

As for your font type:

{\fontfamily{fontname}
\fontsize{fontsize}{CAPSsize}\selectfont{your text}
}

Just enter your "fontname", the two sizes (just numbers, no units) and put the text your want to alter in the braces of \selectfont.

share|improve this answer
    
\selectfont doesn’T have an Argument. Your braces don’t have an effect for this. The magic braces in this case are the one before \fontfamily and the last on. YOu should also mention that \fontfamily requires the LaTeX (short) name of a font. The first size of \fontsize is (nearly) the capital letter height and the second one the line height! –  Tobi Dec 13 '11 at 16:08
    
@Tobi Thanks for the corrections. –  Steve Dec 13 '11 at 19:18
add comment

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.