3

I am using the csquotes package and its \enquote{TEXT IS HERE} very often. Instead of

\documentclass[12pt]{article}
\usepackage[top = 1in, bottom = 1in, left = 1in, right = 1in]{geometry}
\usepackage[russian,english]{babel}
    \usepackage[style=russian]{csquotes}
\begin{document}

\enquote{\hspace{.44mm}TEXT IS HERE 1\hspace{.44mm}}

\enquote{\hspace{.44mm}TEXT IS HERE 2\hspace{.44mm}}

\end{document}

I would like to write

\documentclass[12pt]{article}
\usepackage[top = 1in, bottom = 1in, left = 1in, right = 1in]{geometry}
\usepackage[russian,english]{babel}
    \usepackage[style=russian]{csquotes}
\begin{document}

\MACRO TEXT IS HERE 1.

\MACRO TEXT IS HERE 2.

\end{document}

where \MACRO TEXT IS HERE. = \enquote{\hspace{.44mm}TEXT IS HERE\hspace{.44mm}}.

This would greatly speed up writing dialogues.

Is this possible? Assume that each line so quoted is a new paragraph.

(For instance, I know that PARAGRAPH IS HERE.{{\parfillskip-1pt\par}} justifies the last line of the paragraph just like putting the paragraph into a bracket environment.)

EDIT: I have a strange additional space between the end of the paragraph and the closing quotation mark using the following code

\documentclass[12pt]{article}
\usepackage[top = 1in, bottom = 1in, left = 1in, right = 1in]{geometry}
\usepackage[russian,english]{babel}
    \usepackage[style=russian]{csquotes}
            \def\MACRO#1\par{\enquote{#1}\par}
            \usepackage[T1]{fontenc}
\begin{document}

\MACRO TEXT IS HERE.

\end{document}

If I replace \def\MACRO#1\par{\enquote{#1}\par} with \def\MACRO#1\par{\enquote{#1\hspace*{-0.88mm}}\par}, the white space problem is solved, but is that necessary? What causes TeX to add the large white space between HERE. and >>?

  • 1
    why -1pt? in your parfillskip example? But basically the answer to your question is no. You need to put the command first. Note that your setting of \parfillskip is before the following \par so before the paragraph is broken into lines, but it is after the text has been set so it is too late to change the text. (if it is on the main vertical list) – David Carlisle Nov 11 '13 at 17:37
  • Can the macro detect that the line before it a new paragraph if placed after it and if yes then place the line in quotes? If yes great; but I will assume the answer is no, also. Therefore I have changed my example and question to something similar, but with the macro before the text, following your advice. Refer to the edit please. – Guido Jorg Nov 11 '13 at 17:57
  • As I say, not on the main vertical list (the main page rather than a minipage) as by the time you get to the end, the text has already been set and can't be removed to add the quotes. (oh sorry edited to put the macro first that is much easier. – David Carlisle Nov 11 '13 at 20:38
4
\def\MACRO#1\par{\enquote{#1}\par}

Probably answers the revised question with \MACRO at the start of the paragraph rather than end. But really using the standard LaTeX syntax is preferable, giving a consistent syntax to functionality is a major part of what LaTeX is designed to do.

  • This works. It gives, however, a large additional space at the end of the paragraph prior to the closing quotation mark. I have updated my MWE, perhaps something else needs to be added to the command? – Guido Jorg Nov 11 '13 at 23:14
  • 1
    @GuidoJorg The space comes from the end of the line. The end of line followed by a blank line is effectively \space\par and the definition reads everything up to \par as the #1. – Dan Nov 12 '13 at 6:39
  • 1
    If you always end the text with a dot, you can use \def\MACRO#1.{\enquote{#1.}}. – Dan Nov 12 '13 at 6:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.