Estou tentando criar um comando para usar quando precisar traduzir o idioma ou fazer exemplos para os dois idiomas. Até agora criei uma caixa ao redor do texto e duas colunas, uma para cada idioma.
\newcommand{\biling}[3]{%
\begin{tcolorbox}[colback=blue!10!white,boxrule=0pt]
\begin{center}%
\begin{minipage}{#3cm}%
\flushright%
#1%
\end{minipage}\hspace{.5cm}%
\begin{minipage}{#3cm}%
\flushleft%
#2%
\end{minipage}%
\end{center}%
\end{tcolorbox}%
}
Funciona nas duas primeiras caixas, mas no capítulo seguinte está desalinhado verticalmente como você pode ver na imagem:
Todo o código é mostrado abaixo:
\documentclass[12pt,a4paper]{book}
\usepackage{geometry}
\geometry{hmargin = 2cm}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\disablehyphenation
\usepackage{mathastext}
\def\dtch{\( \dot{H} \)}
\def\dth{\( \dot{h} \)}
\def\dtcm{\( \dot{M} \)}
\def\dtm{\( \dot{m} \)}
\def\dtcy{\( \dot{Y} \)}
\def\dty{\( \dot{y} \)}
\usepackage{tcolorbox}
\usepackage{xcolor}
\newcommand{\biling}[3]{%
\begin{tcolorbox}[colback=blue!10!white,boxrule=0pt]
\begin{center}%
\begin{minipage}{#3cm}%
\flushright%
#1%
\end{minipage}\hspace{.5cm}%
\begin{minipage}{#3cm}%
\flushleft%
#2%
\end{minipage}%
\end{center}%
\end{tcolorbox}%
}
\title{Comprehensive Guide To Þerysh}
\begin{document}
Starting with the basics we have the conjugation for the verb to be.
\biling{I am \\
You are \\
He is \\
She is \\
It is \\
We are \\
You are \\
They are}%
%
{À ty \\
\dtcy\ ty \\
Þi ty \\
Þa ty \\
Iss ty \\
Jos ty \\
Wos ty \\
Ðè ty}
{2}
The conjugation of the verb to be is the same for every person. It's important to notice that you singular form is a different word from a you plural form. Let's take a look in some examples of sentences:
\biling{
F \dty\ kn \textcolor{red}{bohw} ess, \dty\ ty ðróss! \\
\dtch, \dtm\ cwaþ \textcolor{red}{ty} Bjorn. \\
Iss ty h lajr \textcolor{red}{ganyst} \dty. \\
À \textcolor{red}{valtur} portugsh. \\
Þa \textcolor{red}{almie} þi. \\
Ðè \textcolor{red}{svo} h kr. \\
Jos \textcolor{red}{fint} mísk.}%
%
{If you can \textcolor{red}{read} this, you're awesome! \\
Hi, my name \textcolor{red}{is} Bjorn. \\
It's a pleasure to \textcolor{red}{meet} you. \\
I \textcolor{red}{speak} portuguese. \\
She \textcolor{red}{loves} he. \\
They \textcolor{red}{see} a car. \\
We \textcolor{red}{listen} to music.}
{7}
\chapter{The Present Tense}
To form the \textsc{present tense} one simply conjugates the verb in its primal form to all persons to express the idea of an action or something that is currently going on or habitually performed, or a state that currently or generally exists. If one wants to say that someone eats, the verb to be conjugated is \textit{ctom}.
\biling{À ctom \\
\dtcy\ ctom \\
Þi ctom \\
Þa ctom \\
Iss ctom \\
Jos ctom \\
Wos ctom \\
Ðè ctom}%
%
{I eat \\
You eat \\
He eats \\
She eats \\
It eats \\
We eat \\
You eat \\
They eat}%
{3}
\end{document}
Como alinhá-lo? Existe um pacote, um comando ou um ambiente que já faz isso? Estou compilando com LuaLaTeX.
Responder1
Use [t]
o alinhamento em seus minipage
s.
\documentclass[12pt,a4paper]{book}
\usepackage{geometry}
\geometry{hmargin = 2cm}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\disablehyphenation
\usepackage{mathastext}
\def\dtch{\( \dot{H} \)}
\def\dth{\( \dot{h} \)}
\def\dtcm{\( \dot{M} \)}
\def\dtm{\( \dot{m} \)}
\def\dtcy{\( \dot{Y} \)}
\def\dty{\( \dot{y} \)}
\usepackage{tcolorbox}
\usepackage{xcolor}
\newcommand{\biling}[3]{%
\begin{tcolorbox}[colback=blue!10!white,boxrule=0pt]
\begin{center}%
\begin{minipage}[t]{#3cm}%
\flushright%
#1%
\end{minipage}\hspace{.5cm}%
\begin{minipage}[t]{#3cm}%
\flushleft%
#2%
\end{minipage}%
\end{center}%
\end{tcolorbox}%
}
\title{Comprehensive Guide To Þerysh}
\begin{document}
Starting with the basics we have the conjugation for the verb to be.
\biling{I am \\
You are \\
He is \\
She is \\
It is \\
We are \\
You are \\
They are}%
%
{À ty \\
\dtcy\ ty \\
Þi ty \\
Þa ty \\
Iss ty \\
Jos ty \\
Wos ty \\
Ðè ty}
{2}
The conjugation of the verb to be is the same for every person. It's important to notice that you singular form is a different word from a you plural form. Let's take a look in some examples of sentences:
\biling{
F \dty\ kn \textcolor{red}{bohw} ess, \dty\ ty ðróss! \\
\dtch, \dtm\ cwaþ \textcolor{red}{ty} Bjorn. \\
Iss ty h lajr \textcolor{red}{ganyst} \dty. \\
À \textcolor{red}{valtur} portugsh. \\
Þa \textcolor{red}{almie} þi. \\
Ðè \textcolor{red}{svo} h kr. \\
Jos \textcolor{red}{fint} mísk.}%
%
{If you can \textcolor{red}{read} this, you're awesome! \\
Hi, my name \textcolor{red}{is} Bjorn. \\
It's a pleasure to \textcolor{red}{meet} you. \\
I \textcolor{red}{speak} portuguese. \\
She \textcolor{red}{loves} he. \\
They \textcolor{red}{see} a car. \\
We \textcolor{red}{listen} to music.}
{7}
\chapter{The Present Tense}
To form the \textsc{present tense} one simply conjugates the verb in its primal form to all persons to express the idea of an action or something that is currently going on or habitually performed, or a state that currently or generally exists. If one wants to say that someone eats, the verb to be conjugated is \textit{ctom}.
\biling{À ctom \\
\dtcy\ ctom \\
Þi ctom \\
Þa ctom \\
Iss ctom \\
Jos ctom \\
Wos ctom \\
Ðè ctom}%
%
{I eat \\
You eat \\
He eats \\
She eats \\
It eats \\
We eat \\
You eat \\
They eat}%
{3}
\end{document}
Com o alinhamento padrão (centro), você obtém o deslocamento de texto indesejado:
Responder2
Se você usar o tcolorbox
pacote, pode não precisar do minipage
s e em vez de definir o \biling
comando com três argumentos defina um\newtcolorbox{biling}{...}
\documentclass[12pt,a4paper]{book}
\usepackage{geometry}
\geometry{hmargin = 2cm}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\disablehyphenation
\usepackage{mathastext}
\def\dtch{\( \dot{H} \)}
\def\dth{\( \dot{h} \)}
\def\dtcm{\( \dot{M} \)}
\def\dtm{\( \dot{m} \)}
\def\dtcy{\( \dot{Y} \)}
\def\dty{\( \dot{y} \)}
\usepackage{tcolorbox}
%\usepackage{xcolor}
\newtcolorbox{bilingbox}{colback=blue!10!white,
frame empty,
segmentation empty,
halign=flush right,
sidebyside,
sidebyside gap=5mm,
sidebyside align=top
}
% \newcommand{\biling}[3]{%
% \begin{tcolorbox}[colback=blue!10!white,boxrule=0pt]
% \begin{center}%
% \begin{minipage}{#3cm}%
% \flushright%
% #1%
% \end{minipage}\hspace{.5cm}%
% \begin{minipage}{#3cm}%
% \flushleft%
% #2%
% \end{minipage}%
% \end{center}%
% \end{tcolorbox}%
% }
\title{Comprehensive Guide To Þerysh}
\begin{document}
Starting with the basics we have the conjugation for the verb to be.
\begin{bilingbox}
I am \\
You are \\
He is \\
She is \\
It is \\
We are \\
You are \\
They are
\tcblower
À ty \\
\dtcy\ ty \\
Þi ty \\
Þa ty \\
Iss ty \\
Jos ty \\
Wos ty \\
Ðè ty
\end{bilingbox}
% \biling{I am \\
% You are \\
% He is \\
% She is \\
% It is \\
% We are \\
% You are \\
% They are}%
% %
% {À ty \\
% \dtcy\ ty \\
% Þi ty \\
% Þa ty \\
% Iss ty \\
% Jos ty \\
% Wos ty \\
% Ðè ty}
% {2}
The conjugation of the verb to be is the same for every person. It's important to notice that you singular form is a different word from a you plural form. Let's take a look in some examples of sentences:
\begin{bilingbox}
F \dty\ kn \textcolor{red}{bohw} ess, \dty\ ty ðróss! \\
\dtch, \dtm\ cwaþ \textcolor{red}{ty} Bjorn. \\
Iss ty h lajr \textcolor{red}{ganyst} \dty. \\
À \textcolor{red}{valtur} portugsh. \\
Þa \textcolor{red}{almie} þi. \\
Ðè \textcolor{red}{svo} h kr. \\
Jos \textcolor{red}{fint} mísk.
\tcblower
If you can \textcolor{red}{read} this, you're awesome! \\
Hi, my name \textcolor{red}{is} Bjorn. \\
It's a pleasure to \textcolor{red}{meet} you. \\
I \textcolor{red}{speak} portuguese. \\
She \textcolor{red}{loves} he. \\
They \textcolor{red}{see} a car. \\
We \textcolor{red}{listen} to music.
\end{bilingbox}
% \biling{
% F \dty\ kn \textcolor{red}{bohw} ess, \dty\ ty ðróss! \\
% \dtch, \dtm\ cwaþ \textcolor{red}{ty} Bjorn. \\
% Iss ty h lajr \textcolor{red}{ganyst} \dty. \\
% À \textcolor{red}{valtur} portugsh. \\
% Þa \textcolor{red}{almie} þi. \\
% Ðè \textcolor{red}{svo} h kr. \\
% Jos \textcolor{red}{fint} mísk.}%
% %
% {If you can \textcolor{red}{read} this, you're awesome! \\
% Hi, my name \textcolor{red}{is} Bjorn. \\
% It's a pleasure to \textcolor{red}{meet} you. \\
% I \textcolor{red}{speak} portuguese. \\
% She \textcolor{red}{loves} he. \\
% They \textcolor{red}{see} a car. \\
% We \textcolor{red}{listen} to music.}
% {7}
\chapter{The Present Tense}
To form the \textsc{present tense} one simply conjugates the verb in its primal form to all persons to express the idea of an action or something that is currently going on or habitually performed, or a state that currently or generally exists. If one wants to say that someone eats, the verb to be conjugated is \textit{ctom}.
\begin{bilingbox}
À ctom \\
\dtcy\ ctom \\
Þi ctom \\
Þa ctom \\
Iss ctom \\
Jos ctom \\
Wos ctom \\
Ðè ctom
\tcblower
I eat \\
You eat \\
He eats \\
She eats \\
It eats \\
We eat \\
You eat \\
They eat
\end{bilingbox}
% \biling{À ctom \\
% \dtcy\ ctom \\
% Þi ctom \\
% Þa ctom \\
% Iss ctom \\
% Jos ctom \\
% Wos ctom \\
% Ðè ctom}%
% %
% {I eat \\
% You eat \\
% He eats \\
% She eats \\
% It eats \\
% We eat \\
% You eat \\
% They eat}%
% {3}
\end{document}