LaTeX forum ⇒ LettersRagged left signature not displayed as expected Topic is solved

Formal letters, Cover letters, Newsletters
erwann
Posts: 71
Joined: Thu Aug 25, 2016 2:24 am

Ragged left signature not displayed as expected

Postby erwann » Thu Sep 06, 2018 12:05 am

It's the signature I wanted ragged left, not the closing statement. How to do it, please?



  1. \documentclass[
  2. french,
  3. % paper=letter,
  4. version=last,
  5. % fontsize=10pt,
  6. NF
  7. ]{scrlttr2}
  8. \KOMAoptions{
  9. foldmarks=false,
  10. backaddress=false, %%window envel
  11. fromalign=left,
  12. fromemail=true,
  13. subject=beforeopening, %%centered, %left %left-justified, %underlined
  14. %subject=titled,%% Concernant:
  15. %refline=nodate,
  16. fromrule=false
  17. }
  18.  
  19. \usepackage[T1]{fontenc}
  20. \usepackage[french]{babel}
  21. \usepackage{graphicx}
  22. \usepackage{pdfpages}
  23. \usepackage{url}
  24.  
  25. \makeatletter
  26. \@setplength{sigbeforevskip}{4\baselineskip}
  27. \makeatother
  28.  
  29. \begin{document}
  30.  
  31.  
  32. \setkomavar{fromname}{NOM}
  33. \setkomavar{fromaddress}{ADR}
  34. \setkomavar{fromemail}{EMAIL}
  35. \setkomavar{place}{Paris} %% wiped out by yourref
  36. \setkomavar{subject}{SUJET}
  37. \setkomavar{date}{\today}
  38.  
  39. \newsavebox\signaturebox
  40. \sbox\signaturebox{%
  41. \begin{tabular}{@{}c@{}}
  42. %\smash{\includegraphics[height=4em]{2013_.png}}\\[2pt]
  43. \usekomavar{fromname}
  44. \end{tabular}}
  45. \setkomavar{signature}{\usebox{\signaturebox}}%
  46. %\renewcommand*\raggedsignature{\raggedright}
  47. \renewcommand*\raggedsignature{\raggedleft}
  48.  
  49. \begin{letter}{DEST}
  50.  
  51. \opening{Madame, Monsieur,}
  52.  
  53. BLABLABLA
  54.  
  55. \closing{Restant \`a votre disposition pour toute information compl\'ementaire, veuillez agr\'eer, Madame, Monsieur, l'expression de mes sinc\`eres salutations,}
  56.  
  57. %\ps PS:
  58.  
  59. %\encl{}
  60.  
  61. %\includepdf[pages={1-}]{fr-watermark.pdf}
  62.  
  63. \end{letter}
  64.  
  65. \end{document}
Attachments
Screenshot from 2018-09-05 18-03-41.png
Screenshot from 2018-09-05 18-03-41.png (21.28 KiB) Viewed 146 times
x_86 / Linux Mint 18.3 / texlive 2015.20160320-1ubuntu0.1 / TeXworks 0.5r1361 (Debian)

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 3830
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Sep 06, 2018 7:30 am

Is that what you want?
  1. \documentclass[
  2. french,
  3. % paper=letter,
  4. version=last,
  5. % fontsize=10pt,
  6. NF
  7. ]{scrlttr2}
  8. \KOMAoptions{
  9. foldmarks=false,
  10. backaddress=false, %%window envel
  11. fromalign=left,
  12. fromemail=true,
  13. subject=beforeopening, %%centered, %left %left-justified, %underlined
  14. %subject=titled,%% Concernant:
  15. %refline=nodate,
  16. fromrule=false
  17. }
  18.  
  19. \usepackage[T1]{fontenc}
  20. \usepackage[french]{babel}
  21. \usepackage{graphicx}
  22. \usepackage{pdfpages}
  23. \usepackage{url}
  24.  
  25. \makeatletter
  26. \@setplength{sigbeforevskip}{4\baselineskip}
  27. \makeatother
  28.  
  29. \begin{document}
  30.  
  31.  
  32. \setkomavar{fromname}{NOM}
  33. \setkomavar{fromaddress}{ADR}
  34. \setkomavar{fromemail}{EMAIL}
  35. \setkomavar{place}{Paris} %% wiped out by yourref
  36. \setkomavar{subject}{SUJET}
  37. \setkomavar{date}{\today}
  38.  
  39. \newsavebox\signaturebox
  40. \sbox\signaturebox{%
  41. \begin{tabular}{@{}c@{}}
  42. \smash{\includegraphics[height=4em]{example-image}}\\[2pt]
  43. \usekomavar{fromname}
  44. \end{tabular}}
  45. \setkomavar{signature}{\hfill\usebox{\signaturebox}}%
  46. %\renewcommand*\raggedsignature{\raggedleft}
  47. \renewcommand*\raggedsignature{\raggedright}
  48.  
  49. \begin{letter}{DEST}
  50.  
  51. \opening{Madame, Monsieur,}
  52.  
  53. BLABLABLA
  54.  
  55. \closing{Restant \`a votre disposition pour toute information compl\'ementaire, veuillez agr\'eer, Madame, Monsieur, l'expression de mes sinc\`eres salutations,}
  56.  
  57. %\ps PS:
  58.  
  59. %\encl{}
  60.  
  61. %\includepdf[pages={1-}]{fr-watermark.pdf}
  62.  
  63. \end{letter}
  64.  
  65. \end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

erwann
Posts: 71
Joined: Thu Aug 25, 2016 2:24 am

Postby erwann » Fri Sep 07, 2018 12:30 am

Could you please highlight the change you have made, apart from a dummy image? It has to work without a image in place of the signature, when you want to sign manually.
x_86 / Linux Mint 18.3 / texlive 2015.20160320-1ubuntu0.1 / TeXworks 0.5r1361 (Debian)

User avatar
Johannes_B
Site Moderator
Posts: 3830
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Fri Sep 07, 2018 6:57 am

  1. \setkomavar{signature}{\hfill\usebox{\signaturebox}}

Note the \hfill.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.


Return to “Letters”

Who is online

Users browsing this forum: No registered users and 2 guests