Weblog Tomasza Przechlewskiego [Zdjęcie T. Przechlewskiego]


scrum
random image [Photo gallery]
Zestawienie tagów
1-wire | 18b20 | 1wire | 2140 | 3rz | adamowicz | afera | alsamixer | amazon | amber | amman | anniversary | antypis | apache | api | applebaum | arm | armenia | astronomy | asus | atom.xml | awk | aws | bachotek | bakłażan | balcerowicz | balta | banan | bash | batumi | berlin | białowieża | białystok | bibtex | bieszczady | biznes | blogger | blogging | blosxom | bme280 | bono | borne-sulinowo | breugel | bt747 | budapeszt | budyniowo | budyń | bursztyn | campagnolo | canon | cedewu | chaos | chello | chiller | chillerpl | chown | christophe dominici | chujowetaśmy | ciasto | cmentarz | contour | coronavirus | covi19 | covid | covid19 | cron | css | csv | cukinia | curl | cycling | d54250wykh | darkages | dbi | debian | dejavu | dhcp | dht22 | dia | docbook | dom | dp1500 | ds18b20 | duda | dulkiewicz | dulkiewiczowa | dyndns | dynia | ebay | economy | ecowitt | ekonomia | elka | elm | emacs | emacs23 | english | ep | erasmus | erasmusplus | ess | eu | eurostat | excel | exif | exiftool | f11 | fc | fc11 | fc15 | fc29 | fc5 | fc8 | fedora | fedora21 | fenix | ffmpeg | finepix | firefox | flickr | folau | fontforge | fontspec | fonty | food | fop | forms | foto | france | francja | fripp | froggit | fuczki | fuji | fuse | gammu | garden | garmin | gas | gawk | gazwyb | gdańsk | gdynia | gender | geo | geocoding | georgia | gft | ggplot | ghost | git | github | gmail | gmaps | gnokii | gnus | google | google apps script | googlecl | googleearth | googlemaps | gotowanie | gphoto | gphoto2 | gps | gpsbabel | gpsphoto | gpx | gpx-viewer | greasemonkey | gruzja | grzyby | gus | gw1000 | haldaemon | handbrake | hhi | historia | history | hitler | holocaust | holokaust | hp1000se | hpmini | humour | iblue747 | ical | iiyama | ikea | imagemagick | imap | inkscape | inne | internet | j10i2 | javascript | jhead | jordania | k800i | kajak | kamera | karob | kibbeh | kleinertest | kml | kmobiletools | knuth | kociewie kołem | kod | kolibki | komorowski | konwersja | krutynia | krynki | kuchnia | kurski | kłamstwo | latex | latex2rtf | latex3 | lcd | legend | lenny | lesund | lewactwo | lgbt-folly | liban | liberation | linksys | linux | lisp | lisrel | litwa | lizbona | logika | ltr | lubowla | lwp | lwów | m2wś | malta | mapquest | mapsource | maradona | marchew | marimekko | marvell | math | mathjax | mazury | mbank | mediolan | mencoder | mevo | mex | mh17 | michalak | michlmayr | microsoft | monitor | mp4box | mplayer | ms | msc | mssql | msw | mswindows | mtkbabel | museum | muzyka | mymaps | mysql | mz | nafisa | nanopi | natbib | navin | neapol | nekrolog | neo | neopi | netbook | niemcy | niemieckie zbrodnie | nikon | nmea | nowazelandia | nuc | nxml | oauth | oauth2 | obituary | ocr | odessa | okular | olympus | ooffice | ooxml | opera | osm | otf | otftotfm | other | ov5647 | overclocking | ozbekiston | padwa | panoramio | paryż | pdf | pdfpages | pdftex | pdftk | pedophilia | perl | photo | photography | pi | picasa | picasaweb | pim | pine | pis | pit | pizero | plain | plotly | pls | plugin | po | podcast | podlasie | podróże | pogoda | politics | polityka | polsat | portugalia | postęp | powerpoint | połtawa | prelink | problem | propaganda | pseudointeligencja | pstoedit | putin | python | pywws | r | r1984 | radio | random | raspberry | raspberry pi | raspberrypi | raspbian | refugees | relaxng | ridley | router | rower | rowery | roztocze | rpi | rsync | rtf | ruby | rugby | rumunia | russia | rwc | rwc2007 | rwc2011 | rwc2019 | rzym | salerno | samba | sds011 | selenium | sem | senah | sernik | sheevaplug | sienkiewicz | signature | sikorski | sks | skype | skytraq | smoleńsk | sqlite | srtm | sshfs | ssl | staszek wawrykiewicz | statistcs | statistics | stats | statystyka | stix | stretch | supraśl | suwałki | svg | svn | swanetia | swornegacie | szwajcaria | słowacja | tbilisi | terrorism | tesseract | tex | texgyre | texlive | thunderbird | tomato | totalnaopozycja | tourism | tramp | trang | transylwania | truetype | trzaskowski | ttf | turcja | turkey | turystyka | tusk | tv | tv5monde | tweepy | twitter | tykocin | typetools | ubuntu | uchodźcy | udev | ue | ukraina | umap | unix | upc | updmap | ups | utf8 | uzbekistan | varia | video | vienna | virb edit | virbedit | vostro | wammu | wdc | wdfs | weather | weathercloud | webcam | webdav | webscrapping | weewx | wenecja | wh2080 | wiedeń | wikicommons | wilno | win10 | windows | windows8 | wine | wioślarstwo | wojna | word | wordpress | wrt54gl | ws1080 | wtyczka | wunderground | ww2 | www | wybory | wybory2015 | włochy | węgry | xemex | xetex | xft | xhtml | xine | xml | xmllint | xsd | xslt | xvidtune | youtube | yum | zaatar | zakopane | zakupy | zawodzie | zdf | zdrowie | zeropi | zgarden | zgony | zprojekt | łeba | świdnica | żywność
Archiwum
02/2023 | 01/2023 | 11/2022 | 10/2022 | 09/2022 | 07/2022 | 06/2022 | 04/2022 | 03/2022 | 02/2022 | 12/2021 | 09/2021 | 03/2021 | 01/2021 | 12/2020 | 11/2020 | 10/2020 | 09/2020 | 08/2020 | 07/2020 | 04/2020 | 03/2020 | 02/2020 | 01/2020 | 12/2019 | 11/2019 | 10/2019 | 09/2019 | 08/2019 | 07/2019 | 06/2019 | 04/2019 | 02/2019 | 01/2019 | 12/2018 | 11/2018 | 10/2018 | 09/2018 | 08/2018 | 07/2018 | 05/2018 | 04/2018 | 03/2018 | 02/2018 | 01/2018 | 11/2017 | 10/2017 | 09/2017 | 08/2017 | 07/2017 | 06/2017 | 05/2017 | 04/2017 | 03/2017 | 02/2017 | 01/2017 | 12/2016 | 11/2016 | 10/2016 | 09/2016 | 08/2016 | 06/2016 | 05/2016 | 04/2016 | 02/2016 | 12/2015 | 11/2015 | 09/2015 | 07/2015 | 06/2015 | 05/2015 | 02/2015 | 01/2015 | 12/2014 | 09/2014 | 07/2014 | 06/2014 | 04/2014 | 02/2014 | 01/2014 | 12/2013 | 11/2013 | 10/2013 | 09/2013 | 08/2013 | 07/2013 | 05/2013 | 04/2013 | 03/2013 | 02/2013 | 01/2013 | 12/2012 | 11/2012 | 10/2012 | 09/2012 | 08/2012 | 07/2012 | 05/2012 | 03/2012 | 02/2012 | 01/2012 | 12/2011 | 11/2011 | 10/2011 | 09/2011 | 08/2011 | 07/2011 | 06/2011 | 05/2011 | 04/2011 | 03/2011 | 02/2011 | 01/2011 | 12/2010 | 11/2010 | 10/2010 | 09/2010 | 08/2010 | 07/2010 | 06/2010 | 05/2010 | 04/2010 | 03/2010 | 02/2010 | 01/2010 | 12/2009 | 11/2009 | 10/2009 | 09/2009 | 08/2009 | 07/2009 | 06/2009 | 05/2009 | 04/2009 | 03/2009 | 02/2009 | 01/2009 | 12/2008 | 11/2008 | 10/2008 | 09/2008 | 08/2008 | 07/2008 | 06/2008 | 05/2008 | 04/2008 | 03/2008 | 02/2008 | 01/2008 | 12/2007 | 11/2007 | 10/2007 | 09/2007 | 08/2007 | 07/2007 |
O stronie
wykorzystywany jest blosxom plus następujące wtyczki: tagging, flatarchives, rss10, lastbuilddatexhtmlmime. Niektóre musiałem dopasować nieco do swoich potrzeb. Więcej o blosxom jest tutaj
Subskrypcja
RSS 1.0
LaTeX: example of a complex titlepage design

Let's start from example preamble:

\documentclass[twoside]{article}
\usepackage{fancyhdr}

\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}

\makeatletter
%% headlines (\@shorttitle/\@shortauthorlist see below):
\fancyhead[RO]{\@shorttitle}
\fancyhead[LE]{\@shortauthorlist}

 ...
\makeatother

% Title (in Polish) and alternate title (in english):
\title{Hemofiltracja i~rewaskularyzacja u~pacjenta 
  z~zespołem sercowo-nerkowym typu 2}
\alttitle{Hemofiltration in patient with cardio-renal syndrome type 2}

% Authors list:
\author{WLUJ}{Janina Kowalska }
\author{CIL}{Zofia Dyrman}
\author{KCW}{Andrzej Jarzyna}
\author{CIL}{Wacław Jarząbek}
\author{CIL}{Krzysztof Chrostowicz}
% Undefined affiliation raises an error:
% \author{DoPX}{Zdzisław Dyrman}

% Affliations list:
\affiliation{WLUJ}{Wydział Lekarski Uniwersytetu Jagiellońskiego 
 -- Collegium Medicum, ul.~św.~Anny 12, 31--008 Kraków}
\affiliation{CIL}{Centrum Interwencyjnego Leczenia Chorób Serca 
 i~Naczyń, KSzS im.~Jana Pawła II, ul. Prądnicka 80, 31--202 Kraków}
\affiliation{KCW}{Klinika Choroby Wieńcowej UJ, Collegium Medicum,
 KSzS im. Jana Pawła II, ul. Prądnicka 80, 31--202 Kraków}
% Extra affiliation raises an error:
% \affiliation{DRS}{Druskienniki, Pendological Department}

% Short versions of title/authors list (defined if title/authors list
% is too long to fit the headlines:
% \shortauthor{Tratata}
% \shorttitle{Fififif}
%
\begin{document}
\maketitle

\end{document}
LaTeX example titlepage
The titlepage

The main problem is long lists of authors and affiliations. There are more authors than affiliations so affiliations are labelled with consecutive numbers and each author is marked with appropriate label indicating his/her affiliation. It can be done manually of course but with the help of a few clever macros the numbers can be computed by LaTeX. This feature can be particularly helpful when for instance just before the (printing house) deadline a very important author (probably professor) insists his affiliation should be 1 not 4 (for example). All is needed to achieve this is to reorder \affiliation declarations.

The resulting document looks like shown in the picture.

The macros used:

%++Authors and affiliations
\newcount \authornumber
\newcount \affiliationnumber
\authornumber=0
\affiliationnumber = 0
%
\def\alttitle#1{\gdef\@alttitle{#1}}%
\def\shortalttitle#1{\gdef\@shortalttitle{#1}}

\def\author#1#2{%
  \global\advance\authornumber\@ne
  \authorAffiliationId{#1}% -- label --
  \authorName{#2}% -- author's name --
}
%
\def\authorAffiliationId#1{%
  \expandafter\def\csname theauthorid\number%
    \authornumber\endcsname {#1}% --author's id--
  %% label defined to check if affiliation exists:--
  \expandafter\def\csname theaffid:#1\endcsname {#1}%
}
%
\def\authorName#1{%
  \expandafter\def\csname theauthor\number%
    \authornumber\endcsname{\ignorespaces#1\unskip}%
  \expandafter\let\csname theauthoraffiliation\number%
    \authornumber\endcsname\relax
}
%
\def\affiliation#1#2{%
  \global\advance\affiliationnumber\@ne
  \expandafter\def\csname theaffiliation \number%
    \affiliationnumber \endcsname {\ignorespaces#2\unskip}%
  \expandafter\edef\csname affid:#1\endcsname {\number\affiliationnumber}%
  %% if defined in class CLS add error mesage:
  %%\@ifundefined{theaffid:#1}{\ClassError{CLS}{**Affiliation undefined: `#1'}\@ehc}{}%
}
%
\def\@author{\@defaultauthorlist}
\def\@affiliation{\@defaultaffiliationlist}
%
\newcount\count@@
%
% Authors/affiliations lists
\def\@defaultauthorlist{%
   \count@=\authornumber
   \count@@=0
   \begingroup
   \loop
   \ifnum\count@>0
      \advance\count@@ by 1
      \ignorespaces\csname theauthor\number%%
         \count@@\endcsname %-- autor's name --
      \edef\@TmP@Aff@Etykieta{\csname theauthorid\number\count@@ \endcsname}%
      % --check if \@TmP@Aff@Etykieta  exists: --
      \@ifundefined{affid:\@TmP@Aff@Etykieta}%
      %% if defined in class CLS add error mesage:
      %%{\ClassError{CLS}{**Brak afiliacji dla \csname theauthor\number%
      %%\count@@\endcsname}\@ehc}%
      %% print out affiliation label (number):
      {$^{\csname affid:\@TmP@Aff@Etykieta\endcsname}$}%
      %--Every author but last is separated by a comma--:
      \ifnum\count@=1\relax\else,\space\fi
      \advance\count@ by -1
   \repeat
   \endgroup
  }
% Short list of authors (w/o affiliations labels) for headlines.
% Simplified version of @defaultauthorlist:
\def\@defaultshortauthorlist{%
   \count@=\authornumber
   \count@@=0
   \begingroup
   \loop
   \ifnum\count@>0
      \advance\count@@ by 1
      \ignorespaces\csname theauthor\number\count@@\endcsname
      \ifnum\count@=1\relax\else,\space\fi
      \advance\count@ by -1
   \repeat
   \endgroup
  }
%
% Affilitions list:
\def\@defaultaffiliationlist{%
   \count@=\affiliationnumber
   \count@@=0
   \begingroup
   \loop
   \ifnum\count@>0
      \advance\count@@ by 1
      $^{\the\count@@}$ %-- affiliation number
      %-- print out the affiliation:
      \ignorespaces\csname theaffiliation \number\count@@\endcsname
      % ++Every affiliation but last is separated by a comma ++ :
      \ifnum\count@=1\relax\else,\space\fi
      % każda afiliacja od nowego wiersza:
      \par
      \advance\count@ by -1
   \repeat
   \endgroup
  }
% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
% ++SIMPLIFIED titlepage (just to demonstrate macros defined):++
\renewcommand\maketitle{%
  \begin{titlepage}%
    \let\footnotesize\small
    \let\footnoterule\relax
    \let \footnote \thanks
    % ++Title: ++
    \parindent0pt
    \rightskip0pt plus 4em \pretolerance10001
    \leavevmode \noindent
    {\Large \sffamily \bfseries
    \@title\par
    % ++ Optional alternative title:
    \@ifundefined{@alttitle}{}{\vskip9pt%
    \large \sffamily \bfseries \@alttitle \par} }
    \vspace{5mm}
    % ++Authors list:
    {\rightskip 0pt plus6em%
     \@author\par}
    %
    \vspace{30pt}
    % ++Affiliations list
    {\rightskip 0pt plus6em \@affiliation\par}
    %
    % ++Define content for running headers/footers:
    \@ifundefined{@shortauthorlist}{\gdef\@shortauthorlist{\@defaultshortauthorlist}}{}%
    \@ifundefined{@shorttitle}{\gdef\@shorttitle{\@title}}{}%
    \@ifundefined{@shortalttitle}{\gdef\@shortalttitle{\@alttitle}}{}%
    % 
    \thispagestyle{empty}
  \end{titlepage}%
  %
  \setcounter{footnote}{0}%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\@thanks\@empty
  \global\let\title\relax
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax
}%%//maketitle//

\def\shorttitle#1{\gdef\@shorttitle{#1}}
\def\shortauthorlist#1{\gdef\@shortauthorlist{#1}}
\let\shortauthor\shortauthorlist

url | Wed, 27/03/2013 09:02 | tagi: ,
LaTeX: how to highlight some bibliography entries by adding an asterisk before the entry?

Author-year citation style is assumed.

If a bibliography is prepared manually it is as easy as to precede each entry with say \bibAst command. Example:

\newcommand\bibAst{\leavevmode\hbox to0pt{\hss$^\ast$}}

\harvarditem[Bagozzi and Dholakia]{Bagozzi and
  Dholakia}{2006}{bagozzidholakia06}
\bibAst\textsc{Bagozzi, R.~P.,  {\small and} U.~M. Dholakia}  (2006): ``Open
  Source Software User Communities: A Study Of Participation In {L}inux {U}ser
  {G}roups,'' \emph{Management Science}, 52(7), 1099--1115.

If one insists on using BiBTeX one has to mark records which are to be highlighted. It can be done with an extra field (named highlight in the example below):

@Article{bagozzidholakia06,
  title	= "Open Source Software User Communities: A Study Of
   Participation In {L}inux {U}ser {G}roups",
  author	= "Bagozzi, Richard P. and Dholakia, Utpal M.",
  journal	= j-msci,
  pages		= "1099--1115",
  number	= "7",
  volume	= "52",
  year		= "2006",
  highlight     = "Y"
}

Fields unknown to BiBTeX's particular style are omitted, so highlight cause no harm when processed with standard BiBTeX style.

One need to modify BiBTeX style now. This is a two-step procedure. First one has to add highlight to the body of ENTRY function:

ENTRY
 {
  ...
  highlight
 }

Next one has to modify format.authors function. Exact form of a format.authors function is style-dependent. In case of apalike the code looks like:

%FUNCTION {format.authors}
%{ author empty$
%    { "" }
%    { author format.names }
%  if$
%}
% change to:
FUNCTION {format.authors}
{ author empty$
    { "" }
    { highlight empty$
       { author format.names }
       { "{\bibAst}" author format.names * }
       if$
    }
  if$
}

BTW: the meaning of some BiBTeX expressions are as follows: S1 S2 * denotes S1 S2 strings concatenation; L F1 F2 if$ denotes logical if (execute F1 if L is true otherwise execute F2).

The contents of highlight is irrelevant. Sole existence of highlight denotes that the record is highlighted.

NOTE: the style should be more elaborate if some BiBTeX entries starts with something other than authors names.

url | Tue, 26/03/2013 10:29 | tagi: , ,
LaTeX: znaki cięcia/pasery, pakiety crop i fancyhdr

Kol. WP dba żebym nie wyszedł z wprawy w temacie znajomości LaTeXa.

Jakiś czas temu zażyczył sobie znaków cięcia (zwanych także paserami). Znaki cięcia mają określać wielkość kartki papieru jako 290x205mm (prawie A4). Mają być umieszczone na stronie o nietypowych wymiarach 330x250mm.

Używając pakietu crop można powyższe zalecenie zrealizować następująco:

\documentclass{article}

%% Inne pakiety dołączyć tutaj ...

\setlength\paperheight {290mm}\setlength\paperwidth{205mm}
\usepackage[cam,center,width=250truemm,height=330truemm,pdftex]{crop}
%%
%% Kolumna ma być wyśrodkowana na kartce (zalecenie drukarni)
%% Margines wynosi ( \paperwidth -\textwidth )/2
\oddsidemargin 18.5truemm %% dla \textwidth =  168mm
\evensidemargin\oddsidemargin

\begin{document}

...

\end{document}

No i działa. Dokument jest składany XeTeXem; używa w związku z tym pakietów polyglossia, fontspec, xunicode oraz xltxtra. Powyższe pakiety korzystają z kolei ze stada pakietów z l3kernel/l3packages bundles (fragment przyszłej, ciągle tworzonej od 20 bodajże lat, trzeciej wersji LaTeXa -- LaTeX3 project).

Po jakimś czasie okazało się, że nie działa w MikTeX 2.09. Pierwsza (tytułowa) strona jest podniesiona (względem znaków cięcia) o ok 4mm w porównaniu do wszystkich następnych.

Po dłuższym badaniu stwierdzono, że winna jest dwuwierszowa pagina górna znajdująca się na stronie tytułowej. Wydawała się niegroźna i co więcej, dokument był poprawnie kompilowany, ale tylko w dystrybucji TL 2011. Coś zmieniono w zestawie pakietów l3* (których jest dużo jak wiemy) i to te pakiety odpowiadają za błąd.

Żeby obejść problem postanowiłem składać dwuwierszową paginę w pudełko pionowe (\vbox) o wysokości równej wysokości wiersza tekstu:

\setbox0\hbox{\PM@HeaderFont\strut} %% 
\newdimen\PM@HeaderHt \PM@HeaderHt=\ht0
\def\PM@vboxToOneLine#1{\vbox to\PM@HeaderHt{#1\vss}}
%% ^^^^^^^ pudełko o wysokości wiersza tekstu ^^
%% %% ...
\fancypagestyle{plain}{%% zawartość paginy na stronie tytułowej:
\fancyhf{} % 
 %% ...
\fancyhead[L]{\leavevmode 
  \hbox{\PM@vboxToOneLine{\PM@HeaderFont pierwszy-wiersz ... \\
         ... drugi wiersz ...}}} %
\fancyhead[R]{\leavevmode 
   \hbox{\PM@vboxToOneLine{\PM@HeaderFont pierwszy-wiersz ... \\
         ... drugi wiersz ...}}}
%% ...
}

Teraz działa lepiej.

Nawiasem mówiąc dwuwierszowe paginy to kiepski pomysł. W szczególności fancyhdr wyrównuje górne wiersze pagin, co oznacza, że np. kreska pod paginą będzie nie wyrównana jeżeli (przykładowo) lewa pagina jest dwuwierszowa a prawa jednowierszowa. W omawianym przypadku nie ma kreski pod paginą, dwuwierszowa pagina jest zdefiniowana wyłącznie na stronie tytułowej (której układ jest znakomicie różny od pozostałych stron) a i tak skończyło się problemem.

url | Fri, 15/03/2013 08:52 | tagi: ,