Tag Info

Hot answers tagged

116

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} {\.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 ...


60

(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 ...


39

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.


38

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 ...


37

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}


35

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 ...


34

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


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

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 ...


26

Fancy anarchy with TikZ: \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing} \tikzset{mydeco/.style={decoration={random steps,segment length=.6,amplitude=.5},decorate,line cap=round}} \tikzset{anarchy/.pic={ \draw[ultra thick,mydeco,decorate,red,fill=red](0,0)--(1,.3)--cycle; \draw[ultra ...


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} ...


23

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 ...


23

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 ...


22

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 ...


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

It is definitely not 0xFF, but “Control-L” or ASCII 0x0C (decimal 12), called “form feed” (this is why your viewer shows it as FF). As you probably know, Knuth started using computers when they weren't like the ones we use today. When the teletype was the only interface, character Control-L was used to tell the teletype “advance to the end of the form”, so ...


17

This allows only plain Latin letters (no accents). Something more complicated would be needed to accommodate accented letters. \documentclass{article} \usepackage{xparse} \usepackage{tgbonum} % wide chars \ExplSyntaxOn \NewDocumentCommand{\numberletters}{m} { \group_begin: \huge\raggedright \martinb_nl_numberletters:n { #1 } \par \group_end: } ...


17

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 ...


16

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 ...


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.


14

An alternative is the memoir class with the option ms. By default, the emphasis is simply ignored in this way, but adding the ulem package the text with emphasis is underlined. You can also add the xcolor package to introduce some red text. At least at the end of typerwritter era was usual the two-color ink ribbons, and therefore was usual highlight ...



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