Tag Info

Hot answers tagged

90

To typeset accented characters inside bibliography fields for processing with BibTeX, encase them in curly braces. To list but a few accented characters: {\"a} {\^e} {\`i} {\o} {\'u} {\aa} {\c c} {\u g} {\l} {\~n} {\H o} {\v r} {\ss} The word Birkhäuser should therefore be entered as Birkh{\"a}user. Addendum: There is an obvious follow-up question to ...


51

(This is fairly basic stuff, but perhaps it's worth repeating it.) The following ten characters have special meanings in (La)TeX: & % $ # _ { } ~ ^ \ Outside \verb, the first seven of them can be typeset by prepending a backslash; for the other three, use the macros \textasciitilde, \textasciicircum, and \textbackslash. \documentclass{article} ...


42

I don't know precisely. The special characters are # $ % ^ & _ \ { } The first six are in the upper row of the keyboard, together with @. I'm excluding those that are more commonly used in text, that is ! ( ) - + =. The other non alphabetic ASCII characters ([];:'"|,<.>/?) are used in text. The choice of \ as the escape character for the ...


37

Save your file as UTF-8 and put \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} % load a font with all the characters in your preamble. Then you can just type the characters normally into your source file. Or, use XeLaTeX or LuaLaTeX which accepts UTF-8 input natively. In that case you need to add \usepackage{fontspec} to ...


36

You can type texdoc lshort in a command line (Command Prompt on Windows, Terminal on Linux/Mac OS X). Then have a look at Table 2.2 in Section 2.4.8. I'll quote it for you here.


34

Best package for the job is manuscript \documentclass{article} \usepackage{manuscript,lipsum} \begin{document} \lipsum[1-3] \end{document}


33

You need to enclose the \ss macro in braces: (it's also a good idea to enclose the \" within the braces of the 'o'.) Gei{\ss}ler, J{\"o}rg Otherwise, TeX can't tell whether the macro is \ss or \ssler. Usually macros can also be delimited by spaces in LaTeX, but this won't work in your bib file because the space is used by BibTeX to delimit parts of ...


32

You can use the \textcolor command from the xcolor package to give a color to each character of the logo. Running texdef -t latex LaTeXe in a terminal, you can get the implememtation of the LaTeX2e logo: \mbox {\m@th \if b\expandafter \@car \f@series \@nil \boldmath \fi \LaTeX \kern .15em2$_{\textstyle \varepsilon }$} Since the \LaTeXe command is ...


27

You may prefer the character from the tt font: \documentclass{article} \begin{document} \texttt{Samp\_Dist\_Corr} \verb|Samp_Dist_Corr| \texttt{Samp\char`_Dist\char`_Corr} Or probably better add \usepackage[T1]{fontenc} then all the above forms will use the character from the font. \end{document}


27

There are canonical ways to fix both of these problems. For the underscore: \usepackage{underscore} For the rendering of < and >: \usepackage[T1]{fontenc} \usepackage{lmodern}


26

With the following setup, you can just type these characters normally, and the copy-paste text in the pdf (the OCR layer) will be correct, too. Your source .tex document should be encoded in UTF8, of course, or you could use latin1, or some other input encoding that includes the characters you desire and is listed in the inputenc documentation. % !TEX ...


25

The information about 1ex is stored in the font; it is usually the height of a lowercase ‘x’, but it need not be necessarily. You can access the height of an uppercase ‘X’ by \fontcharht\font`X A way for expressing lengths in this ‘unit of measure’ is \newcommand{\eX}{\dimexpr\fontcharht\font`X\relax} so you can say something like \vspace{1.2\eX} ...


22

With the graphicx package, you can do it as follows: \rotatebox[origin=c]{180}{B} This rotates around the center of the letter. You can also rotate around other points: \rotatebox[origin=tr]{180}{B} will rotate around the top right of the box. See page 8 of this document for all the relevant options. Following from what egreg pointed out, you may need a ...


21

Type \&. This is a very basic question covered by all introductory material on LaTeX. You should consider taking a look into such an introduction (for example lshort.pdf, 1.3.2).


20

If using LuaLaTeX rather than XeLaTeX is an option for you -- fortunately, Lua(La)TeX and polyglossia have started playing nice with each other, beginning a few months ago -- you may achieve your goal as follows. First, define an "OpenType feature file", such as # Scripts and languages # If the font uses others, they should be defined here too ...


19

The “official” way, is to activate stylistic set 5 feature, StylisticSet=5 fontspec option. If you to use it locally then you can define a “font family” with that option, and if you want it globally you should pass it to \setmainfont. This is also the most portable way, as the glyph name (W.alt) or the private use area code point (U+E02F) can change in the ...


18

The ccicons package seems to be what you are looking for. (I've never used it myself though.) With the command ccLogo you will get one of these: There is also a cclicenses package, but the icons are not as clear nor as up-to-date.


18

Usually text like that is typeset in typewriter type and so there's a slick way to arrange it \verb|[RegularExpression(@"\d+")]| After \verb should go a character that's not used in the text to print "verbatim" and the same character should follow the text. This command has a drawback: it can't be used in the argument of other commands. There's a ...


17

The Basic grid behing the character is shown, also there is a new command added \Grid{}, to insert the needed glyph inside a specific grid: \documentclass{article} \usepackage{xeCJK} \usepackage{tikz} \setCJKmainfont{KaiTi} % \newcommand\Grid[1]{% \tikz[baseline=(char.base)]{% \draw[xstep=1ex,ystep=1ex,help lines] (-1ex,-1ex) grid (1ex,1ex); ...


17

Usually such an arrow is created using \to in mathmode which is also accessible as \rightarrow. Dexify also lists \textrightarrow (for text mode), \shortrightarrow and \longrightarrow. Using the right settings you should also be able to use → as an unicode character directly. This, however, depends also on the used compiler (PDFLaTeX, LuaLaTeX or XeLaTeX). ...


16

With XeLaTeX, use the fontspec package instead of fontenc. For details, see Frequently loaded packages: Differences between pdfLaTeX and XeLaTeX. \documentclass{minimal} \usepackage{fontspec} \usepackage{polyglossia} \setmainlanguage[babelshorthands=true]{german} \begin{document} Das "`s"' in "`daß"' muß (Achtung, "`muss"' schreibt man normal so) einsam ...


15

These characters are available in font encoding T2A, for example. They can be used without babel: \documentclass{article} \usepackage[T2A,T1]{fontenc} \begin{document} U+04B2: {\fontencoding{T2A}\selectfont\CYRHDSC} U+04B3: {\fontencoding{T2A}\selectfont\cyrhdsc} \end{document} In order to avoid PK-Fonts the package cm-super should be installed.


15

You can use \textunderscore also. \documentclass{article} % \begin{document} Samp\textunderscore Distt\textunderscore Corr \texttt{Samp\textunderscore Distt\textunderscore Corr} \end{document} Underscore is not merging at the bottom of D actually. It is very close to it.


15

The main problem is in the usage of the OT1 encoding, instead of T1; in the former, the đ and Đ characters are constructed and the construction doesn't work well with the TX fonts. Switching to T1 has also the benefit that words containing letters with diacritics will be hyphenated properly, which doesn't happen with OT1. ...


15

In PDFTeX/XeTeX colouring is done by inserting pdfliteral nodes around coloured items, these nodes would then interfere with mark positioning in this case, something like: <base><start-color><mark><stop-color> LuaTeX can use an alternate mechanism thanks to its "attribute" registers; attributes is a way to annotate input without ...


14

Your special characters are in the wrong font table that is loaded by default! Printing them using a different character set will bring them back! \documentclass{minimal} \begin{document} \texttt{\char`\\}\\ \texttt{\char`\{}\\ \texttt{\char`\}}\\ \end{document} See Why do lower case mathcal letters show up as random symbols? for some help as to how ...


14

The >> becomes a ligature ». You can break it by braces, in various ways, such as by >{>}>


14

The contour package can do this, too. You'll need to use Type 1 fonts (check the documentation); here is sample code \documentclass[12pt,a4paper]{article} \usepackage[T1]{fontenc} \usepackage{pslatex} \usepackage{contour} \usepackage{color} \pagestyle{empty} \begin{document} \contourlength{2pt} %how thick each copy is \contournumber{20} %number of copies ...


14

The text along path decoration can be altered slightly to set the indivdual characters upright. This solution requires a bit of manual adjustment using raise and text align/left indent to get the positioning right, but it works quite well. It supports all the options of the original text along path decoration, as described in the manual. To use text ...



Only top voted, non community-wiki answers of a minimum length are eligible