使用 Koma 脚本左对齐位置

使用 Koma 脚本左对齐位置

是否可以place使用 Koma 脚本 Latex 类将变量左对齐?

我用它scrlttr2来创建信件。我设法使用

\setkomavar{date}{\flushleft\vspace{-\baselineskip}\today\par}

但是,该位置Verona, Italy仍然向右对齐。阅读文档后,我发现位置由日期和位置变量组成。我尝试对位置变量执行上述操作,但没有成功。也许我必须为整个块设置对齐方式,但我不知道该怎么做。欢迎提出任何想法。

完整代码如下。

\documentclass[foldmarks=false,fromrule=afteraddress,enlargefirstpage=on,fontsize=12pt,fromalign=center,subject=left,parskip=full]{scrlttr2}
\usepackage{utopia} 
\setkomavar{frombank}{(1234)\,567\,890}
\KOMAoption{subject}{left}
\nonfrenchspacing
\setkomavar{date}{\flushleft\vspace{-\baselineskip}\today\par}
\setkomafont{backaddress}{\normalsize \usekomafont{fromaddress}}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{blindtext}
\tolerance=1000
\usepackage[english]{babel}
\setkomavar{fromemail}{afonso@afonso}
\LoadLetterOption{DINmtext}
\setkomavar{fromname}{Romeo}
\setkomavar{fromaddress}{House of Montague \\ Verona}
\date{<07-03 Thu>}
\setkomavar{place}{Verona, Italy} %This should be in the left
\KOMAoption{backaddress}{false}

\makeatletter
\renewcommand*{\raggedsignature}{\raggedright}
\@setplength{backaddrheight}{0pt}
\@setplength{toaddrhpos}{\dimexpr 1in +\oddsidemargin\relax}
\makeatother

\begin{document}
\KOMAoption{subject}{left}
\setkomavar{subject}{Mis-shapen chaos of well-seeming forms!}

\begin{letter}{%
Juliet\\
House of Capulet\\
Verona}

\opening{Dear Juliet,}

\blindtext

\closing{Yours truly,}

\ps{PS: ``PS'' is not typeset automatically by KOMA-Script


\noindent PPS: This is a feature!}
\cc{Paris and Lawrence.}
\encl{See also The Tragedy of Romeo and Juliet}
\end{letter}
\end{document}

输出:

放在右边。它应该和日期一起放在左边。

答案1

使用

\KOMAoption{refline}{dateleft}

或者

\documentclass[
  ...
  refline=dateleft% <-
]{scrlttr2}

并删除您的\setkomavar {date}{...}

在此处输入图片描述

代码:

\documentclass[
  foldmarks=false,
  fromrule=afteraddress,
  enlargefirstpage=on,
  fontsize=12pt,
  fromalign=center,
  %subject=left,% default
  parskip=full,
  backaddress=false,
  refline=dateleft
]{scrlttr2}
\LoadLetterOption{DINmtext}

\setkomavar{fromname}{Romeo}
\setkomavar{fromaddress}{House of Montague \\ Verona}
\setkomavar{place}{Verona, Italy}
\setkomavar{frombank}{(1234)\,567\,890}
\setkomavar{fromemail}{afonso@afonso}
\renewcommand*{\raggedsignature}{\raggedright}
\makeatletter
\@setplength{backaddrheight}{0pt}
\@setplength{toaddrhpos}{\dimexpr 1in +\oddsidemargin\relax}
\@addtoplength{firstheadvpos}{-7pt}% <- added because the head of the first page was to high
\makeatother

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\nonfrenchspacing
\usepackage{blindtext}% dummy text
\begin{document}
\begin{letter}{Juliet\\House of Capulet\\Verona}
\setkomavar{subject}{Mis-shapen chaos of well-seeming forms!}
\opening{Dear Juliet,}
\blindtext
\closing{Yours truly,}
\ps{PS: ``PS'' is not typeset automatically by KOMA-Script
\noindent PPS: This is a feature!}
\cc{Paris and Lawrence.}
\encl{See also The Tragedy of Romeo and Juliet}
\end{letter}
\end{document}

相关内容