g-brief2 调整地址窗口大小

g-brief2 调整地址窗口大小

我想发送一封g-brief2带有很长地址的信件,地址窗口放不下。地址会自动连字符,在这种情况下看起来很奇怪。

有人知道我怎样才能在不改变其余结构的情况下使地址窗口变大吗g-brief2

梅威瑟:

%% LyX 2.0.0 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[12pt,german]{g-brief2}
\usepackage{mathpazo}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\pagestyle{empty}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
 \newcommand{\LyxGruss}[1]
   { \Gruss{#1}{0.5cm} }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\fenstermarken % prints address window marks
\faltmarken % prints folding marks
%\lochermarke % prints puncher marks 
\trennlinien % prints striplines
%\unserzeichen % prints "our ref" instead of "my ref"



\makeatother

\usepackage{babel}
\begin{document}


\Adresse{
{\large Prof. Dr. X Y}\\
{\large Humongously long address. Seriously, it's that long!}\\
}


\Datum{\today}


\Betreff{Address shortening}


\Anrede{Dear Prof Y,}


\LyxGruss{Best regards,}


\Unterschrift{j}

\begin{g-brief}
Please shorten your address!
\end{g-brief}

\end{document}

答案1

由于您使用的是 LyX,我假设您正在寻找“文档”>“设置...”>“LaTeX 前言”解决方案。原始输出:

在此处输入图片描述

  1. \raggedright您可以通过将以下内容添加到 LaTeX 序言中来设置地址:

    \def\Adresse#1{\def\adresse{\raggedright#1}}
    

    这使得字段内的内容\Adresse可以不用连字符换行。

    在此处输入图片描述

  2. 您可以将保存地址的3in宽度拉伸到(例如) :\parbox6in

    \usepackage{etoolbox}% http://ctan.org/pkg/regexpatch
    
    \def\fenstermerken@{%
          \put(-9,-18.15){\line( 1, 0){1}} \put(-9,-18.15){\line( 0,-1){1}}%
          \put(126,-18.15){\line(-1, 0){1}} \put(126,-18.15){\line( 0,-1){1}}%
          \put(-9,-61.00){\line( 1, 0){1}} \put(-9,-61.00){\line( 0, 1){1}}%
          \put(126,-61.00){\line(-1, 0){1}} \put(126,-61.00){\line( 0, 1){1}}%
    }
    % \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
    \patchcmd{\ps@firstpage}{3in}{6in}{}{}% Adjust width of address box
    \patchcmd{\ps@firstpage}{{85}}{{135}}{}{}% Increase horizontal rule
    \patchcmd{\ps@firstpage}{\iffenstermarken}{\fenstermerken@\fenstermarkenfalse\iffenstermarken}{}{}% Top/bottom right corners of address box
    

    以上etoolboxpatch 做了三件事:

    • 增加的宽度\parbox
    • 增加地址上方的水平线;以及
    • 移动右侧顶部/底部芬斯特市场

    在此处输入图片描述

    对于短于的东西6in,你必须摆弄数字135和(126\fenstermarken@,或比您选择的少 9 135


g-brief2不够灵活。

相关内容