21

I believe that a symbol -||- is commonly used to indicate repetition of a fragment of text. The problem is that typesetting it using dashes and pipes looks kind of ugly. Is there a predefined symbol for that?

EDIT: Seems this is a localized version of a ditto mark:

http://en.wikipedia.org/wiki/Ditto_mark

Is there a way to typeset it in LaTeX?

Joel Spolsky
  • 101
  • 1
  • 4
julkiewicz
  • 1,165
  • 2
    Can you point to some resource on the net where the symbol appears? – egreg Apr 30 '12 at 15:08
  • 4
    That's the problem, it's really difficult to google a symbol. I mostly see it in hand written text. – julkiewicz Apr 30 '12 at 15:10
  • 1
    In what field do you believe it's used? – egreg Apr 30 '12 at 15:11
  • 6
    I think you are referring to a ditto mark (i.e. the two dashes looking a bit like quotation marks in the middle). The English version of the Wikipedia article doesn't mention the use of dashes around the symbol as in your question, however, while the German one does. – diabonas Apr 30 '12 at 15:14
  • 1
    @diabonas I think you're right. There is no Polish entry for that on wiki. Seems like this is a localized version of ditto. – julkiewicz Apr 30 '12 at 15:16
  • Is there a LaTeX English version of ditto? I've just found this link: http://www.cs.sfu.ca/~ggbaker/reference/characters/ that suggests it's not predefined. – julkiewicz Apr 30 '12 at 15:21
  • @julkiewicz: In what context do you want to use this? In many cases, you can avoid using a repetition symbol. – Jake Apr 30 '12 at 15:26
  • @Jake I'm just curious whether it can be done. If it will be better to rephrase my text, I'll do just that. – julkiewicz Apr 30 '12 at 15:28
  • I'm using it in a table where I'm starved for space and my entries are "primary, raw", "primary, smoothed", "secondary, raw", "secondary, smoothed". I don't have space to fit primary/secondary and smoothed/raw in its own column, nor to write it out in full, so I opt for "primary, raw", "---, smoothed", "secondary, raw", "secondary, ---", which saves a centimetre or two. – gerrit Dec 04 '14 at 00:31

3 Answers3

23

You are referring to the ditto mark, which is actually a special Unicode character (U+3003) looking like this:

Unicode Character 'DITTO MARK' (U+3003): 〃

Using XeLaTeX or LuaLaTeX, you could use this character directly, provided that you use a font the has support for this symbol. However, the Wikipedia article cited above mentions that

[...] in practice closing double quotation marks (”) or straight double quotation marks (") are often used instead [of the Unicode symbol]

so you might as well use something like

\newcommand*{\dittoclosing}{---''---}
\newcommand*{\dittostraight}{---\textquotedbl---} % available in T1 encoding

(The latter requires you to use \usepackage[T1]{fontenc}).

The result looks like this:

comparison of \dittoclosing and \dittostraight

diabonas
  • 25,784
  • In fact, the dashes on either side should span the whole repeated text, no? Of course, this isn’t as easy to achieve … – Konrad Rudolph Apr 30 '12 at 19:25
  • 1
    Just wanted to remark that U+3003 was part of the CJK Symbols and Punctuation Block, so it might not be deemed suitable for non-CJK languages. – Taiki Aug 15 '18 at 11:54
13

The german Wikipedia claims that the Unicode DITTO MARK is for CJK languages only … Furthermore I’d add some space around the quotation marks and lower them a little. In my eyes the qoute version don’t look very good. I like a TikZ version, as the following, since the vertical bars math the horizontal ones better … In most cases I prefer repeated text, though.

ditto

\documentclass{article}

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

\newcommand*{\dittoclosing}{--- \raisebox{-0.5ex}{''} ---}


\usepackage{tikz}
\newcommand{\dittotikz}{%
    \tikz{
        \draw [line width=0.12ex] (-0.2ex,0) -- +(0,0.8ex)
            (0.2ex,0) -- +(0,0.8ex);
        \draw [line width=0.08ex] (-0.6ex,0.4ex) -- +(-1.5em,0)
            (0.6ex,0.4ex) -- +(1.5em,0);
    }%
}


\begin{document}
\begin{tabular}{ll}
Some long stupid text & Text A \\
\dittoclosing & Text B \\
\end{tabular}

\begin{tabular}{ll}
Some long stupid text & Text A \\
\dittotikz & Text B \\
\end{tabular}
\end{document}
Tobi
  • 56,353
  • 1
    You can edit the German Wiki as to the statement that the ditto mark is only used in CJK languages is incorrect. In general it is good advice to repeat the words. From the Oxford Guide... Repeat information rather than use ditto marks. The mark also changes based on context. Your TikZ solution looks good though:) – yannisl Apr 30 '12 at 18:18
  • 2
    @YiannisLazarides: Thanks :-) Do you mean that the german Wikipedia is wrong? I guess what the wiki mean is not that only CJK languages use a ditto mark but that the Unicode character DITTO MARK is to be used in CJK languages. Other languages might use the quotation marks instead. – Tobi Apr 30 '12 at 18:40
  • 1
    I don't speak German, but the way you explain it indicates that the statement in the Wiki is wrong. Perhaps if you can expand it a bit in the wiki with a longer explanation. It is always good for one's soul to contribute to Wikipedia:) – yannisl Apr 30 '12 at 18:48
  • 5
    @YiannisLazarides: The German Wikipedia is right, and "the Unicode DITTO MARK is for CJK languages only". Of course ditto marks are used in many places, but for some reason the only Ditto mark encoded in Unicode is the one for CJK. In fact it (Unicode Character 'DITTO MARK' (U+3003)) occurs in the block "CJK Symbols and Punctuation". So one should not use U+3003 with a non-CJK language. (Instead one can use some combination of quotation marks and dashes.) – ShreevatsaR Apr 30 '12 at 19:15
  • @ShreevatsaR The definitive answer can come from Kopela. If a unicode mark is specific to a language it would state ie, FILIPINO COLON. Otherwise nothing stops you to use it in other languages. It is in the set In Punctuation Other, but not in Terminal Punctuation – yannisl Apr 30 '12 at 20:09
  • @YiannisLazarides: I’s expand the article if I know it, but I just read the german Wiki and rephrased it here … – Tobi Apr 30 '12 at 20:33
  • Maybe one can use the DITTO MARK with other languages but as the image in the wiki suggest it is desinged to be combined with CJK letters/symbols an not out latin alphabet. – Tobi Apr 30 '12 at 20:35
  • 2
    @YiannisLazarides: Not all script/language-specific code points in Unicode have a language name attached. In this case, U+3003 DITTO MARK (〃) is not in the Latin blocks U+0000 to U+024F, nor in the block "Latin Extended Additional" (U+1E00 to U+1EFF) nor in "General Punctuation" (U+2000 to U+206F), but specifically in "CJK Symbols and Punctuation" (U+3000 to U+303F). In this block, it occurs along with characters like U+3005 IDEOGRAPHIC ITERATION MARK (々), U+3006 IDEOGRAPHIC CLOSING MARK (〆) and U+3020 POSTAL MARK FACE (〠) which despite not saying "CJK" in the name, are meant specific to CJK. – ShreevatsaR May 01 '12 at 06:14
  • Actually, in [http://www.unicode.org/Public/6.2.0/ucd/ScriptExtensions.txt] , the line corresponding to the ditto mark (3003) specifies the list of wrting system it intended to be used with Bopo Hang Hani Hira Kana , i.e. the CJK writing systems (Bopomofo, Hangul, Han ideographs, Hiragana and Katakana) only. – Frédéric Grosshans Jan 09 '13 at 17:32
  • For what it's worth, it's my impression that a ditto mark with that kind of appearance is used mostly in Japanese (as opposed to Chinese or Korean). – Mårten Jun 18 '13 at 12:38
5

I use

\newcommand*{\ditto}{---\texttt{"}---}

Works like a charm

sheß
  • 3,622