특정 문자에 대한 마이크로타입의 문자 돌출 설정 수정(즉, 부분 재정의)

특정 문자에 대한 마이크로타입의 문자 돌출 설정 수정(즉, 부분 재정의)

microtype특정 문자에 대해 문자 돌출( 에서 활성화)을 비활성화하거나 수정하고 싶습니다 .

내 취향에 비해 너무 넓게 튀어나온 en-dash를 사용하여 문제를 설명하겠습니다.

돌출 없이 돌출부가 있음

(왼쪽: 돌출부 없음, 오른쪽: 돌출부 있음)

그러나 다음을 사용하여 돌출을 비활성화할 수 없습니다 \SetProtrusion.

\documentclass{memoir}
\usepackage{mathptmx}
\usepackage[T3,T1]{fontenc}
\usepackage{microtype}
%\usepackage[protrusion=false]{microtype}
\SetProtrusion
  { encoding = T1,
    family   = ptm }
  { \textendash = {,0} }


\begin{document}

Word word word word word word word word word word word word word word -- word
word word word word word word word word word word word word word word word
word word word word word word word word word word word word word word word
word word word word word word ...

\end{document}

또한 다음과 같은 경고가 표시됩니다.

Package microtype Warning: protrusion codes list `ptm-T1' will override list
(microtype)                `q.tex/9' for font `T1/ptm///' on input line 105.

에 따르면프리앰블에서 마이크로타입의 \SetProtrusion을 어떻게 호출합니까?, 도움말 \LoadMicrotypeFile{ptm}바로 앞의 줄을 포함합니다 . \SetProtrusion이것을 시도하면 --( \textendash)에 대한 문제가 해결되는 것처럼 보이지만 (1) 성가신 경고가 계속 표시되고 (2) 내 코드가 비활성화됩니다.모두돌출(내 짧은 목록으로 돌출 값의 전체 목록을 재정의하여) 기본 문자 돌출 설정을 부분적으로 재정의하는 올바른 방법은 무엇입니까? 이상적으로는 중요한 기능을 비활성화하지 않으면서 경고를 없애는 방법이 있을 것입니다 microtype.

답변1

기존 설정을 확장하거나 변경할 수 있는 방법은 다음과 같습니다.

  1. 변경하려는 설정이 이미 로드되어 있는지 확인하십시오. 서문에서는 이것이 사실이라고 보장하지 않으므로 \LoadMicrotypeFile.

  2. 키를 통해 기본 설정을 로드하는 새 설정을 만듭니다 load.

  3. 임의의 글리프에 대한 돌출을 0으로 설정하려면 명시적으로 그렇게 해야 합니다. 빈 돌출 값(예: \textendash = {,})을 선언해도 아무 것도 변경되지 않습니다.

  4. 받은 경고가 방해가 된다면 패키지를 로드하여 경고를 표시하지 않을 수 있습니다 verbose=silent. 그러나 이렇게 하면 다른 모든 microtype경고도 억제됩니다. (설정 키 같은 것이 있으면 유용할 것 같지만 override, 지금은 그렇습니다.) 편집하다: 버전 2.7부터 재정의된 목록이 로드된 목록과 동일한 경우 더 이상 경고가 표시되지 않습니다.

따라서 이것을 코드로 바꾸려면 다음을 수행하십시오.

\usepackage[verbose=silent]{microtype}
\LoadMicrotypeFile{ptm}
\SetProtrusion
    [ name = ptm-adapted, % the name is optional
      load = ptm-T1 ]
    { encoding = T1,
      family   = {ptm,ptmx,ptmj} }
    { 
      \textendash = { ,0},      % left protrusion will remain untouched, 
                                % right protrusion set to zero
     %\textendash = {150,150},  % this would set protrusion on both sides to 150
    }

둘 이상의 글꼴에 대한 설정을 조정하려면 동일한 작업을 다시 수행해야 합니다(설정 로드 및 새 글꼴 생성). 즉, 여러 번 문제를 실행해야 \SetProtrusion합니다 \LoadMicrotypeFile.

\LoadMicrotypeFile{ppl}
\SetProtrusion
    [ load = ppl-T1 ]
    { encoding = T1,
      family   = {ppl,pplx,pplj} }
    { ... }

더 간단하지만 덜 세분화된 또 다른 가능성은 factor1000 미만의 패키지를 로드하는 것입니다. 그러면 모든 글꼴의 모든 글리프에 대한 돌출 값의 크기가 조정됩니다. 예를 들어,

\usepackage[factor=500]{microtype}

모든 돌출 값이 절반으로 줄어듭니다.

답변2

현재 microtype다음과 같이 돌출 조정을 로드합니다. 아마도 누군가 내 가치관을 사용하는 데 관심이 있을 것입니다. 특히 ptmImho가 너무 돌출된 Times( )에 대해 그렇습니다.제가 선택한 조정은 철저한 시도가 아니라는 점에 유의하시기 바랍니다.

\usepackage[verbose=silent]{microtype}
    \LoadMicrotypeFile{ptm}
    \SetProtrusion
      [ name = ptm-adapted,
        load = ptm-T1 ]
      { encoding = T1,
        family   = {ptm,ptmx,ptmj} }
      { f = { ,-200},
        r = { ,-100},
        \textquoteleft     = {300, }, % default uses 500
        \textquoteright    = { ,300}, % default uses 500
        \textquotedblleft  = {75, }, % default uses 300
        \textquotedblright = { ,75}, % default uses 400
        \textendash = {0,0}, % default is 300/300
        \textemdash = {0,0}, % default is 200/200
        /           = { ,-100}, % default uses 200
        (           = {67, }, % default uses 100
        )           = { ,67}, % default uses 200
        {,}         = { ,167}, % default uses 500
        :           = { ,167}, % default uses 500
        ;           = { ,100}, % default uses 300
        .           = { ,233}, % default uses 700
        ?           = { ,33} } % default uses 100
    \SetProtrusion
      [ name = ptm-it-adapted,
        load = ptm-it-T1 ]
      { encoding = T1,
        family   = {ptm,ptmx,ptmj},
        shape    = {it,sl} }
      { f = { ,-300},
        : = { ,0}, % default uses 500
        . = { ,233} } % default uses 700
    \LoadMicrotypeFile{ppl}
    \SetProtrusion
      [ name = ppl-adapted,
        load = ppl-T1 ]
      { encoding = T1,
        family   = {ppl,pplx,pplj} }
      { \textquoteleft     = {150, }, % default uses 500
        \textquoteright    = { ,150}, % default uses 700
        \textquotedblleft  = {75, }, % default uses 300
        \textquotedblright = { ,75}, % default uses 400
        \textendash = {0,0}, % default is 300/300
        \textemdash = {0,0}, % default is 200/200
        /           = { ,100}, % default uses 300
        (           = {50, }, % default uses 100
        )           = { ,150}, % default uses 300
        {,}         = { ,250}, % default uses 500
        :           = { ,250}, % default uses 500
        ;           = { ,250}, % default uses 500
        .           = { ,350}, % default uses 700
        ?           = { ,100} } % default uses 200
    \SetProtrusion
      [ name = txtt ]
      { encoding = T1,
        family   = txtt,
        shape    = {it,sl} }
      { f = { ,-120},
        - = { ,300} } % in order to match ordinary hyphens' protrusion in body text

관련 정보