2

In a document I am writing I have a list close to this one:

\begin{itemize}
    \item \emph{c} before \emph{e} or \emph{i} is pronounced as in \emph{church}
    \item \emph{g} before \emph{e} or \emph{i} is pronounced as in \emph{gin}
\end{itemize}

Of course, there is a large portion of repeated text. Is it possible to replace it with a single character ” centered ans taking the right width?

The final result should look like:

c before e or i is pronounced as in church
g             ”               as in gin
  • You mean not repeating ‘is pronounced as in’? – Bernard Oct 22 '19 at 16:24
  • It's a general question but here it would be not to repeat "before \emph{e} or \emph{i} is pronounced as in" –  Oct 22 '19 at 16:26
  • questions about notional conventions are off topic here, sorry. Once you have decided the notation that you want, asking how to set that in TeX would be on topic. – David Carlisle Oct 22 '19 at 16:26
  • I edited the question –  Oct 22 '19 at 16:27
  • 1
    OK, it's a bit marginal still, but I retracted my close vote, thanks for the edit. – David Carlisle Oct 22 '19 at 16:28
  • I'm not saying that I don't see the code repeating itself, but that the final file. I will give an example in the question. –  Oct 22 '19 at 16:29
  • \documentclass{article} \begin{document} \setbox0\hbox{before \emph{e} or \emph{i} is pronounced} \begin{itemize} \item \emph{c} before \emph{e} or \emph{i} is pronounced as in \emph{church} \item \emph{g} \makebox[\the\wd0][c]{"} as in \emph{gin} \end{itemize} \end{document}? –  Oct 22 '19 at 16:36
  • You should add the words "ditto marks" to the title. Perhaps Quote (ditto mards) to avoid repeating a text. This would help search engines find the post, as I expect that many who would want to do this would seach for "how to make ditto marks" or similar. – dedded Oct 22 '19 at 17:05
  • Done, thank you! –  Oct 22 '19 at 17:07
  • related : https://tex.stackexchange.com/q/442650/138900 – AndréC Oct 22 '19 at 18:27

3 Answers3

1

You can measure the width of the text and use it for a box of the same width that only contains, say, quotes.

\documentclass{article}
\begin{document}
\setbox0\hbox{before \emph{e} or \emph{i} is pronounced}
\begin{itemize}
    \item \emph{c} before \emph{e} or \emph{i} is pronounced as in \emph{church}
    \item \emph{g} \makebox[\the\wd0][c]{"}  as in \emph{gin}
\end{itemize}
\end{document}

enter image description here

And you can use macros to abbreviate it.

\documentclass{article}
\setbox0\hbox{before \emph{e} or \emph{i} is pronounced}
\newcommand{\pft}{\makebox[\the\wd0][c]{"}\ }
\begin{document}
\begin{itemize}
    \item \emph{c} before \emph{e} or \emph{i} is pronounced as in \emph{church}
    \item \emph{g} \pft  as in \emph{gin}
\end{itemize}
\end{document}
1

You can have something like this with package eqparbox (two variants):

\documentclass{article}
\usepackage{eqparbox} 

\begin{document}

\begin{itemize}
\item \emph{c} \eqmakebox[NR]{before \emph{e} or \emph{i} is pronounced as in} \emph{church}
\item \emph{g} \eqmakebox[NR]{ — } \emph{gin}
\item \emph{g} \eqmakebox[NR][s]{ — — — } \emph{gin}
\end{itemize}

\end{document} 

enter image description here

Bernard
  • 271,350
0

Your suggestions are // or <<, each two characters. Why not three characters?

\newcommand{\QW}{before \emph{e} or \emph{i} is pronounced as in }
% ...
\item \emph{c} \QW \emph{church}

Choose whatever works for you as the two letter macro name.

While I was writing the above answer the questioner "clarified" the question. It turned out that the clarification nullified this answer to the original question.

EDIT

Here's another (long-winded) answer to your revised question. Use a tabular.

% repeatprob.tex SE 513244  avoid repeating text

\documentclass{article}

\begin{document}
\newcommand*{\MB}{$\bullet$}
\newcommand*{\RP}{------ '' ------}
% for even less text
\newcommand*{\Entry}[2]{\MB & \emph{#1} & \RP \emph{#2} \\}

\setlength{\tabcolsep}{1pt}
\begin{tabular}{cccl}
$\bullet$ & \emph{c} & before \emph{e} or \emph{i} is pronounced as in & \emph{church} \\
\MB & \emph{g} & '' & \emph{gin} \\
\MB & \emph{g} & \RP & \emph{gin} \\
\Entry{g}{gin}
\end{tabular}

\end{document}

GOM (Grumpy Old Man)

Peter Wilson
  • 28,066
  • 2
    I guess you did not understand the question. –  Oct 22 '19 at 16:40
  • @Blincer I answered your original question before you changed it. Please remove the negative rating. – Peter Wilson Oct 22 '19 at 16:57
  • 2
    I didn't change it, I clarified it. You can check the comments where I have already explained that the csource was not the problem. –  Oct 22 '19 at 17:06
  • I cannot remove the vote until the answer is modified. –  Oct 22 '19 at 17:07
  • @Blincer I have extended my answer. It would have helped if your original question had included the clarification. Let's call a peace. – Peter Wilson Oct 22 '19 at 17:41
  • @Blincer Thank you for removing the negative rating. I have re-edited my answer to give an even more succinct input. – Peter Wilson Oct 23 '19 at 16:56