Skip to content

Commit

Permalink
Hurlus redémarre
Browse files Browse the repository at this point in the history
  • Loading branch information
glorieux-f committed Aug 30, 2023
1 parent da2679c commit ef80871
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 54 deletions.
27 changes: 10 additions & 17 deletions tei_latex/template.tex → tei_latex/noredo.tex
Original file line number Diff line number Diff line change
Expand Up @@ -68,27 +68,16 @@
% \usepackage{hypcap} % links in caption ?
% \usepackage{marginnote}
% TESTED

% fonts
% \usepackage{ebgaramond-maths} % OK, too light ?
% \usepackage{CormorantGaramond} % OK
% \usepackage{DejaVuSans} % correct
% \usepackage{firamath} % choose firasans instead, firamath unavailable in Ubuntu 21-04
% \usepackage[default]{gfsbodoni} % bugs
% \usepackage{helvet} % not for XeLaTeX
% \usepackage[sfdefault,medium]{inter} % no small caps
% \usepackage[]{kpfonts} % not otf for XeLaTeX
% \usepackage{LibreBodoni} % OK, too heavy
% \usepackage[default,oldstyle,scale=0.95]{opensans} % no small caps
% \usepackage[]{roboto} % SmallCaps, Regular is a bit bold
% \usepackage{TheanoDidot} % no italic

% \usepackage{adjustbox} % powerful ?
% \usepackage{background} % doesn’t work with xetek
% \usepackage{bookmark} % prefers the hyperref hack \phantomsection
% \usepackage[color, leftbars]{changebar} % 2 cols doc, impossible to keep bar left
% \usepackage[color, leftbars]{changebar} % pb 2 cols doc, not lualatex
% \usepackage{epigraph} % unsolve bug in twocols
% \usepackage{framed} % pb with footnotes
% \usepackage[utf8x]{inputenc} % inputenc package ignored with utf8 based engines
% \usepackage{flushend} % bad for last notes, supposed flush end of columns
% \usepackage{framed} % bad for footnote
% \usepackage{footnotebackref} % seems lost in 2 cols
% \usepackage[stable]{footmisc} % BAD for complex notes https://texfaq.org/FAQ-ftnsect
% \usepackage{multicol} % not compatible with too much packages (longtable, framed, memoir…)
% \usepackage{sectsty} % \chapterfont OBSOLETE
Expand All @@ -97,7 +86,11 @@
% \usepackage[breakable]{tcolorbox} % text styling gone, footnote hack not kept with breakable
% \usepackage{verse} % not enough control on indent, poetry is better


% tested fonts
% Sans
% OpenSans: no small caps
% IBM Plex Sans: no small caps
% DejaVu Sans: no small caps

%%%%%%%%%%%%%%%%%
% Teinte macros %
Expand Down
4 changes: 1 addition & 3 deletions tei_latex/tei_flow_latex.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ for example: abstract.
<xsl:import href="../tei_common.xsl"/>
<xsl:import href="tei_common.xsl"/>
<xsl:import href="tei_common_latex.xsl"/>
<xsl:param name="latex_parnoindent">\parnoindent </xsl:param>
<xsl:param name="latex_parnoindent"/>
<xsl:param name="quoteEnv">quoteblock</xsl:param>
<xsl:param name="pbStyle">visible</xsl:param>
<xsl:param name="latex_pb">\pb</xsl:param>
Expand Down Expand Up @@ -1286,15 +1286,13 @@ for example: abstract.
<!-- Block or multi block -->
<xsl:otherwise>
<xsl:call-template name="tei:makeHyperTarget"/>
<xsl:if test="$prevblock and local-name($prevblock) != 'quote'">\quoteskip</xsl:if>
<xsl:text>\begin{quoteblock}&#10;</xsl:text>
<xsl:if test="not(tei:p|tei:list)">\noindent </xsl:if>
<xsl:apply-templates>
<xsl:with-param name="message" select="$message"/>
</xsl:apply-templates>
<xsl:if test="not(tei:p|tei:l|tei:list)">&#10;</xsl:if>
<xsl:text>\end{quoteblock}</xsl:text>
<xsl:if test="$nextblock">\quoteskip</xsl:if>
<xsl:text>&#10;</xsl:text>
</xsl:otherwise>
</xsl:choose>
Expand Down
3 changes: 0 additions & 3 deletions tei_latex/tei_linking_latex.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ A light version for XSLT1, with local improvements.
2021, frederic.glorieux@fictif.org
-->
<xsl:template match="tei:anchor">
<!--
<xsl:call-template name="tei:makeHyperTarget"/>
-->
<xsl:message>TOD BUG</xsl:message>
</xsl:template>
<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
<desc>[latex] <param name="where">where</param> </desc>
Expand Down
33 changes: 20 additions & 13 deletions tei_latex/tei_meta_latex.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,26 @@ TEI to LaTeX, metadata for preamble
<xsl:apply-templates select="/tei:TEI/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:biblStruct[1]/tei:monogr[1]/tei:title[1]/node()" mode="meta"/>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="/*/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title">
<xsl:choose>
<xsl:when test="not(@type) or @type='main'"><xsl:apply-templates mode="meta"/></xsl:when>
<xsl:when test="@type='sub'">\emph{<xsl:apply-templates mode="meta"/>}</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="meta"/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="following-sibling::tei:title">
<xsl:text>\par&#10;</xsl:text>
</xsl:if>
<xsl:if test="position() != last()">\medskip&#10;</xsl:if>
</xsl:for-each>
<xsl:apply-templates select="/*/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[1]" mode="meta"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template name="titlefull">
<xsl:for-each select="/*/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title">
<xsl:choose>
<xsl:when test="not(@type) or @type='main'"><xsl:apply-templates mode="meta"/></xsl:when>
<xsl:when test="@type='sub'">\emph{<xsl:apply-templates mode="meta"/>}</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="meta"/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="following-sibling::tei:title">
<xsl:text>\par&#10;</xsl:text>
</xsl:if>
<xsl:if test="position() != last()">\medskip&#10;</xsl:if>
</xsl:for-each>
</xsl:template>

<xsl:template name="latexDate">
<xsl:param name="el" select="(/*/tei:teiHeader/tei:profileDesc/tei:creation/tei:date)[1]"/>
Expand Down Expand Up @@ -136,6 +140,9 @@ TEI to LaTeX, metadata for preamble
<xsl:text>\def\eltitle{</xsl:text>
<xsl:value-of select="$latexTitle"/>
<xsl:text>}&#10;</xsl:text>
<xsl:text>\def\eltitlefull{</xsl:text>
<xsl:call-template name="titlefull"/>
<xsl:text>}&#10;</xsl:text>
<xsl:variable name="latexDate">
<xsl:call-template name="latexDate"/>
</xsl:variable>
Expand Down
40 changes: 25 additions & 15 deletions tei_latex/teinte.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

\makeatletter % <@@@

\setlength{\parskip}{1pt} % 1pt allow better vertical justification
\setlength{\parindent}{1.5em}


\usepackage{adjustbox} % powerful
\usepackage{alphalph} % for alph couter z, aa, ab…
\usepackage{booktabs} % better table border
\usepackage[strict]{changepage} % for modulo 4
\usepackage{contour} % rounding words
\usepackage[nodayofweek]{datetime}
Expand All @@ -20,18 +20,19 @@
\usepackage{fancyhdr} % control runing heads
\usepackage{float} % supposed a better positionning of tables
\usepackage{fontspec} % XeLaTeX mandatory for fonts
\usepackage{footnote} % used to capture notes in minipage (ex: quote)
\usepackage{footnotehyper} % \savenotes \spewnotes
\usepackage{graphicx} % needed for LuaLaTex to transmit a5paper
\usepackage{lastpage} % p. # of ##
\usepackage{lettrine} % drop caps
\usepackage{manyfoot} % for parallel footnote numerotation
\usepackage[framemethod=tikz,]{mdframed} % maybe used for frame with footnotes inside
\usepackage{multirow} % table, for colspan and rowspan
\usepackage[defaultlines=2,all]{nowidow} % at least 2 lines by par (works well!)
\usepackage[roman]{parnotes} % notes attaches to tables
\usepackage{pdftexcmds} % needed for tests expressions
\usepackage{poetry} % <l>, bad for theater
\usepackage[%
indentfirst=false,
indentfirst=true,
vskip=1em,
noorphanfirst=true,
noorphanafter=true,
Expand All @@ -42,19 +43,21 @@
\usepackage{relsize} % \smaller \larger (ex: quotes in body and footnotes)
\usepackage{setspace} % \setstretch for <quote>
\usepackage{scrextend} % KOMA-common, used for addmargin
\usepackage[explicit]{titlesec} % wear titles, !NO implicit
\usepackage{tabularx, colortbl} % for tables
\usepackage{tikz} % ornaments
\usetikzlibrary{tikzmark} % to point tikzmarknode
\usepackage[most]{tcolorbox}
\usepackage[explicit]{titlesec} % wear titles, !NO implicit
\usepackage{tocloft} % styling tocs
\usepackage[fit]{truncate} % used in runing titles
\usepackage{tabularx, booktabs, multirow, colortbl} % for tables
\usepackage{unicode-math} % math for XeLaTeX or LuaLaTeX
\usepackage[normalem]{ulem} % breakable \uline, normalem is absolutely necessary to keep \emph
\usepackage{xcolor} % named colors
\usepackage[dvipsnames]{xcolor} % colors
\usepackage{xparse} % @ifundefined
\usepackage{xstring} % needed for tests, ex \pn

% do not retry those packages
% \usepackage{footnotebackref} % seems lost
% for testing, not production
\usepackage{blindtext} % generate text for testing
\usepackage{lipsum} % generate text for testing

Expand Down Expand Up @@ -250,15 +253,23 @@
\newenvironment{docTitle}{\LARGE\bigskip\bfseries\onehalfspacing}{\bigskip}
% leftskip makes big bugs in Lexmark printing \sffamily
\newenvironment{epigraph}{\begin{addmargin}[2\parindent]{0em}\sffamily\large\setstretch{0.95}}{\end{addmargin}\bigskip}

% tcolorbox is bad for footnotes in quotes
\definecolor{bordercolor}{HTML}{CCCCCC}

\newenvironment{quoteblock}
{\begin{quoting}\setstretch{0.9}} %
{\end{quoting}}
{
\medskip
\sffamily
}
{
\medskip
}

\newenvironment{frametext}
{\begin{mdframed}[default]} %
{\end{mdframed}}

\quotingsetup{vskip=0pt}
\newcommand{\quoteskip}{\medskip}
\newenvironment{titlePage}
{\Centering}
{}
Expand Down Expand Up @@ -306,14 +317,14 @@

% footnotes
\newif\ifheading
\newcommand*{\fnmarkscale}{\ifheading 0.70 \else 1 \fi}
% \newcommand*{\fnmarkscale}{\ifheading 0.70 \else 1 \fi}
\renewcommand\footnoterule{
\vspace*{0.5em}
{\color{gray}\hrule height \arrayrulewidth width .2\linewidth}
\vspace*{0.5em}
}
\setlength\footnotesep{1.5\footnotesep} % footnote separator
\renewcommand\@makefntext[1]{\parindent 1.5em \noindent \hb@xt@1.8em{\hss{\normalfont\@thefnmark . }}#1} % no superscipt in foot
\DeclareNewFootnote{N}[arabic]
\DeclareNewFootnote{A}[alph] % for editor notes
\renewcommand*{\thefootnoteA}{\alphalph{\value{footnoteA}}} % z, aa, ab…

Expand Down Expand Up @@ -375,7 +386,6 @@
\urlstyle{same} % after hyperref



\makeatother % /@@@>
%%%%%%%%%%%%%%
% </TEI> end %
Expand Down
Binary file removed tei_latex/test.pdf
Binary file not shown.
3 changes: 0 additions & 3 deletions tei_latex/test.sh

This file was deleted.

0 comments on commit ef80871

Please sign in to comment.