Risposte nei forum create
-
AutoreRisposte
-
::
nel pdf che alleghi vedo una cosa che non va: il margine dell’indice è più ristretto della pagina:
infatti noterai che il margine destro di Contents è “più a destra” del margine destro dei paragrafi dell’indice.
Devi sistemarlo con
`\contentsmargin[-1.55em]{1.55em}`i problemi di titletoc con part si sistemano con questa patch:
Part Number separated of Part Name in Table of Contentscmq il codice complessivo dove anche part è sistemata:
`%%% GENERAL SETTINGS
\documentclass[a4paper]{book}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{newpxtext,newpxmath}
\useosf
\usepackage{microtype}
%\usepackage[margin=3cm,heightrounded]{geometry}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% TABLE OF CONTENTS SETTINGS
\usepackage{titletoc}
%\usepackage{showframe}% book — titletoc patch for \part: https://tex.stackexchange.com/a/454553/134574
\usepackage{etoolbox}
\makeatletter
\patchcmd\@part
{\thepart}
{\protect\numberline{\thepart}}
{}{\FAIL}
\makeatother\makeatletter
\contentsmargin[-1.55em]{1.55em} % the default value of \@pnumwith for book class\titlecontents{part}
[0em]
{\addvspace{1.5pc}\filcenter}
{\large\partname~\thecontentslabel\endgraf\bfseries}
{\large}
{} % without page number
[\addvspace{.5pc}]\titlecontents{chapter}
[0em]
{\vspace*{\baselineskip}}
{\mdseries
\llap{\hb@xt@\@pnumwidth{\hfil\thecontentspage}\quad}\chaptername~\thecontentslabel\\
\vspace*{0.3\baselineskip}%
\itshape
}
{\mdseries
\llap{\hb@xt@\@pnumwidth{\hfil\thecontentspage}\quad}%
\itshape
}
{}
[]\titlecontents*{section}
[0em]
{}
{\footnotesize \thecontentslabel~}
{}
{\footnotesize,~\thecontentspage}
[~–~]
[]\makeatletter\@addtoreset{chapter}{part}\makeatother % make chapter begin from 1 every part
\renewcommand{\thechapter}{\Roman{chapter}} % chapter number in Roman
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}} % section number all in arabic%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\renewcommand*\contentsname{\hfill\mdseries\huge Contents} % put ToC title in the right side of the page
\tableofcontents\part{Setting up of a Business}
\chapter{Businness idea and management}\chapter{Business startup}
\section{The choice of the most appropriate legal structure}
\section{Self–employed [Sole trader (\textsc{uk}) — Sole proprietorship (\textsc{usa})]}
\section{Limited company}
\section{Limited partnership \textsc{it}: Società in accomandita}
\section{\textsc{llp} — Limited Liability Partnership (\textsc{uk}) [\textsc{llc} — Limited Liability Company
(\textsc{usa})] \textsc{it} «Società a Responsabilità Limitata con opzione per il regime di trasparenza fiscale»}
\section{Corporation (C Corporation)}
\section{S Corporation \textsc{it}: Società per Azioni trasparente}
\section{Business partnership}
\section{Cooperative}
\section{Unincorporated association (sports club or a voluntary group with no plan to to make a profit)}
\section{Social enterprise (to help people or communities)}\chapter{Financial Accounting \& Management Accounting}
\part{The double–entry bookkeeping system}
\chapter{Recording accounts}
\section{T–Account method}
\section{Double–entry bookkeeping system}
\section{Ledger accounting book}
\section{Journal accounting book}\addcontentsline{toc}{chapter}{Conclusion}
\chapter*{Conclusion}\end{document}`
l’unica cosa su cui sono un po’ dubbioso è se esista un codice più elegante di
`\renewcommand{\thechapter}{\Roman{chapter}} % chapter number in Roman
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}} % section number all in arabic`in ogni caso il risultato è questo
[attachment=2126]section_on_the_same_line_index.png[/attachment]
m
Attachments:
You must be logged in to view attached files.::
continua a non capire, butto là una cavolata.
non sarà per i margini non simmetrici della classe book?
nell’immagine che ho messo compilando il tuo codice
la tabella è necessariamente centrata dal momento
che occupa l’intera pagina… d’altro canto non avendo tu postato
un EMC è impossibile capire se ci sono altre impostazioni
che producono esiti particolarim
::
a me col tuo codice viene una tabella ampia quanto la pagina,
non capisco cosa intendi in questo caso per “decentrata”.
Ecco l’ EMC che non hai allegato
`\documentclass{article}
\usepackage{booktabs}
\usepackage{showframe}
\begin{document}
\begin{table}[htbp]
\caption{Fattori di forma {\bf\emph{HPC}} tempo zero }
\medskip
\label{tab:virgola}
\centering
\begin{tabular}{cccc}
\toprule
Campione & C [Ns$^2$/(kg m$^2$)] & D [Ns$^2$/(kg m$^2$)] & B [Ns$^2$/(kg m$^2$)] \\
\midrule
C1\_HPC\_0F\_NF\_01 & 681,92 & 113,64 & 134,44\\
C2\_HPC\_0F\_NF\_02 & 601,34 & 109,24 & 129,23\\
C3\_HPC\_0F\_NF\_03 & 576,66 & 107,80 & 127,53\\
C4\_HPC\_0F\_F\_04 & 579,73 & 107,77 & 127,49\\
C5\_HPC\_0F\_F\_05 & 613,13 & 109,83 & 129,93\\
C6\_HPC\_0F\_F\_06 & 618,86 & 110,22 & 130,39\\
C7\_HPC\_0F\_F\_07 & 572,68 & 107,50 & 127,17\\
C8\_HPC\_0F\_F\_08 & 579,28 & 107,54 & 127,22\\
\bottomrule
\end{tabular}
\end{table}
\end{document}`
ed ecco cosa vedo
Attachments:
You must be logged in to view attached files.::
per sfizio ed esercizio ho riprodotto l’indice che hai postato all’inizio.
mi sono reso conto che titletoc non gestisce \part (non mi ero mai posto i problema).
C’è una patch su stackexchange.
poi ci sono altre imperfezioni come qualche spazio di troppo nel vecchio codice:
se ti serve, vedo di postare il codice finale completom
::
Vedi qui: How do I get multiple ToC entries in the same line?
Ho riadattato quel codice in questo modo:
`\documentclass[a4paper]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage{titletoc}\titlecontents*{section}%
[1.5em]%
{\small}%
{\thecontentslabel. }%
{}%
{, \thecontentspage}%
[~–\ ]%
[]%\begin{document}
\tableofcontents
\chapter{Midi}
\section{Alba}
\section{Mattina}
\section{Mezzogiorno}
\chapter{Après midi}
\section{Primo pomeriggio}
\section{Prélude à l'après-midi d'un faune}
\section{Ora del té}
\section{Tramonto}
\section{Sera}
\section{Beim Schlafengehen}
\section{Notte}\end{document}`
m
PS come vedi, se copi il mio codice in un file dell’editor
e lo compili, ti esce il pdf senza dover aggiungere nulla.
si tratta di un Esempio (quasi) Minimo Compilabile
::
è il pezzo di codice che ti interessa, ma non è un MWE
che, come è stato detto moltissime volte, è un codice compilabile
senza che chi intende darti una mano debba iniziare a mettere
`\documentclass[a4paper,12pt]{article}
…
\begin{document}
…
\end{document}`
Se tu racchiudi il tuo codice fra le stringhe
all’inizio `[code] … `
e alla fine ` … ` [/code]
la formattazione aiuta il lettorem
14 Ottobre 2018 alle 13:21 in risposta a: philosophy-modern – una domanda su Article e location #114169::
Succede perché anche dopo l’ultima indicazione il codice si aspetta
un’ulteriore indicazione. Se riesci a postare in MWE (e a usare
la formattazione corretta per il codice usando l’icona oppure
mettendo “, qualcuno può verificare e correggere
o integrare il codice per ovviare al trattino che non ci va…m
::
prova un codice del genere
`\documentclass[a4paper, 14pt]{extarticle}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{microtype}
\usepackage[margin=3cm,heightrounded]{geometry}
\usepackage[document]{ragged2e}
\linespread{1.2}
\usepackage{lipsum}\begin{document}
\lipsum[1]
\lipsum[2]
\end{document}`
m
-
AutoreRisposte