Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision Les deux révisions suivantes
2_programmation:macros:que_sont_les_environnements [2018/12/03 23:30]
jejust
2_programmation:macros:que_sont_les_environnements [2021/07/06 07:06]
jejust Compilation du code d'un exemple.
Ligne 1: Ligne 1:
-====== What are LaTeX "environments======+====== What are LaTeX environments”? ======
  
  
-While TeX makes direct provision for commands, LaTeX adds a +While TeX makes direct provision for commands, LaTeX adds a concept of "environment"
-concept of "environment"; environments perform an action on a block +Environments perform an action on a block (of something or other) rather than just doing something at one
-(of something or other) rather than than just doing something at one+
 place in your document. place in your document.
  
Ligne 15: Ligne 14:
   {}   {}
 </code> </code>
-which defines a ''monoblock'' which may be used as+which defines a ''monoblock'' environment which may be used as:
  
 +<WRAP column 50ex>
 <code latex> <code latex>
 \begin{monoblock} \begin{monoblock}
-  some text set in monospace+  Some text set in monospace.
 \end{monoblock} \end{monoblock}
 </code> </code>
-which will look like: +</WRAP> 
-  ''some text set in monospace'' +<WRAP column 30ex> 
-so it is a particularly simple example.  A rather complicated+<latexdoc> 
 +\documentclass{article} 
 +  \usepackage{lmodern} 
 +  \pagestyle{empty} 
 + 
 +\newenvironment{monoblock}% 
 +  {\ttfamily}% 
 +  {} 
 + 
 +\begin{document} 
 +\large 
 +\begin{monoblock} 
 +  Some text set in monospace
 +\end{monoblock} 
 +\end{document} 
 +</latexdoc> 
 +</WRAP> 
 +<WRAP clear /> 
 + 
 +It is a particularly simple example.  A rather complicated
 environment is introduced by ''\begin{document}''; it looks environment is introduced by ''\begin{document}''; it looks
 simple, but needs all sorts of special TeX code to make it work simple, but needs all sorts of special TeX code to make it work
 "transparently"; most environments are more elaborate than "transparently"; most environments are more elaborate than
-''monoblock'' and //much// simpler than +''monoblock'' and //much// simpler than ''document''.
-''document''.+
  
 An environment puts its content inside a TeX //group//, so that An environment puts its content inside a TeX //group//, so that
Ligne 44: Ligne 62:
 {\ttfamily some text set in monospace} {\ttfamily some text set in monospace}
 </code> </code>
-though in fact many useful environments are just as simple (to look +though in fact many useful environments are just as simple (to look at). 
-at).  Some, such as ''verbatim'', look simple but are +Some, such as ''verbatim'', look simple but are actually very tricky inside.
-actually very tricky inside.+
  
 LaTeX also allows arguments to an environment: LaTeX also allows arguments to an environment:
Ligne 60: Ligne 77:
 \begin{fontblock}{\ttfamily} \begin{fontblock}{\ttfamily}
 </code> </code>
-would produce the same effect as the ''monoblock'' +would produce the same effect as the ''monoblock'' environment.
-environment.+
  
 Environments may also have optional arguments, in much the same way as Environments may also have optional arguments, in much the same way as
Ligne 92: Ligne 108:
 produces an error message produces an error message
  
-<code latex>+<code text>
 ! Illegal parameter number in definition of \endnormaltext. ! Illegal parameter number in definition of \endnormaltext.
 </code> </code>
Ligne 108: Ligne 124:
  
 ----- -----
 +//Source:// [[faquk>FAQ-whatenv|What are LaTeX “environments”]]
  
-//Source:// [[faquk>FAQ-whatenv|What are LaTeX "environments"]] +{{htmlmetatags>metatag-keywords=(LaTeX,programmation,environnements personnalisés
- +metatag-og:title=(What are LaTeX environments”?)
-{{htmlmetatags>metatag-keywords=(LaTeX,concepts+
-metatag-og:title=(What are LaTeX "environments")+
 metatag-og:site_name=(FAQ LaTeX francophone) metatag-og:site_name=(FAQ LaTeX francophone)
 }} }}
  
2_programmation/macros/que_sont_les_environnements.txt · Dernière modification: 2022/07/05 13:53 de dbitouze
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0