KTUG마당은 KTUG를 방문하는 모든 이용자가 대화를 나누고 소식을 전하는 곳입니다.

  • 로그인 없이 자유롭게 글을 읽고 쓸 수 있는 철학은 처음과 같이 계속됩니다.
  • Team Blog의 글을 이곳 게시판의 "정보글"로 모았습니다. Team blog는 기고자가 올린 글에 질문을 받는 부담을 줄이기 위하여 댓글을 허용하지 않았습니다. 그러나 이곳 게시판으로 모으면서 댓글을 달 수 있습니다. 게시물을 작성하실 때 댓글을 원하지 않으시면 댓글을 허용하시지 않으시기를 바랍니다. 또한 불필요한 소모성 댓글을 달지 않도록 주의하여 주시기를 바랍니다.
  • TeX과 관련된 질문이나 답변은 QnA 마당을 이용하십시오. TeX과 관련된 질문은 지웁니다
  • MathJax를 이용한 수식조판을 사용하실 수 있습니다. 여기를 참조하세요.
  • 스팸 글을 막기 위하여 짧은 시간 내에 다시 글이 등록되는 IP를 막거나, 광고 글을 막기 위하여 금지어로 .com, .net 등을 설정하고 있습니다. 다소간의 불편함이 있으시더라도 양해 바랍니다.
    • 금지어에서 stackexchange, stackoverflow, ctan, overleaf, , github, google.com, gmail.com, .org, .io, sil.org, wiki.com, tistory.com등은 해제하였습니다.
  • 사용하는 편집기는 CKeditor입니다. 편집기에서 [enter]를 누르면 <p> 태그가 들어가고, 문단으로 생각하고 한줄을 비웁니다. 글줄만 바꾸려면 shift-enter 를 누르시면 <BR>가 들어가므로 용도에 맞게 나누어 쓸 수 있습니다.

자유글 minipage의 parskip이 tikz에 미치는 영향

2009.12.23 13:27

이호재 조회 수:39613

질문게시판에 올려야 할 듯하지만, 문제의 원인을 알았기 때문에 달리 회피하는 방법을 취하여 일단 문제를 해결하였습니다.

재미삼아 봐주십시오.


일전에 재미삼아 만든 원문자 매크로에서 

\abnormalparskip{.25\baselineskip} 등으로 minipage안에 \parskip을 달리 설정하여 주면 \tikz\node에 영향을 준다는 것을 알게 되었습니다.


파일 첨부가 안 되나요?

컴파일 해 보시고 각 단락에서 박스의 높이의 차이에 주목해 주시기 바랍니다.


\documentclass[openany,9pt,showtrims]{memoir} 
%\usepackage{hoze-style}
\usepackage{ifluatex}
\usepackage{xkeyval}
\usepackage{xifthen}
\usepackage{xcolor}
\usepackage{tikz}

\makeatletter
\newcommand\wrapnumfont{\wrapnumbf}
\newcommand\wrapnumbf{\bfseries}
\newcommand\wrapnumbase{}
\newlength\wrapnumwidth
\newlength\wrapsep
\setlength\wrapsep{1.5pt}
\newcommand\wrapbgcolor{black}
\newcommand\wrapfgcolor{white}

\newcommand\cirnum[1]{%  
   \raisebox{-.25\baselineskip}{
   \tikz\node[%
   circle, draw=\wrapfgcolor, thin, inner sep=.1\wrapsep,
   top color=\wrapbgcolor, bottom color=\wrapbgcolor,
text width=\wrapnumwidth, 
font=\wrapnumfont, text badly centered, \wrapfgcolor
]{#1};%
   }%
}


\newcommand\ovalnum[1]{%  
   \raisebox{-.15\baselineskip}{
   \tikz\node[%  
   rectangle, draw=\wrapfgcolor, thin, inner sep=\wrapsep,
   rounded corners=3pt,
   top color=\wrapbgcolor, bottom color=\wrapbgcolor,
text width=\wrapnumwidth, 
font=\wrapnumfont, text badly centered, \wrapfgcolor
]{#1};%
   }%
}

\newcommand\recnum[1]{%  
   \raisebox{-.15\baselineskip}{
   \tikz\node[%
   rectangle, draw=\wrapfgcolor, thin, inner sep=\wrapsep,
   top color=\wrapbgcolor, bottom color=\wrapbgcolor,
text width=\wrapnumwidth, 
font=\wrapnumfont, text badly centered, \wrapfgcolor
]{#1};%
   }%
}

\define@key{wrapnum}{base}{%
\renewcommand\wrapnumbase{#1}%
\setwrapnumwidth%
}
\define@key{wrapnum}{font}{%
\renewcommand\wrapnumfont{\wrapnumbf#1}%
\setwrapnumwidth%
}

\newcommand\setwrapnumwidth{%
\settowidth\wrapnumwidth{\wrapnumfont\wrapnumbase}%
}

\define@key{wrapnum}{type}[circle]{%
\ifthenelse{\equal{#1}{circle}}{\let\wrapnum\cirnum}{}%
\ifthenelse{\equal{#1}{rectangle}}{\let\wrapnum\recnum}{}%
\ifthenelse{\equal{#1}{oval}}{\let\wrapnum\ovalnum}{}%
}

\define@key{wrapnum}{background}{
\renewcommand\wrapbgcolor{#1}
}

\define@key{wrapnum}{foreground}{
\renewcommand\wrapfgcolor{#1}
}

\define@key{wrapnum}{color}{%
\ifthenelse{\equal{#1}{white}}{%
\renewcommand\wrapbgcolor{white}%
\renewcommand\wrapfgcolor{black}%
\renewcommand\wrapnumbf{}%
}{}%
\ifthenelse{\equal{#1}{black}}{%
\renewcommand\wrapbgcolor{black}%
\renewcommand\wrapfgcolor{white}%
\renewcommand\wrapnumbf{\bfseries}%
}{}%
}

\define@key{wrapnum}{wrapseparate}{%
\setlength\wrapsep{#1}%
}

\newcommand\setwrapnum[1]{%
\setkeys{wrapnum}{#1}%
}

\setwrapnum{%
type=rectangle,
base=99,
}

\ifluatex
\newcommand\wrapchar[2][]{%
  \setwrapnum{#1}
  \@wrapchar#2|%
}
\def\@wrapchar#1|{%
 \directlua{%
    local utf8 = unicode.utf8
    str = "#1"
    for i=1, utf8.len(str) do
     char=utf8.sub(str, i, i)
     if char==' ' then
     macro = "\string\\hspace{0.25em}"
     else
     macro = "\string\\wrapnum{"..char.."}\string\\hspace{-0.25em}"
     end
     tex.print(macro)
    end
 }%
}
\fi
\makeatother

\begin{document}

\wrapchar[type=rectangle, color=black]{There's a lady who's sure all that glitters is gold when she's buying a stairway to heaven.}
There's a lady who sure all that glitters is gold when she's buying a stairway to heaven.

\bigskip

\abnormalparskip{.25\baselineskip}
\wrapchar[type=rectangle, color=black]{There's a lady who's sure all that glitters is gold when she's buying a stairway to heaven.}
There's a lady who sure all that glitters is gold when she's buying a stairway to heaven.

\abnormalparskip{2ex}
\wrapchar[type=rectangle, color=black]{There's a lady who's sure all that glitters is gold when she's buying a stairway to heaven.}
There's a lady who sure all that glitters is gold when she's buying a stairway to heaven.

\end{document}

번호 제목 글쓴이 날짜 조회 수
1120 [알림] 홈페이지 리뉴얼과 게시판 변경에 관하여 [4] 관리자 2010.12.23 322150
1119 제주 전용서체 [5] file Progress 2010.06.15 217988
1118 원숫자 file yihoze 2014.01.02 215907
1117 [공지] ko.TeX Live 2010 발표 [11] 관리자 2010.11.07 189380
1116 ko.TeX Live 2013 배포 [6] file 관리자 2013.10.12 175033
1115 한글텍사용자그룹/한국텍학회 웹 사이트 및 서비스 복구에 관한 말씀 관리자 2013.05.06 160033
1114 TeX Live 2016 pretest 설치 안내 [11] 관리자 2016.06.05 150588
1113 [공지] ko.TeX Live 2009 발표 [9] MadToad 2009.12.23 150454
1112 TeX의 수명이 긴 이유 그리고 널리 쓰이지 않는 이유 [45] 메타 2010.06.02 147917
1111 [공지] ko.TeX Live 2011 발표 [9] 관리자 2011.07.29 144641
1110 MathJax를 이용하여 웹에서 수식을 써 봅시다 [27] file 샘처럼 2010.12.29 142487
1109 [공지] お知らせ: TeXユーザの集い 2010 開催予定 (10/23土@東大生研) [1] ChoF 2010.02.01 137824
1108 An Earthshaking Announcement [6] 작은나무 2010.07.12 131435
1107 prologue vs preamble vs preface vs foreword 는 무슨 차이인가요? [4] 에드 2011.02.23 128518
1106 TeX Live 2010을 대비한 ko.TeX 프리테스트 [14] DohyunKim 2010.07.14 127951
1105 기존 회원이 아닌데 회비를 납부하신 분 [1] yihoze 2019.12.13 127635
1104 TeX Live 2013과 ko.TeX 설치 관련 안내 [11] 관리자 2013.09.01 126146
1103 [공지] 한국텍학회 회비를 입금한 분들 중 회원 미등록자 분들께 [7] 관리자 2011.10.20 123269
1102 (ko.) TeX Live 2014 설치를 권장합니다. [37] nanim 2014.07.14 121961
1101 한글 url 문제 [3] file noname 2020.03.08 121410



XE Login