1

Here is MWE:

\documentclass{book}

\usepackage{polyglossia} \setmainlanguage{italian}

\usepackage[series={A},noend,nofamiliar,noledgroup,nopbinverse]{reledmac} \firstlinenum{1} \linenumincrement{1} \firstsublinenum{1} \sublinenumincrement{1} \Xsublinesep{} \sublinenumberstyle{alph}

\begin{document}

\beginnumbering
\pstart%
    When sub-lineation is in effect, the line number counter is frozen and the sub-line \msdata{ABCDEF}counter advances instead. If one of these commands appears in the middle\stopmsdata\ of a line, it doesn’t take effect until the next line; in other words, a line is counted as a line or sub-line depending on what it started out as, even if it changes in the middle
\pend%
% 
\endnumbering

\end{document}

The msdata command prints line number and allows us to print whatever text we want to add to footnote, which generally mentions names of manuscripts containing the relevant part. See this : Output of msdata

However, it appears that there is no way to print a few letters from beginning and end of the sections between \msdata{ABCDEF}counter advances instead. If one of these commands appears in the middle\stopmsdata. This makes it impossible to know what word/phrase/sentence was present in mentioned manuscripts and not present in others.

Is there any way to print one word/few letters from beginning and then dashes.... and then one word/few letters from the end of the mentioned phrase? It should look like this : 2-3 Ms.] ABCDEF > counter....middle or something similar.

  • I am not sur to understand well your need. Could provide an expected output example ? – Maïeul Mar 15 '22 at 23:52
  • I mean the output should look like : Ms.] counter....middle in the footnote, so that the person can understand the extent of text which was present in manuscritps ABCDEF and not in other manuscripts. – lalitaalaalitah Mar 16 '22 at 15:16
  • Currently there is no easy way to do that, bc the text passage between those two commands isn't stored anywhere, the way a command argument (or environment body) can be. \msdata{} takes one argument #1, but this isn't the text passage, it's the content of the fn. (f.i. list of manuscripts); \stopmsdata takes 0 arguments. So the text string isn't stored anywhere. Compare \edtext{}{}: you type the text into #1, this is saved and retrieved (printed as lemma) in the fn. And \lemma{} gives you a chance to store a different string for printing in the fn. No such thing in \msdata{}. – marquinho Mar 16 '22 at 15:36
  • @marquinho, That's understandable. But, in present condition this type of \msdata command is not very useful and creates more problems. I'm using custom commands inside critical footnotes to mention reading of each of 5 manuscripts of my present work. But, if a large portion of text is missing from one of manuscripts, I'll like to use solution similar to \msdata provided it works properly. Any idea to achieve similar results is welcome. – lalitaalaalitah Mar 16 '22 at 15:40
  • Also, it's not trivial to automate the abbreviation of a passage, to transform a (potentially long) text into a short one with the format "word ... word". Add to this the potential for ambiguity: how many words is enough? Seems you'd be better off inputing this manually: \msdata{word ... word\quad ABC}. Maybe via a custom command with two arguments, for simplicity and structure. – marquinho Mar 16 '22 at 15:40
  • marquinho, Yes, I just typed a comment of similar idea. I may have to create a new command and push inside one of critical footnotes. I hope @Maïeul has some better solution. – lalitaalaalitah Mar 16 '22 at 15:43
  • 1
    Yes, I see. One last clarification: Do you really want the fn. to read "Ms.] Lemma ABC"? I feel "Lemma] ABC" makes more sense. – I'm asking bc in the latter case, we could build on existing resources. The command \setmsdatalabel{} is used to replace the default string "Ms."; you could use it before each \msdata to type in the desired lemma: \setmsdatalabel{word ... word}. (Application's not trivial, bc the command operates on a paragraph basis; would need some patching.) – Well, IF this solution is good for you, that is. Otherwise \newcommand{\foo}[2]{\msdata{#1\enspace #2}} – marquinho Mar 16 '22 at 16:05

1 Answers1

1

First caveat: A completely automatic processing of the text string between \msdata and \msdatastop, such as "reprinting the first and last word and omitting everything in the middle" is not a trivial feat to implement. (It would require regular expressions or some LuaLaTeX magic.)

w.1 w.2 w.3 w.4 w.5 w.6 --> w.1 ... w.6

And it is probably not really desirable either: there is potential for ambiguity, for instance if w1 or w6 is repeated in the same line. It might be better to retain control over the abridgment.

Second caveat: There is currently no easy way in reledmac to store the text string w.1-w.n between \msdata and \msdatastop, the way a command argument (or environment body) can be stored and retrieved (and further processed, as described above). This is because the only argument of \msdata{} isn't the text string w.1-w.n, but the content of the footnote (f.i. the list of manuscripts). And \stopmsdata takes 0 arguments. Currently, the string w.1-w.n isn't stored anywhere.

Compare and contrast \edtext{}{}: the text that you type into #1 is saved and retrieved (typically, printed as lemma) in the footnote. And the command \lemma{} in the #2 of \edtext gives an additional chance to override that lemma, by storing a different string. There is no such mechanism in \msdata{}.

The simplest and safest way would be to use a custom command with two arguments, one being the list of manuscripts and the other the abridged text string w.1 ... w.6. Depending on the desired result, you could use something like this:

\newcommand{\startmscomment}[2]{\msdata{#1\quad #2}}
...
\startmscomment{ABC}{This ... reference.}%
This is the passage I want to reference.%
\stopmsdata

result of custom command

Another approach that I find promising - but is as yet incomplete – would be to build upon the existing command \setmsdatalabel{}. This determines which text string is printed before the lemma separator and before the content of \msdata. The default is "Ms.", but you can feed any text into the argument, and it will be displayed similarly to the lemma of critical footnotes. I believe this is the formally correct way to achieve what you'd like to do; this would be the appeal of using \setmsdatalabel.

\pstart
\setmsdatalabel{Ms.}
\msdata{ABC}
This is the passage I want to reference.%
\stopmsdata
\pend
\pstart
\setmsdatalabel{This ... reference.}   % Changing the prefix mid-document
\msdata{ABC}
This is the passage I want to reference.%
\stopmsdata
\pend

using setmsdatalabel

However, since reledmac inserts the notes after the paragraph has been built and split into lines, the value that we store in the macro \setmsdatalabel will be overwritten by later occurrences in the paragraph. This means that all notes in a paragraph get the same value. See the example:

\documentclass{article}

\usepackage{reledmac}

\begin{document} \beginnumbering \pstart \setmsdatalabel{FIRST - This one gets overwritten} % !!! \msdata{ABC}First passage I want to reference.\stopmsdata
% \setmsdatalabel{SECOND - This one overwrites the FIRST} \msdata{ABC}Second passage I want to reference.\stopmsdata \pend % \pstart \setmsdatalabel{THIRD - This one gets overwritten} % !!! \msdata{ABC}Third passage I want to reference.\stopmsdata
% \setmsdatalabel{FOURTH - This one overwrites the THIRD} \msdata{ABC}Fourth passage I want to reference.\stopmsdata \pend \endnumbering \end{document}

problem with using setmsdatalabel

I do not have a solution to this, all attempts failed so far, but maybe others can pick up from here.

There is probably a way to patch this, along the lines of this answer on how to store the value of \lemma. Or maybe it is a possible feature request for the package – to make \setmsdatalabel more flexible.

marquinho
  • 1,721
  • Thanks for this elaborate answer. It clarifies many things and suggests the way to go. I'll be implementing the first method for now. I was using the \setmsdatalabel to universally declare that a big chunk of text was missing from some manuscripts. Now, I'll be using the suggested \newcommand{\startmscomment}[2]{\msdata{#1\quad #2}} macro to mention the extent of missing text. – lalitaalaalitah Mar 17 '22 at 01:29
  • @lalitaalaalitah Yes, \setmsdatalabel is actually setup for the kind of universal use you describe; my proposal would count as a non-standard usage! – marquinho Mar 17 '22 at 09:17