2

Background

I’d like to write a LuaLaTeX document for the Roman Catholic Liturgy of the Holy Week (from the Psalm Sunday through Easter Sunday). I do this in Slovak language (here’s a pdf that uses images for portions that include any kind of graphics, like scores or a cross; here’s somewhat English version of that document)

I created the cross from the Paschal candle (Slovak version: page 3; English version: page 4), however, I could not place it on the left side of the accompanying text. I did this using tikzpicture.

What I have Tried

I tried to use multicols, but this package does not support tikzpicture to be in a column.

Then I found this question, so I tried to use wrapfigure, but I could not make it work.

Problem Definition

When I use wrapfigure, the text that should be on the left of the cross, is aligned left as if the tikzpicture would not be there.

Also, the cross should be left-aligned (to the page left margin) and to the top margin.

The text’s first line should be moved to the top margin to let the top of the letter alpha be aligned with the top of the first line of the text.

Also, if the cross and text should be moved lower on the page (because the text before would end on the same page as the cross and its text), the cross and its text should be moved as low as needed, while the top of alpha and the top of the first line of the text should be still on the same ‘invisible line’

The placement of the text that should be on the right, might be connected with my custom commands which I use as paragraph styles, namely \rubrics and prayer.

Anyway, I don’t care how the problem is solved, however, the better the solution, the better.

Minimal Working Example

\documentclass[10pt]{book}
\usepackage[a4paper]{geometry}
\geometry{a4paper, left=1in, right=1in, top=1in, bottom=1in, portrait}

% Packages
\usepackage[slovak]{babel}       % For the language-specific stuff
\usepackage{bookmark}            % For bookmarks and to stop `hyperref` complaining
\usepackage{xcolor}              % For font colour
\usepackage{enumitem}            % For {enumerate} that can be resumed and referenced
\usepackage{tikz}                % For drawing graphics
\usepackage{wrapfig}             % For wraping figures/images/tikz

% Font family
\usepackage[math-style=ISO, bold-style=ISO, partial=upright, nabla=upright]{unicode-math}
\setmainfont{Libertinus Serif}

% Paragraph and line settings
\setlength{\parindent}{0em}           % Set paragraph indentation
\setlength{\parskip}{0.08in}          % Paragraph spacing
\renewcommand{\baselinestretch}{1.0}  % Line \expandafter\selectlanguage\expandafter{\cvlang}

% Custom commands
\newcommand{\rubrics}[1]{\setlength{\parindent}{0em}\setlength{\parskip}{0.08in}\selectfont\renewcommand{\baselinestretch}{0}\color{red!100}\fontsize{12pt}{14pt}\selectfont{#1}\color{black!100}\normalsize\selectfont}%
\newcommand{\prayer}[1]{\setlength{\parindent}{0em}\setlength{\parskip}{0.16in}\renewcommand{\baselinestretch}{2.0}\color{black!100}\fontsize{20pt}{24pt}\selectfont{#1}\color{black!100}\normalsize\setlength{\parindent}{0em}\setlength{\parskip}{0.08in}\selectfont\renewcommand{\baselinestretch}{1.0}}%
\newcommand{\crossLetters}[1]{\fontsize{40}{48}\selectfont{\textbf{\color{black!100}{#1}}}}%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
    \begin{wrapfigure}{l}{0.01cm}
        \begin{tikzpicture}
            \draw[red, line width=1.6mm] (0,-9) node[below=10] {\crossLetters{Ω}} -- (0,0) -- (1,0) node[above=10] {\crossLetters{0}} node[below=10] {\crossLetters{0}} -- (3,0) -- (0,0) -- (0,3) node[above=10] {\crossLetters{Α}} -- (0,0) -- (-1,0) node[above=10] {\crossLetters{2}} node[below=10] {\crossLetters{2}} -- (-3,0);
        \end{tikzpicture}
    \end{wrapfigure}

    \prayer{Kristus je ten istý včera i dnes.}

    \rubrics{(celebrant vrýva zvislú čiaru kríža)}

    \prayer{On je počiatok a koniec,}

    \rubrics{(kňaz vrýva vodorovnú čiaru kríža)}

    \prayer{Alfa}

    \rubrics{(nad zvislú čiaru kríža vrýva písmeno alfa)}

    \prayer{i Omega,}

    \rubrics{(pod zvislú čiaru kríža vrýva písmeno omega)}

    \prayer{Pán času}

    \rubrics{(do ľavého horného uhla kríža vrýva prvú číslicu letopočtu)}

    \prayer{i večnosti.}

    \rubrics{(do pravého horného uhla kríža vrýva druhú číslicu letopočtu)}

    \prayer{Jemu patrí sláva i moc}

    \rubrics{(do ľavého spodného uhla kríža vrýva tretiu číslicu letopočtu)}

    \prayer{po všetky veky vekov. Amen.}

    \rubrics{(do spodného pravého uhla kríža vrýva štvrtú číslicu letopočtu)}
\end{document}

Output

enter image description here

  • "I tried to use multicols, but this package does not support tikzpicture to be in a column." Really? – user121799 Apr 23 at 18:19
  • Or rather I could not make it work. What I did with multicols is: added \usepackage{multicols} and instead of pair \begin{wrapfigure}{l}{0.01cm} and \end{wrapfigure} typed \begin{multicols}{2} and \end{multicols}. I get an error: ! Arithmetic overflow.\n<recently read> \baselineskip\nl.70 \end{multicols}. Anyway, if you know a solution, we are welcome to help me out. You could solve it with multicols too. ;) – tukusejssirs Apr 23 at 18:30
  • Why not try with two minipages? – leandriis Apr 23 at 20:36
  • @leandriis, as I am quite new to *TeX, I have never heard of minipages. :) – tukusejssirs Apr 23 at 20:48
3

Solution

As @marmot (let’s say) suggested, the multicols indeed works with tikzpicture, however, at first I did not manage to make it work. After some trials and errors, I made it work in combination with some other tweaks.

In comparison with the MWE from the question, I made the following changes:

  1. added \usepackage{multicol};
  2. modified the \rubrics and \prayer commands a bit to remove all paragraph formatting and leave only character formatting (i.e. font size and colour);
  3. added \setlength{\columnsep}{-2.5cm} to let the left column be narrower / let the columns width be different from each other; [1]
  4. added \begin{multicols}{2} and \end{multicols};
  5. added \vfill\null\columnbreak, which is needed to insert a column break; [2]
  6. and I added 4 line breaks (\\) to 4 longer lines to make it look better. :)

[1] different column width: https://tex.stackexchange.com/a/384598/70043

[2] column break: https://tex.stackexchange.com/a/8687/70043

Modified Minimal Working Example

\documentclass[10pt]{book}
\usepackage[a4paper]{geometry}
\geometry{a4paper, left=1in, right=1in, top=1in, bottom=1in, portrait}

% Packages
\usepackage[slovak]{babel}       % For the language-specific stuff
\usepackage{bookmark}            % For bookmarks and to stop `hyperref` complaining
\usepackage{xcolor}              % For font colour
\usepackage{enumitem}            % For {enumerate} that can be resumed and referenced
\usepackage{tikz}                % For drawing graphics
\usepackage{wrapfig}             % For wraping figures/images/tikz
\usepackage{multicol}            % For columns layout

% Font family
\usepackage[math-style=ISO, bold-style=ISO, partial=upright, nabla=upright]{unicode-math}
\setmainfont{Libertinus Serif}

% Paragraph and line settings
\setlength{\parindent}{0em}           % Set paragraph indentation
\setlength{\parskip}{0.08in}          % Paragraph spacing
\renewcommand{\baselinestretch}{1.0}  % Line \expandafter\selectlanguage\expandafter{\cvlang}

% Custom commands
\newcommand{\rubrics}[1]{\color{red!100}\fontsize{12pt}{14pt}\selectfont{#1}}%
\newcommand{\prayer}[1]{\color{black!100}\fontsize{20pt}{24pt}\selectfont{#1}}%
\newcommand{\crossLetters}[1]{\fontsize{40}{48}\selectfont{\textbf{\color{black!100}{#1}}}}%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
    \pagestyle{empty}
    \setlength{\columnsep}{-2.5cm}
    \begin{multicols}{2}
        \begin{tikzpicture}
            \draw[red, line width=1.6mm] (0,-9) node[below=10] {\crossLetters{Ω}} -- (0,0) -- (1,0) node[above=10] {\crossLetters{0}} node[below=10] {\crossLetters{0}} -- (3,0) -- (0,0) -- (0,3) node[above=10] {\crossLetters{Α}} -- (0,0) -- (-1,0) node[above=10] {\crossLetters{2}} node[below=10] {\crossLetters{2}} -- (-3,0);
        \end{tikzpicture}

        \vfill\null\columnbreak  % This whole line is needed to insert a column break

        \prayer{Kristus je ten istý včera i dnes.}

        \rubrics{(celebrant vrýva zvislú čiaru kríža)}

        \prayer{On je počiatok a koniec,}

        \rubrics{(kňaz vrýva vodorovnú čiaru kríža)}

        \prayer{Alfa}

        \rubrics{(nad zvislú čiaru kríža vrýva písmeno alfa)}

        \prayer{i Omega,}

        \rubrics{(pod zvislú čiaru kríža vrýva písmeno omega)}

        \prayer{Pán času}

        \rubrics{(do ľavého horného uhla kríža vrýva\\ prvú číslicu letopočtu)}

        \prayer{i večnosti.}

        \rubrics{(do pravého horného uhla kríža vrýva\\ druhú číslicu letopočtu)}

        \prayer{Jemu patrí sláva i moc}

        \rubrics{(do ľavého spodného uhla kríža vrýva\\ tretiu číslicu letopočtu)}

        \prayer{po všetky veky vekov. Amen.}

        \rubrics{(do spodného pravého uhla kríža vrýva\\ štvrtú číslicu letopočtu)}
    \end{multicols}
\end{document}

Output

output

1

Here is a simple(-minded?) proposal. Make the margin on the left wider and put the picture as an overlay. (I am sorry, I cannot copy all these accented text in my editor so I stripped everything off but the parts relevant to make the point.)

\documentclass[10pt]{book}
\usepackage[a4paper]{geometry}
\usepackage{lipsum}
\usepackage{tikzpagenodes}
\geometry{a4paper, left=4in, right=1in, top=1in, bottom=1in, portrait}
\begin{document}
\begin{tikzpicture}[overlay,remember picture,shift={([xshift=2in,yshift=2in]current page.west)}]
  \draw[red, line width=1.6mm] (0,-9) node[below=10] {$\Omega$} 
  -- (0,0) -- (1,0) node[above=10] {A} 
  node[below=10] {0} -- (3,0) -- (0,0) -- (0,3) 
  node[above=10] {A} -- (0,0) -- (-1,0) 
  node[above=10] {2} node[below=10] 
  {2} -- (-3,0);
\end{tikzpicture}
\lipsum[1-3]
\end{document}

enter image description here

  • thank for an alternative. Although it is a partial solution, it is good to know one could do this. Anyway, is there a way to locally override the margins? For as you can see, I’ve used book for \documentclass, therefore I need the margins set to a specific values and them to override them locally for this part of the book. Another problem is the placement of the cross—it should be the way I described in the question, though I think it could be shifted in the tikzpicture settings, but I am not sure if it could be set for even and odd pages in one command. – tukusejssirs Apr 24 at 10:46
  • 1
    @tukusejssirs This can be done with the geometry package, which you are already using, see e.g. here. – user121799 Apr 24 at 13:16

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.