15

How can I use the character (25CC): http://www.fileformat.info/info/unicode/char/25cc/index.htm ?

I am using MikTex (pdflatex) under Window; I am importing the following packages:

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

When pasting the character into my document, I receive the following error message:

! Package inputenc Error: Unicode char \u8:Γùî not set up for use with LaTeX.

I read about using utf8x instead of utf8, but this package is incompatible to biblatex.

How can I solve this one?

EDIT: Thanks for all the responses and the various ways to draw circles! I should have mentioned that I need the circle to be combined with diacritic marks (see http://en.wikipedia.org/wiki/Dotted_circle ) - the result then looks like this:

◌̊

Thus, the XeLaTeX seems to be the way to go in my case.
Matthias
  • 365
  • 6
    Is using XeLaTeX an option? – doncherry Oct 15 '13 at 10:50
  • 7
    First of all, you need to find a TeX font that has the glyph. – egreg Oct 15 '13 at 11:04
  • @doncherry: I was trying to avoid switch the latex processor because I fear other incompatibilities. I am currently trying it out and already ran into this one: http://tex.stackexchange.com/questions/36543/error-pdflatex-exe-the-memory-dump-file-could-not-be-found (a path without spaces seems to have fixed it). egreg: Arial has it (displays fine in Word). – Matthias Oct 15 '13 at 11:08
  • @doncherry: XeLaTeX fails on the letter 'ü' with error message: "Keyboard character used is undefined in inputencoding 'utf-8'". So much for Unicode-support. – Matthias Oct 15 '13 at 11:51
  • 3
    @winSharp93 Did you use \usepackage{fontspec} and remove inputenc and fontenc? See http://tex.stackexchange.com/questions/2984/frequently-loaded-packages-differences-between-pdflatex-and-xelatex. – doncherry Oct 15 '13 at 11:57
  • @egreg I posted an answer based on your comment. Is that ok? :D – Alenanno Oct 15 '13 at 12:00
  • @doncherry: Thanks, that did the trick! So far, the result looks very promising. – Matthias Oct 15 '13 at 12:12
  • 1
    If you want to stick with pdflatex the stix-beta distribution is packaged for classic tex and includes \dottedcircle – David Carlisle Oct 15 '13 at 14:37
  • See also my edit: Because I need to combine the circle, the graphic solutions are nice, but not ideal in my case. I'll go with XeLaTeX. Thanks again for all your ideas and answers! – Matthias Oct 16 '13 at 06:54

5 Answers5

19

As suggested in the comments, you could set your font to one that supports Unicode (this solution requires XeLaTeX):

image

\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\usepackage{fontspec}

\setmainfont{Arial Unicode MS} % Other fonts that might work: Hiragino Maru Gothic Pro, Lao Sangam MN, Inaimathi, Microsoft Sans Serif

\begin{document}\huge

\noindent a b c \\
◌ \\
ä ë \\
à è \\
ç 

\end{document}
David Carlisle
  • 757,742
Alenanno
  • 37,338
16

You can prepare the following file dottedcircle.tex

\documentclass[preview]{standalone}
\usepackage{fontspec}
\setmainfont{Charis SIL}
\begin{document}
^^^^25cc
\end{document}

and compile it with XeLaTeX or LuaLaTeX. Choose a font you have on your system and has the glyph.

Then you can use the PDF in your pdflatex documents with this strategy:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx,newunicodechar}
\newunicodechar{◌}{\includegraphics{dottedcircle}}

\begin{document}
a b c ◌ ä ë
\end{document}

enter image description here

If you have the Stix fonts installed, you can use them:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{newunicodechar}

\DeclareFontEncoding{LS1}{}{}
\DeclareFontSubstitution{LS1}{stix}{m}{n}
\DeclareFontFamily{LS1}{stixscr}{\skewchar\font127 }
\DeclareFontShape{LS1}{stixscr}{m}{n} {<->s*[.7] stix-mathscr}{}

\newunicodechar{◌}{{\usefont{LS1}{stixscr}{m}{n}\symbol{\string"E3}}}


\begin{document}
a b c ◌ ä ë
\end{document}

enter image description here

egreg
  • 1,121,712
11

This uses the stackengine package to construct the glyph from \circ.

\documentclass{article}
\usepackage{stackengine}
\usepackage{xcolor}
\usepackage{graphicx}
\def\dottedcirc{\color{white}%
\stackinset{c}{}{c}{-.4pt}{--}{%
\stackinset{c}{}{c}{-.5pt}{--}{%
\stackinset{c}{}{c}{.1pt}{\rotatebox{90}{$-$}}{%
\stackinset{c}{}{c}{.1pt}{\rotatebox{45}{$-$}}{%
\stackinset{c}{}{c}{.1pt}{\rotatebox{-45}{$-$}}{%
\textcolor{black}{$\circ$}%
}%
}}}}\color{black}}
\begin{document}
x\dottedcirc y
\end{document}

enter image description here

I EDITED the solution when I found that a lower-case o immediately preceding the \dottedcirc was slightly overlapped. Here I use two slightly overlapped n-dashes (--) in lieu of a minus sign ($-$) for the horizontal whiteout stroke.

If you substitute red for white, you can see how the stack is formed:

enter image description here

Based on comment from OP, I cannot easily make the dashed circle dotted in the sense of using small circles around the perimeter. However, I can subdivide the sircle more frequently with smaller dashes, giving a similar appearance:

\documentclass{article}
\usepackage{stackengine}
\usepackage{xcolor}
\usepackage{graphicx}
\def\dottedcirc{\color{white}%
\stackinset{c}{}{c}{-.4pt}{--}{%
\stackinset{c}{}{c}{-.5pt}{--}{%
\stackinset{c}{}{c}{.2pt}{\rotatebox{90}{$-$}}{%
\stackinset{c}{}{c}{.2pt}{\rotatebox{30}{$-$}}{%
\stackinset{c}{}{c}{.2pt}{\rotatebox{60}{$-$}}{%
\stackinset{c}{}{c}{.2pt}{\rotatebox{-30}{$-$}}{%
\stackinset{c}{}{c}{.2pt}{\rotatebox{-60}{$-$}}{%
\textcolor{black}{$\circ$}%
}%
}}}}}}\color{black}}
\begin{document}
x\dottedcirc y
\end{document}

enter image description here

which, blown up, is

enter image description here


Look for V3.21 of stackengine to be propagated in the coming days, to fix a bug associated with \stackinset, when using l or r horizontal justification.

  • Thanks for the effort; but this produces a dashed circle which is slightly different from the dotted one. I really would like to have the actual character. – Matthias Oct 15 '13 at 12:12
  • @winSharp93 Your pointed-to website http://www.fileformat.info/info/unicode/char/25cc/index.htm shows it as dashed. But I appreciate your needs may vary – Steven B. Segletes Oct 15 '13 at 12:22
  • Wikipedia has it with dots: http://en.wikipedia.org/wiki/Dotted_circle - so it is font dependent. Nevertheless, it's always nice to see what's possible with LaTeX, so thanks again for your input :-) – Matthias Oct 15 '13 at 13:01
9

Sigh Someone's got to do it: If you don't mind loading a full-fledged graphics framework for the job, you can of course use TikZ (using the approach from Dotted lines in TikZ with round dots to get round dots):

\documentclass{article}
\usepackage{tikz}
\newcommand\dottedcircle{\tikz \draw [line cap=round, line width=0.25ex, dash pattern=on 0pt off 2pt] (0,0) circle [radius=0.75ex];}

\begin{document}
A dotted circle: \dottedcircle
\end{document}

Same result can be obtained via low-level PGF commands

\documentclass{article}
\usepackage{pgf}
\newcommand\dottedcircle{%
\begin{pgfpicture}
\pgfsetlinewidth{0.25ex}
\pgfsetroundcap
\pgfsetdash{{0cm}{2pt}{0cm}{2pt}}{0cm}
\pgfcircle{\pgfpointorigin}{0.75ex}
\pgfusepath{stroke}
\pgfsetbaseline{-0.75ex}
\end{pgfpicture}%
}
\begin{document}
A dotted circle: \dottedcircle
\end{document}

or for the adventurous ones with pure pdf specials (not recommended, just for fun, random size it will give a bigger circle)

\documentclass{article}
\begin{document}
A dotted circle: 
\pdfliteral{1 0 0 1 10 10 cm 1 J [0 2] 0 d 1 w  0 -10 m 9 -10 10 0 v 10 9 0 10 v -9 10 -10 0 v -10 -9 0 -10 v S }
\end{document}
Jake
  • 232,450
8

This is my 2nd answer, which is a different approach than the other, and driven by the OP's request to use dots rather than dashes. Here, I use the fp package to build up a series of scaled dots into a circle. There are four settable parameters for the code, including: degree separation of dots around unit circle, radius of circle in ex's, size of dots relative to a period, and overall character width in terms of circle radius.

\documentclass{article}
\usepackage{stackengine}
\def\usestackanchor{T}%
\usepackage{ifthen}
\usepackage{fp}
\usepackage{graphicx}
\newcounter{index}
\def\dtheta{30}% degrees per dot
\def\dR{.42}% radius of circle in ex's
\def\dotsize{.6}% size of dots relative to period
\def\charwidth{3}% overall characterwidth in circle radii
\newlength\dRlen
\setlength\dRlen{\dR ex}
\def\basechar{\strut%
  \rule[.5\ht\strutbox-.5\dp\strutbox]{\charwidth\dRlen}{0ex}}
\savestack{\dotcircle}{\basechar}
\setcounter{index}{0}
\whiledo{\theindex<360}{%
  \FPdiv\thetaRad{\theindex}{57.29578}%
  \FPcos\dx{\thetaRad}%
  \FPmul\dx{\dR}{\dx}%
  \FPsin\dy{\thetaRad}%
  \FPmul\dy{\dR}{\dy}%
  \savestack{\dotcircle}{\stackinset{c}{}{c}{\dy ex}{%
    \kern\dx ex\kern\dx ex\scalebox{\dotsize}{.}}{\dotcircle}}
  \addtocounter{index}{\dtheta}%
}
\begin{document}
x\dotcircle y
\end{document}

enter image description here