TransWikia.com

How to align a specific piece of text to the right while inside a list environment?

TeX - LaTeX Asked by MagisterAdest on November 27, 2020

How would it be possible to get the emph{input.} aligned to the right side of the page, and only that piece of text? But at the same time, I would like to keep the text that is sent to the right side of the page aligned on the left edge. So all the emph’s are on the right side of the page but are all aligned on the left edge.

I believe a picture would best explain:

Historia de la Filosofía por Guillermo Fraile, pg 22

La escala de los seres según la noción realista:
begin{itemize}
    item[A)] Simple. Acto puro. Forma pura. emph{Dios.}
    item[B)] Compuestos de acto y potencia, de esencia y existencia:
    begin{enumerate}
        item Subsistentes (formas separadas de la materia): emph{Almas separadas.footnote{O sea, ángeles}}
        item No subsistentes (formas unidas a la materia): Entes móviles:
        begin{itemize}
            item[a)] Vivientes:
            begin{enumerate}
                item[1] Racionales (forma espiritual): emph{Hombres.}
                item[2] No racionales (forma inmaterial):
                begin{itemize}
                    item[α] Sensitivos: emph{Animales.}
                    item[β] No sensitivos: emph{Vegetales.}
                end{itemize}
            end{enumerate}
            item[b)] No vivientes (formas materiales): emph{Minerales.}
        end{itemize}
    end{enumerate}
end{itemize}

2 Answers

Here is a code based on eqparbox, moreenum and enumitem. I defined an emphrbox command, which does the trick (with certain limitations). All lists environments are enumerate, and I had to change the enumerate depth (the default is 4):

documentclass{article}
usepackage[spanish]{babel} 
usepackage{enumitem, moreenum}
renewlist{enumerate}{enumerate}{5}
setlist[enumerate, 1]{label=Alph*)}
setlist[enumerate, 2]{label=arabic*)}
setlist[enumerate, 3]{label=alph*), font=itshape}
setlist[enumerate, 4]{label=arabic*)}
setlist[enumerate, 5]{label=greek*}
usepackage{eqparbox}
newcommand{emphrbox}[2][LR]{dotfillquadeqparbox{#1}{em #2}}
begin{document}

noindent La escala de los seres según la noción realista:
begin{enumerate}
    item Simple. Acto puro. Forma pura. emphrbox{Dios.}
    item Compuestos de acto y potencia, de esencia y existencia:
    begin{enumerate}
        item Subsistentes (formas separadas de la materia): emphrbox{Almas separadas.footnote{O sea, ángeles}}
        item No subsistentes (formas unidas a la materia): Entes móviles:
        begin{enumerate}
            item Vivientes:
            begin{enumerate}
                item Racionales (forma espiritual): emphrbox{Hombres.}
                item No racionales (forma inmaterial):
                begin{enumerate}
                    item Sensitivos: emphrbox{Animales.}
                    item No sensitivos: emphrbox{Vegetales.}
                end{enumerate}
            end{enumerate}
            item No vivientes (formas materiales): emphrbox{Minerales.}
        end{enumerate}
    end{enumerate}
end{enumerate}

end{document} 

enter image description here

Correct answer by Bernard on November 27, 2020

mwe

documentclass[twocolumn]{article}
usepackage{tabularx,parskip}
begin{document}

deflabelenumi{Alph{enumi})}
newlength{nombremaslargo}
settowidth{nombremaslargo}{Hermenegilda}
defhermanas#1{dotfill~~makebox[nombremaslargo][l]{em #1}}

Juana y su hermana: 
begin{enumerate}
    item Con verb-enumerate- hermanas{Juana} 
    item y una macro  hermanas{Hermenegilda}
end{enumerate}

Juana y su hermana: 

renewcommandarraystretch{1.6}tabcolsep2pt
begin{tabularx}{linewidth}{lX>{em }l}
    A)  & Con verb-dotfill- dotfill & Juana 
    B)  & y verb-tabularx- dotfill & Hermenegilda 
end{tabularx}
end{document}

Answered by Fran on November 27, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP