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

이호재 조회 수:39608

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

재미삼아 봐주십시오.


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

\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 새 사이트를 오픈하였습니다 [3] 관리자 2009.12.19 48035
1119 [공지] 한국텍학회 회원들께 알립니다. 관리자 2009.12.19 65879
1118 새 홈페이지 개장을 축하합니다. Karnes 2009.12.19 44162
1117 와우. 드디어! Dennis 2009.12.19 42537
1116 DNS관련 알림 Karnes 2009.12.19 40725
1115 여러분의 참여가 필요합니다!!! 이기황 2009.12.19 40742
1114 [공지] 한국텍학회 회원들께 안내메일을 발송했습니다 ChoF 2009.12.20 40490
1113 브라우저별 특성 [10] Karnes 2009.12.20 39363
1112 홈페이지 통합 개편에 즈음하여 조인성 2009.12.20 37006
1111 2010 한국텍학회 학술대회 사전등록 Progress 2009.12.21 30024
1110 [공지] 한국텍학회 회원들께 3차 안내메일을 발송했습니다. [1] ChoF 2009.12.22 35161
» minipage의 parskip이 tikz에 미치는 영향 [1] 이호재 2009.12.23 39608
1108 [공지] ko.TeX Live 2009 발표 [9] MadToad 2009.12.23 150446
1107 시작페이지의 게시판 최근 글 보기에 대한 의견을 구함 [17] karnes 2009.12.24 36691
1106 [묻고 답하기] 게시물의 글꼴 [2] file Progress 2009.12.24 38845
1105 RevTeX에 무슨 일이 일어났을까? karnes 2009.12.24 37624
1104 IE6에서 우리 홈페이지를 보니 [1] file Progress 2009.12.26 32728
1103 [참여요청] faq wiki의 사용 방식에 관하여 Karnes 2009.12.27 30475
1102 KTUG 사이트의 베스트 게시물은 어떤 것인가요? [6] Karnes 2009.12.30 32368
1101 [홈페이지] 설치 페이지에서 [1] file Progress 2009.12.30 27478



XE Login