0

In the following example I am using \raggedleft which is supposed to align the text to the right. However it doesn't work.

\documentclass{article}
\usepackage{qrcode}
\def\commit{abcdef}
\def\commiturl{https://acme.org/}
\begin{document}
{
  \raggedleft\commit\quad\qrcode{\commiturl}
}
\end{document}

enter image description here

What is my mistake?

4
  • 1
    you finished \raggedleft with } before it was used (this is unrelated to qrcode) leave a blank line before } (or use \begin{flushleft}..\end{flushleft} Commented Jan 24, 2022 at 15:24
  • @DavidCarlisle Side question: why people on this site prefer to add a comment rather than post an answer?
    – nowox
    Commented Jan 24, 2022 at 15:26
  • 1
    because it's probably a duplicate but making a comment gives you help quicker than finding the necessary link to close Commented Jan 24, 2022 at 15:27
  • actually related to this but not really a dup so Ill answer tex.stackexchange.com/questions/570223/… Commented Jan 24, 2022 at 15:34

1 Answer 1

1

A paragraph is set according to the settings in scope at the end of the paragraph.

You have finished the scope of \raggedright at } without ending the paragraph so it has no effect other than setting \parindent to 0pt as the indent is consulted at the start.

Leave a blank line before } (or use \begin{flushleft}..\end{flushleft} (note this is unrelated to the qrcode).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .