\documentclass[DIV=13,%
               BCOR=0mm,%
               headinclude=false,%
               footinclude=false,%
               fontsize=10pt,%
               oneside,%
               paper=a5]%
               {scrartcl}



\usepackage[noautomatic]{imakeidx}



\usepackage{microtype}
\usepackage{graphicx}
\usepackage{alltt}
\usepackage{verbatim}
\usepackage[shortlabels]{enumitem}
\usepackage{tabularx}
\usepackage[normalem]{ulem}
\def\hsout{\bgroup \ULdepth=-.55ex \ULset}
% https://tex.stackexchange.com/questions/22410/strikethrough-in-section-title
% Unclear if \protect \hsout is needed. Doesn't looks so
\DeclareRobustCommand{\sout}[1]{\texorpdfstring{\hsout{#1}}{#1}}
\usepackage{wrapfig}

% avoid breakage on multiple <br><br> and avoid the next [] to be eaten
\newcommand*{\forcelinebreak}{\strut\\*{}}

\newcommand*{\hairline}{%
  \bigskip%
  \noindent \hrulefill%
  \bigskip%
}

% reverse indentation for biblio and play

\newenvironment*{amusebiblio}{
  \leftskip=\parindent
  \parindent=-\parindent
  \smallskip
  \indent
}{\smallskip}

\newenvironment*{amuseplay}{
  \leftskip=\parindent
  \parindent=-\parindent
  \smallskip
  \indent
}{\smallskip}

\newcommand*{\Slash}{\slash\hspace{0pt}}


% http://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url
\PassOptionsToPackage{hyphens}{url}\usepackage[hyperfootnotes=false,hidelinks,breaklinks=true]{hyperref}
\usepackage{bookmark}

\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{english}
\setmainfont{texgyrepagella-regular.otf}[Script=Latin,%
 Ligatures=TeX,%
 Path=/usr/share/texmf/fonts/opentype/public/tex-gyre/,%
 BoldFont=texgyrepagella-bold.otf,%
 BoldItalicFont=texgyrepagella-bolditalic.otf,%
 ItalicFont=texgyrepagella-italic.otf]
\setmonofont{cmuntt.ttf}[Script=Latin,%
 Ligatures=TeX,%
 Scale=MatchLowercase,%
 Path=/usr/share/fonts/truetype/cmu/,%
 BoldFont=cmuntb.ttf,%
 BoldItalicFont=cmuntx.ttf,%
 ItalicFont=cmunit.ttf]
\setsansfont{cmunss.ttf}[Script=Latin,%
 Ligatures=TeX,%
 Scale=MatchLowercase,%
 Path=/usr/share/fonts/truetype/cmu/,%
 BoldFont=cmunsx.ttf,%
 BoldItalicFont=cmunso.ttf,%
 ItalicFont=cmunsi.ttf]
\newfontfamily\englishfont{texgyrepagella-regular.otf}[Script=Latin,%
 Ligatures=TeX,%
 Path=/usr/share/texmf/fonts/opentype/public/tex-gyre/,%
 BoldFont=texgyrepagella-bold.otf,%
 BoldItalicFont=texgyrepagella-bolditalic.otf,%
 ItalicFont=texgyrepagella-italic.otf]



\let\chapter\section


% global style

\pagestyle{plain}




\usepackage{indentfirst}

% remove the numbering
\setcounter{secnumdepth}{-2}

% remove labels from the captions
\renewcommand*{\captionformat}{}
\renewcommand*{\figureformat}{}
\renewcommand*{\tableformat}{}
\KOMAoption{captions}{belowfigure,nooneline}
\addtokomafont{caption}{\centering}







\deffootnote[3em]{0em}{4em}{\textsuperscript{\thefootnotemark}~}


\addtokomafont{disposition}{\rmfamily}
\addtokomafont{descriptionlabel}{\rmfamily}


\frenchspacing
% avoid vertical glue
\raggedbottom

% this will generate overfull boxes, so we need to set a tolerance
% \pretolerance=1000
% pretolerance is what is accepted for a paragraph without
% hyphenation, so it makes sense to be strict here and let the user
% accept tweak the tolerance instead.
\tolerance=200
% Additional tolerance for bad paragraphs only
\setlength{\emergencystretch}{30pt}

% (try to) forbid widows/orphans
\clubpenalty=10000
\widowpenalty=10000





% given that we said footinclude=false, this should be safe
\setlength{\footskip}{2\baselineskip}

\title{Logical vs. visual markup}
\date{}
\author{}
\subtitle{}




% https://groups.google.com/d/topic/comp.text.tex/6fYmcVMbSbQ/discussion
\hypersetup{%
pdfencoding=auto,
pdftitle={Logical vs. visual markup},%
pdfauthor={},%
pdfsubject={},%
pdfkeywords={doc}%
}


\begin{document}






\thispagestyle{empty}


  \strut\vskip 2em
  \begin{center}

  {\usekomafont{title}{\huge Logical vs. visual markup\par}}%
  \vskip 1em
  
  \vskip 2em
  
  \vskip 1.5em





  
    \strut\par
  


  \end{center}


  \vskip 3em
  \par





The markup used to store the text is a \emph{logical} markup. This mean that
every convention used is aimed to represent the logical structure of
the document, not the way it is rendered on a PDF or on an HTML page.
If the output looks broken, it’s a problem which must be fixed on the
software side, not on the text side.


As a matter of fact, in the default configuration, the PDF and the
HTML render very differently. PDF uses serif fonts, while HTML sans.
PDF has the paragraph indented, normally (unless some stretching is
needed) they are not separated by white space, while HTML is without
indentation and are separated by white space.


For the PDF the default layout of the KOMA-script class is used, with
some minor adjustments (like always using serif fonts, instead of the
default sans for the chapter and section titles).


It’s a quite common mistake to try to use the markup the way one would
use a word-processor like Word, OpenOffice and similar programs, or
trying to mimic the layout of the original document even when there is
no need for that. Example: inserting everywhere a \texttt{br} tag to force a
space between paragraphs. Or mark section titles using a \texttt{strong} tag.
These are just errors.


For example, a section title is something more that a bold string. It
shouldn’t happen at the bottom of the page. It should write an entry in
the table of contents. It should have some consistent space around. A
bold string is just an ordinary line in a bold character, an important
line for sure, but nothing more.


So this kind of thing is an error:


\begin{alltt}
<br>
**Title**
<br>

This should be the body
\end{alltt}


While instead it should be this way:


\begin{alltt}
*** Title

This should be the body
\end{alltt}


In some contexts, the two chunk of texts will render more or less the
same way, but in the first chunk we marked up the text visually, in
the second, correct way, logically, as we explicitly told that it is
section title. In this way we know that the logical structure of the
text is preserved across possible (future) changes of style, and we
are not bound to the way the text is rendered with the current fonts
at the present moment in a specific format.


The \texttt{br} tag, to make another example, should be the exception, not the
rule, and used only where needed by the logic of the document to force
a break line, not abused to do something like “let’s make this line a
bit shorter because the PDF is not rendering perfectly”. Because in
this case, when the layout change (it happens from time to time), you
will just have an inexplicably broken line which makes no sense.







% begin final page

\clearpage



% new page for the colophon

\thispagestyle{empty}

\begin{center}





\bigskip
\includegraphics[width=0.25\textwidth]{logo-amw.pdf}
\bigskip

\end{center}

\strut

\vfill

\begin{center}




Logical vs. visual markup






\bigskip



   

       

       

       

       

       
   



\bigskip
\textbf{amusewiki.org}


\end{center}

% end final page with colophon


\end{document}


% No format ID passed.



